Works now.
I changed the RC values of my switch debouncing and changed the interrupt rutine from:
to
Code:
low LED1
pause 50
high led1
pause 50
Now it works providing I don't hold the switch for too long or it triggers another interrupt.
Code:
CMCON = 7 ' PortA = digital I/O
INCLUDE "DT_INTS-14.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP.bas" ; Include if using PBP interrupts
LED1 VAR PORTA.1
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler RBC_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE RBC_INT ; enable external (INT) interrupts
Main:
@ sleep
GOTO Main
'---[INT - interrupt handler]---------------------------------------------------
ToggleLED1:
low LED1
pause 50
high led1
pause 50
@ INT_RETURN
Bookmarks