Hi
I've got a question about the interrupts
Why in a code , "DISABLE" command is used right before the "LABEL" when pic branches in case of an interrupt . Because in case of an interrupt , pic branches directly to the "LABEL" and runs the codes in the programme block written within the LABEL so it is supposed to SKIP the "DISABLE" command then ....
AND
Why "ENABLE" Command is used right before the "RESUME" command ? Because by "RESUME" the programme is supposed to branch where it was before the interrupt , so PIC can not run "ENABLE" command in this order ...
An example code ... and it works fine ...
Thanks in advance
ON INTERRUPT GOTO INT
OPTION_REG=%0000000
INTCON=%10010000
TRISB=%00000001
TRISA=%00000000
PORTA=0
SYMBOL LED=PORTA.0
START:
PAUSEUS 100
GOTO START
DISABLE
INT:
TOGGLE LED
INTCON.1=0
RESUME
ENABLE
END
Bookmarks