PIC menu - where to put the buttons?
Posted: Thu Aug 23, 2007 10:59 am
I am still struggling with writing a menu.
Anyone got any ideas on best strategy for connecting my Menu, Up, Down and Enter(optional) buttons to PIC (16F886)?
Do I:-
1) put one (Menu) switch on Port B0, interrupt on change, with the rest anywhere, not on interrupts. Pressing Menu jumps to a fast macro where all the other buttons are polled regularly and menus drilled down.
2) or put all 3 to 4 switches on Port B upper nibble, interrupt on change. Then any one pressed leads to an interrupt. BUT I am concerned that this may cause my macros to keep restarting when buttons pressed so, having drilled down a menu, it keeps jumping back to the beginning of menu.
3) do I need the 4th (Enter) key? Anyone wrtten a menu running with just 3 swiches?
My first prototype used 2) but am leaning towards 1) for next one as makes selection of PIC pins easier.
My main code runs really slowly with delays of say 5sec so the menu macro needs to be much faster to react to the buttons quickly.
My menu hardware/software is supposed to be much like the one you get on a PC monitor that sets brightness etc. except using text lines on 16x2 LCD rather than graphics. It enables variables to be set on/off to select modes of operation or incremented/decremented with the Up/Down buttons. Also selects which parameters to display on screen.
See also http://matrixmultimedia.com/mmforums/vi ... ght=echase
Anyone got any ideas on best strategy for connecting my Menu, Up, Down and Enter(optional) buttons to PIC (16F886)?
Do I:-
1) put one (Menu) switch on Port B0, interrupt on change, with the rest anywhere, not on interrupts. Pressing Menu jumps to a fast macro where all the other buttons are polled regularly and menus drilled down.
2) or put all 3 to 4 switches on Port B upper nibble, interrupt on change. Then any one pressed leads to an interrupt. BUT I am concerned that this may cause my macros to keep restarting when buttons pressed so, having drilled down a menu, it keeps jumping back to the beginning of menu.
3) do I need the 4th (Enter) key? Anyone wrtten a menu running with just 3 swiches?
My first prototype used 2) but am leaning towards 1) for next one as makes selection of PIC pins easier.
My main code runs really slowly with delays of say 5sec so the menu macro needs to be much faster to react to the buttons quickly.
My menu hardware/software is supposed to be much like the one you get on a PC monitor that sets brightness etc. except using text lines on 16x2 LCD rather than graphics. It enables variables to be set on/off to select modes of operation or incremented/decremented with the Up/Down buttons. Also selects which parameters to display on screen.
See also http://matrixmultimedia.com/mmforums/vi ... ght=echase