Hi
I have just worked through a interrupt tutorial, and have a question.
Here is sample code of a interrupt on RB0
My question is, can I make the pic sleep, while it waits for the interrupt. If I can where should I put the sleep command? Also can a pic sleep, with say a certain bit on Port A still high?
Thanks
I have just worked through a interrupt tutorial, and have a question.
Here is sample code of a interrupt on RB0
My question is, can I make the pic sleep, while it waits for the interrupt. If I can where should I put the sleep command? Also can a pic sleep, with say a certain bit on Port A still high?
Thanks
Rich (BB code):
; Starting Point
org 0x00
; Set up the varibles
trisha equ 0x85
trishb equ 0x86
porta equ 0x05
portb equ 0x06
count equ 0x20
temp equ 0x23
status equ 0x03
intcon equ 0x0B
goto start
; Interrupt routine
org 0x04
movwf temp
incf count,1
movlw d'10'
subwf count,0
btfss status,0
goto carry_on
goto clear
carry_on
bcf intcon,0x01
movfw temp
retfie
clear
clrf count
bcf intcon,1
retfie
; Set up inerrupt Registers
start
bsf intcon,7
bsf intcon,4
bcf intcon,1
; Set up the ports, as i/o
bsf status,5
movlw 0x01
movwf trishb
movlw 0x10
movwf trisha
bcf status,5
; Main Program
loop
movf count,0
movwf porta
goto loop
end