Hi Bruce,
I'd not investigated IOC, cos I wasn't sure how to implement! (like I say - n00b alert!) I like the idea of saving 3 x diodes worth of pcb space!
So, would it go something like thus....
Code:
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler IOC_INT, _Switch_Interupt, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE IOC_INT ; Enable 'Int On Change' interrupts
********************************************************************
(main body of code)
'********************************************************************
Switch_Interupt:
if portB.4 = 0 then mode = 1
if portB.5 = 0 then mode = 2
blah blah...
@ INT_RETURN

Originally Posted by
Mike, K8LH
That's what I thought you might be doin' (OR'ing active lo switch signals to trigger INT).
Is there some compelling reason you're using interrupts for the switches instead of just polling them at regular intervals?
Nothing other than wanting my unit's 'mode' to change the instant a switch is pressed. (what originated this thread, was I'd noticed that even holding a button down for a mere 200ms - to determine say mode 3 or mode 4 from one switch - seemed like a lifetime when playing a guitar, so polling three switches is just not gonna cut it - my code uses a whole heap of pauses in the main body of the program, this would hinder such polling)
Bookmarks