how to connect keypad?

Forum for problems or queries regarding Flowcode Comms Components. Eg LIN, I2C, SPI, RS232, CAN, IrDA etc

Moderators: Benj, Mods

Post Reply
geetansh
Posts: 29
Joined: Tue Jun 21, 2011 4:23 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

how to connect keypad?

Post by geetansh »

i have to interface a keypad (12 button keypad,image attached below) with pic16f877a,can anyone tell me how to make connections with the help of a schematic etc.
from left to right is: No connection Column 1 Row 0 Column 0 Row 3 Column 2 Row 2 Row 1 No connection
Attachments
Keypad1-L.jpg
Keypad1-L.jpg (44.15 KiB) Viewed 7870 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: how to connect keypad?

Post by Benj »

Hello,

The last page of this datasheet contains the schematic you need.

http://www.matrixmultimedia.com/resourc ... .php?id=89

geetansh
Posts: 29
Joined: Tue Jun 21, 2011 4:23 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: how to connect keypad?

Post by geetansh »

all pins of keypad will be connected to microcontroller??? none of them to +5v???

and can u plz tell me how it works,i saw in flowcode that keypad returns 255 when not pressed and it sends a different no. when a no. is pressed but i am not able to understand how the micro figures out which key is pressed?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: how to connect keypad?

Post by Benj »

Hello,

No there are no connections to +5V.

The Flowcode component macro basically does a raster scan of the keypad a column at a time.

One column is pulled high and each row is then sampled to see if any of the switches in that column are pressed. This technique is then repeated for each column.

Once we know if and which switch is pressed we use a look up table to substitute for a value either in ASCII or numeric format.

Post Reply