12 Button Shift register 08M2+ keypad/remote

repkid

New Member
In this thread i will post the schematic and code for a 12 button keypad. The circuit will be able to output in serial and FIRC IR. Low cost is the key. The circuit works with a shift register. The schematic will be uploaded with the code later on this week.
 

repkid

New Member
Source code and schematic for IR Remote version

Like i said here is the schematic and code. I haven't actually ever built this but there is no reason why it shouldn't work. please reply if you did get it to work.

code:
Code:
main:
high c.1
if pinc.2 = 1 then irout c.0,1,0 endif
if pinc.3 = 1 then irout c.0,1,1 endif
if pinc.4 = 1 then irout c.0,1,2 endif
if pinc.5 = 1 then irout c.0,1,3 endif
low c.1
high c.2
if pinc.1 = 1 then irout c.0,1,4 endif
if pinc.3 = 1 then irout c.0,1,5 endif
if pinc.4 = 1 then irout c.0,1,6 endif
if pinc.5 = 1 then irout c.0,1,7 endif
low c.2
high c.4
if pinc.1 = 1 then irout c.0,1,8 endif
if pinc.2 = 1 then irout c.0,1,9 endif
if pinc.3 = 1 then irout c.0,1,12 endif
if pinc.5 = 1 then irout c.0,1,16 endif
low c.4
goto main
here is the schematic:
12-switch_remote.jpg
 

hippy

Ex-Staff (retired)
I haven't actually ever built this but there is no reason why it shouldn't work.
However there are potential dangers; after your "low c.1" you have a "high c.2" so if the right-most top button is held you have C.2 output high shorted through a diode to C.1 output low. Not a good thing.

And if C.1 is output low then you won't be reading pinC.1=1 any time soon when C.2 is high.

There are similar issue with other combinations. If you remove the 'low' commands and make those pins input then you have the problems of floating inputs. It's unfortunately a flawed design.
 

repkid

New Member
oops

Good reasoning hippy. i hadn't thought of that. i am still just beginning with microcontrollers so i'm glad you pointed the problem out. won't stop me from breadboarding it though. there is no risk of blowing up the 08m2+ anyway. Next thing i'll post will have a bit more thought to it than this one.
 

westaust55

Moderator
For your 08M2 with an external chip you could achieve a similar reuslt.

Look at the datasheet for one/both of these:
(a) 74HC165 - parallel in to serial out shift register - needs 3 IO and 2 chips in cascade to handle 12 buttons
(b) 74C922 - 16 key keypad encoder - interrupt pin and 4bit binary value for key press which prevents (blocks) multiple simultaneous key pressed
 
Last edited:

repkid

New Member
Well thanks westaust55 and hippy. i shall be using the forum more in the future. the support is great:D.
 
Top