MikroElektronika PIC Microcontrollers PIC16 Specifications Page 250

  • Download
  • Add to my manuals
  • Print
  • Page
    / 266
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 249
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
Page view 249
1 2 ... 245 246 247 248 249 250 251 252 253 254 255 ... 265 266

Comments to this Manuals

No comments