Thanks for your contribution, since you've asked, then here's bit more meat on the bone wrt the switching!
The is for a guitar widget...as such the control box that the final pcb will be going into will be rather very small - I can actually only shoehorn four momentary (6mm square) switches in there - one of these switches acts as an analogue signal 'kill switch' (it simply shorts the guitar signal to ground giving a gated type effect - guitarist love kill switches!) The fourth switch is not integrated into the PIC circuitry at all - that leaves three switches.
Ok, wrt the switching itself....when external power is unit is applied to the circuit, it just sits there waiting in standby for one of the switches to be pressed
Now I could have used just one switch & have the player toggle through the differnt modes - but the modes are used in such a way, they need to be instantly accessible., hence...
Pressing Switch1 takes the unit out of standby & instantly into Mode 1
Pressing Switch2 takes the unit out of standby & instantly into Mode 2
Pressing Switch3 takes the unit out of standby & instantly into Mode 3
once the unit is active (ie in Mode 1, 2 or 3), you can switch between modes freely by just pressing any of the other switches (in other words, you don't have to deacrivate a mode by pressing the dedicated switch again, prior to selecting another switch/mode).
the unit is deactivated by pressing on the switch for whichever mode is active, so if Mode 2 is active, press mode 2 switch & the unit goes into standy again ( an LED gives visual representation of whichever mode is active)
That's pretty much the background - what flushed out this thread was me seeking ideas how to squeeze a 4th, 5th mode etc out of the three switches - obviously such requirements starts invoking double presses, holding switches down for longer or pressing two switches at once (I've still not decided on the final version ...but for now I've settled on pressing two switches together to get a 4th mode)
Then Bruce came along - took a look at the way I'd implemented my interrupts on my schematic ...and chimed in that by changing the interrupt type from the shared 'INT' pin....to Interrupt on Change - I could save on some components/space. That was a fantastic bit of input, but then I hit some issues (I didn't know how to implement IOC - Bruce sorted this....then I got some compilation errors when I tried to combine IOC Interrupts & TMR1 Interrupts ....Darrel has hopefully sorted the latter)
And you're pretty much bang up to date - the thread has took a few bends & curves...but I now know how to implement IOC interrupts, I've therefore saved some space on my (crammed PCB), this has allowed better track layout (but has also meant I've had to redesign my PCB....but worse, redesign/rebuild my test tig (I have a hinged pogo pin endowed test/debug setup - this allows me to program my PIC in situ, as well as facilitating a debug pin (I use the PICKIT2 UART2 to view stuff on my PC) as well as test points for monitoring the analogue aspect of the circuit etc)...
(you can see the four switches I'm referring to on the PCB above - that space to the left will be filled up with other stuff so it's not free space)
The closer I get to finishing this project - the further the goalposts seems to get away!
I'm now using the downtime wrt my interrupt probs being sorted by Darrel, to hack an old eprom eraser my work was throwing away to reutilize as a UV lightbox (with a nice new PIC countdown timer) - I'v just removed the old clunky analogue switch....
I started work on the UV Timer program (& PCB) earlier this afternoon - hope to have it finished over the weekend!
Bookmarks