Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 11th May 2008, 10:15 PM   (permalink)
New Member
GForce2010 is on a distinguished road
Default Keypad Help

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 by GForce2010; 11th May 2008 at 10:43 PM.
GForce2010 is offline   Reply With Quote
Old 11th May 2008, 10:58 PM   (permalink)
Experienced Member
 
OY2L is on a distinguished road
Default

Nigel's Keypad is a 4x4 matrix and it not have the * and#
OY2L is online now   Reply With Quote
Old 11th May 2008, 11:01 PM   (permalink)
New Member
GForce2010 is on a distinguished road
Default

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.
GForce2010 is offline   Reply With Quote
Old 11th May 2008, 11:14 PM   (permalink)
Experienced Member
 
OY2L is on a distinguished road
Default

What No tutorial are you trying 9.?
OY2L is online now   Reply With Quote
Old 11th May 2008, 11:21 PM   (permalink)
New Member
GForce2010 is on a distinguished road
Default

9.2, the code lock one
GForce2010 is offline   Reply With Quote
Old 11th May 2008, 11:59 PM   (permalink)
Experienced Member
 
OY2L is on a distinguished road
Default

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.
OY2L is online now   Reply With Quote
Old 12th May 2008, 12:16 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

The 3x4 keypads have a rather strange pin out. Looking from the top it goes, C1, R0, C0, R3, C2, R2, R1.

Mike.
Pommie is offline   Reply With Quote
Old 12th May 2008, 12:36 AM   (permalink)
Experienced Member
 
OY2L is on a distinguished road
Default keypad wiring

Maybee it is like this.
Attached Files
File Type: pdf KEYPADSM.pdf (158.8 KB, 16 views)
OY2L is online now   Reply With Quote
Old 12th May 2008, 08:10 AM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 12th May 2008, 08:54 AM   (permalink)
Experienced Member
sachin.kolkar is infamous around these parts
Default

plz check your keypad connections. Did u ground the all rows through 10k or more valued resistor , iwas face the same problem...........
__________________
sachin.kolkar is offline   Reply With Quote
Old 12th May 2008, 10:31 AM   (permalink)
New Member
GForce2010 is on a distinguished road
Default

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........
GForce2010 is offline   Reply With Quote
Old 12th May 2008, 10:41 AM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Quote:
Originally Posted by GForce2010
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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 12th May 2008, 10:53 AM   (permalink)
New Member
GForce2010 is on a distinguished road
Default

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??
GForce2010 is offline   Reply With Quote
Old 12th May 2008, 11:27 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

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.
Pommie is offline   Reply With Quote
Old 12th May 2008, 11:36 AM   (permalink)
New Member
GForce2010 is on a distinguished road
Default

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
GForce2010 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Keypad Scanning Problem with AN557 16F628A johnnyquest Micro Controllers 3 24th November 2007 09:26 PM
keypad encoder Mel_noypi Datasheet/Parts Requests 5 22nd February 2006 02:01 PM
using serial keypad in LAB-1 Rosy Micro Controllers 1 7th May 2004 12:32 PM
PicBasic Keypad program Sora Micro Controllers 0 20th April 2004 07:01 PM
LCD and 4x4 Keypad on the Same port & DTMF using PWM lee_man_tbu Micro Controllers 0 9th December 2003 08:43 PM



All times are GMT. The time now is 12:08 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.