Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Appendix B: Examples
Example 14:
;*********************** Header ***************************************
;******************* Defining variables in program ********************
cblock 0x20
HIcnt ; Auxiliary variables for macro pausems
LOcnt
LOOPcnt
PRESCwait
Beep_TEMP1 ; Belongs to macro "BEEP"
Beep_TEMP2
Beep_TEMP3
endc
#define BEEPport PORTD, 2 ; Speaker pin
#define BEEPtris TRISD, 2
expand
;**********************************************************************
ORG 0x0000 ; RESET vector address
goto main ; Jump to program start (label - main)
;**********************************************************************
; remaining code goes here
include "pause.inc"
include "button.inc"
include "beep.inc"
main
banksel ANSEL ; Selects bank containing ANSEL
clrf ANSEL ; All outputs are digital
http://www.mikroe.com/en/books/picmcubook/appb/ (45 of 54)5/3/2009 11:36:02 AM