MikroElektronika PIC Microcontrollers PIC16 Especificaciones Pagina 241

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 266
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 240
mikroElektronika | Free Online Book | PIC Microcontrollers | Appendix B: Examples
Example 10:
;********************** Header **********************************************
;************* DEFINING VARIABLES *******************************************
cblock 0x20 ; Block of variables starts at address 20h
w_temp ; Variable at address 20h
pclath_temp ; Variable at address 21h
status_temp ; Variable at address 22h
endc
#define DARK PORTB,0 ; Push-button "DARK" is connected
; to PORTB,0 pin
#define BRIGHT PORTB,1 ; Push-button "BRIGHT" is connected
; to PORTB,1 pin
;************************ PROGRAM START *************************************
org 0x0000 ; First program instruction address
goto main ; Jump to label "main"
;************************ INTERRUPT ROUTINE *********************************
org 0x0004 ; Interrupt vector
movwf w_temp ; Save register W
movf STATUS ; Save register STATUS
movwf status_temp
http://www.mikroe.com/en/books/picmcubook/appb/ (36 of 54)5/3/2009 11:36:02 AM
Vista de pagina 240
1 2 ... 236 237 238 239 240 241 242 243 244 245 246 ... 265 266

Comentarios a estos manuales

Sin comentarios