Ok someone else just posted an article with INT's and a response looks very good, first look at my original post code, this works for one interupt, now heres the code that made me interested (if this is part of darrels routines let me know)
Code:
INTCON2.6 = 0 'Interrupt on falling edge of INT0
INTCON2.5 = 1 'Interrupt on rising edge of INT1
' Here two interrupts are declared. One for INT0 (PortB.0) and one for INT1 (PortB.1).
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler INT0_INT, _RcvCAN, PBP, yes
INT_Handler INT1_INT, _DoSomething, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
Main:
Pause 100
Toggle LED
Goto Main
RcvCAN:
' Put your code here or GOSUB it but make SURE you have a RETURN at the end of the routine so you come back here, otherwise you'll crash.
@ INT_RETURN
DoSomethingElse:
Toggle AnotherLED
@ INT_RETURN
now if this is darrels way then I can see the ease of use, im not sure why INT0 and INT1 have falling and leading edge differnt but thats ok. I would like to know how to alter my original code to use 3 interupts though?
Bookmarks