Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interface to 4x4 Keypad - how to scan the keypad correctly?

Status
Not open for further replies.

Maverickmax

Advanced Member level 1
Joined
Dec 6, 2004
Messages
404
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,298
Activity points
3,689
Interface to 4x4 Keypad

Hi

I am struggling to interface my 4x4 Keypad as I connected 4 rows and columns to P0H to P0H7 respectively. I tried to scan it but I kept getting incorrect data. How can I scan the keypad correctly?

I use column as output and row as input.

Please advise me asap

MM
 

Re: Interface to 4x4 Keypad

What is your reading sequence ?

Added after 54 seconds:

And the schematic

Added after 2 hours 22 minutes:

I imagine you are already doing the next:

Initial column value = 0

Set 1 to Column # 1
Read the input - If data != 0 then you have key(s) pressed
Set 0 to Column # 1

Set 1 to Column # 2
Read the input - If data != 0 then you have key(s) pressed
Set 0 to Column # 2

Set 1 to Column # 3
Read the input - If data != 0 then you have key(s) pressed
Set 0 to Column # 3

Set 1 to Column # 4
Read the input - If data != 0 then you have key(s) pressed
Set 0 to Column # 4

Delay to avoid bouncing
 

Re: Interface to 4x4 Keypad

Since I set the columns high and rows as input but each row has a pull-up resistor. So the inputs of row would be high. When key is depressed, say 1. The software will carry algorithm such as setting column to zero one by one. For example:

0111
1011
1101
1110

While key "1" is depressed and column number 1 set to zero which will override row 1 to zero. As button 1 releases, the 1st row will go back to one due to a pull-up resistor. Is that correct?

MM
 

Re: Interface to 4x4 Keypad

If you have pull-up resistors you cannot set the column to 1 to read each row.

But, to help you better, please send the schematics.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top