How to read inputs from 4*4 hexadecimal keypad?

Status
Not open for further replies.

asic1984

Full Member level 5
Joined
Nov 15, 2003
Messages
257
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
2,340
hi all

how to read inputs from 4*4 hexadecimal keypad.........

thanks for help
 

interfacing keypad

You can choose one of two methods:

- keyboard scan
- interrupt program

If your project is not too complex, the first method is better (easily understand and implement).
If your project requires to save your I/O ports (save your address space), the second one is better. In this case you should study how to write an interrupt procedure.

good luck,
 

interfacing a keypad

Pls see whether the following articles will help or not:


Keypad Interface Code
**broken link removed**



 

keypad interfacing

hi

thanks for your help

i want to make keypad scanning (software)...............but can u givemore details about how can i do it

thanks for help
 

key pad interfacing program for arm at91sam7s256

write 3 routines:
1) getRowValue
- drive columns low sequentially
- for each column driven low look for 2 rows (max) being low (this way you can implement chording)
2) getKey
- this calls routine 1 and returns max 2rows 2 columns = 2 keys pressed at the same time
3) handleKeypad
- this is your control algoritm

You can also maintain an array of rows x columns and mask it against a previously scanned version of the array to get the changes in keys
cheers
 

keypad interface what is

asic1984 said:
hi

thanks for your help

i want to make keypad scanning (software)...............but can u givemore details about how can i do it

thanks for help

Which language are you using?

If you are using C and the CCS compiler there are examples that come with the compiler. In this case take a look at them ...

best regards
 

keypad on parallel port

this is my sample code, very easy to understand:

***************
4x4 keypad
+--+--+--+--+
| 1 | 2 | 3 | A |
+--+--+--+--+
| 4 | 5 | 6 | B |
+--+--+--+--+
| 7 | 8 | 9 | C |
+--+--+--+--+
| * | 0 | # | D |
+--+--+--+--+
****************
// declare the variable first, i jump straight to the program
while(!kbhit()) {
for(i=0; i<4; i++) {
p1 = 0xff & ~((1<<4) << i);
// send p1 to IO where keypad is connected, for example GPIO
setgpio(0x47, p1); // set row first, can use outportb() instead, send data to that index
for(j=4; j<8; j++) { // scan keypress here
c = getgpio(0x46); // read data from index, can use inportb()
// results of keypress...
switch(c) {
// row 1
case 0xee: printf("1 pressed."); delay(250); break; // put delay to avoid printing several times
case 0xed: printf("2 pressed."); delay(250); break;
case 0xeb: printf("3 pressed."); delay(250); break;
case 0xe7: printf("A pressed."); delay(250); break;

// row 2
case 0xde: printf("4 pressed."); delay(250); break;
case 0xdd: printf("5 pressed."); delay(250); break;
case 0xdb: printf("6 pressed."); delay(250); break;
case 0xd7: printf("B pressed."); delay(250); break;


// row 3
case 0xbe: printf("7 pressed."); delay(250); break;
case 0xbd: printf("8 pressed."); delay(250); break;
case 0xbb: printf("9 pressed."); delay(250); break;
case 0xb7: printf("C pressed."); delay(250); break;

// row 4
case 0x7e: printf("* pressed."); delay(250); break;
case 0x7d: printf("0 pressed."); delay(250); break;
case 0x7b: printf("# pressed."); delay(250); break;
case 0x77: printf("D pressed."); delay(250); break;

default: break;
}
}
}
}

***note: setgpio() and getgpio() function was created to easily set and read data to/from index, of course you can create your own function with outportb() and inportb() - easy task! (is it??)

I hope you can understand what is the code all about.

best regards,
Triple_X, MY
Jom lawat Terengganu Kiteee
 

    asic1984

    Points: 2
    Helpful Answer Positive Rating
    V

    Points: 2
    Helpful Answer Positive Rating
interfacing of keypad

hi

thanks all for help

for nicleo: is this algorithm mean that i will connect the keypad directlly to parallel port without any interfacing to pullup resistors and positive supply voltage as what i already do (but characters are not reading correctly)

also how can i overcome debounce problem

if someone can send schematic for the connection

and thanks all for help
 

explain 3 x 4 array keypad matrix explain pdf

For parallel port interfacing to keypad, I think you need pullup resistors as shown in Figure 1. You may also wish to read this INTERFACING WITH THE KEYPAD A MORE COMPLEX PARALLEL PORT EXAMPLE **broken link removed**

Switch Debouncing (hardware)
**broken link removed**

Switch Decouncing (software)
**broken link removed**
 

read a keypad by parallel port

hi

thanks every one for your help

it works now
 

8052 interrupt keypad

hi

U can try with a keypad encoder also.
Its not nessary to scan or poll. U can find the key when its pressed using the interrupt
U can use the IC MM74C922 . even a layman can do the program using this

Have a nice day

Regards
Gopi
 

4x4 matrix keypad scanning in c

just want to say that this topic helped me a lot

thanks for all
 

noise generated by keypad

HI
I have problem with keypad interrupt. my 8051 colums comes from one port and rows from anther port and it havng one encoder interrupt from 74HCT21 how to scan this key pad using C rograming. pls help me out

Regads
wahid
 

matrix keypad scanning in c

learn
8051 microcontrollers
I SCOTT MACKENZIE or
microcontrollers and interfacinmg
by
HALL
 

Re: keypad interfacing?

hi
how to use the 4x3 keypad?

You have asked the same question in 11 different threads in this forum in the last 2 hours,
don't you think that 1 or 2 posts are enough?

Alex
 

Re: keypad interfacing?

You have asked the same question in 11 different threads in this forum in the last 2 hours,
don't you think that 1 or 2 posts are enough?

Alex

i post in 11 threads but only sadly one person answer my question..
 

Re: keypad interfacing?

you can use sx1508/sx1509 encoder to build your module and then interface it to controller
 

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