Keypad Help

Status
Not open for further replies.

GForce2010

New Member
I've been slowly working my way through Nigel's PIC tutorials and i'm currently working on a project to make a code lock so i've wired up a 3x4 matric keypad the exact same way that's on the site and used the correct tutorial programme but it doesn't work as it should.

I know for certain i've wired it all up the EXACT same way but when i press the keys i get the following results.

1,2,3 don't work
Press 4 and it displays B
Press 5 and it displays 9
Press 6 and it displays 6
Press 7 and it displays 0
Press 8 and it displays 8
Press 9 and it displays 5
Press 0 and it displays A
Press * and it displays 7
Press # and it displays 4

so as you can imagine i'm a bit confused.

Any help would be greatly appreciated.
 
Last edited:
i know that so the code brings up A and B rather that * and #, that's something i would alter later but none of the keys are bringing up the right number. and i've done the alteration in the code that Nigel states to do if you're only using a 4x3 keypad.
 
Are the numbers on your keypad arranged just as Nigel's ? and is it a matrix keypad and not a decimal ? I think it may be a wiring problem, i'am just trying tut 9.2 here and everything works great.
 
The 3x4 keypads have a rather strange pin out. Looking from the top it goes, C1, R0, C0, R3, C2, R2, R1.

Mike.
 
If you check my tutorial, it uses a lookup table to allocate the correct code for each button - all you need to do is alter the table order to get the responses you want.
 
plz check your keypad connections. Did u ground the all rows through 10k or more valued resistor , iwas face the same problem...........
 
as i said i've wired it up exactly like Nigels schemetic. it is a matrix and i've worked out what each pin is. As Mike wrote it does have a strange pin layout due to the circuit tracks.

Thanks for the help Nigel........i still find it confusing that although i've copied it exactly it's not working for me........
 

It depends how your keypad is actually wired inside, which is why I used a lookup table to convert it.
 
I've just been looking at the tutorial again and i think there might be a mistake in there.

The actual schemitic for the keypad interface board shows the pull up resistors on the the Row lines but in the tutoriual itself it says the pull up resistors are on the Col lines. Which is the correct one??
 
Nigel seems to have his rows and columns switched around in the software. Wire the keypad as in Nigel's hardware and don't remove the two lines of code but do include the 4th pullup resistor. The table may need switching around but at least all keys will work.

Mike.
 
i've just got it working by swapping all the interface connectors around.

looks like in the diagram it's marked row 1 - 4 then col 1-4 but for it to work i had to connect it col 4-1 then col 4-1

anyway it's now working fine.

Think you should have a look at the keypad interface diagram Nigel.

Thanks for all the help
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…