Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Looking for resources on making keypad and interface in C

Status
Not open for further replies.

osha

Member level 2
Joined
Nov 20, 2005
Messages
42
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
egypt
Activity points
1,623
keypad

i want any thing about making keypad and interface of it by C languge
i want to made it or show me small keypad(for mobile )becouse icant find separte keypad of mobile
 

techie

Advanced Member level 3
Joined
Feb 5, 2002
Messages
839
Helped
58
Reputation
116
Reaction score
9
Trophy points
1,298
Location
Pakistan
Activity points
7,799
keypad

a keypad cosists of a matrix of rows and columns. a typical mobile k/p has 4 rows/4 cols. each button is a unique connection between a row and a col. to detect a key, you drive the rows one by one and read cols one by one.
 

    osha

    points: 2
    Helpful Answer Positive Rating

osha

Member level 2
Joined
Nov 20, 2005
Messages
42
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
egypt
Activity points
1,623
Re: keypad

send to me C Code for this by debouncing and so on........
and send drawn design of it
thx
 

techie

Advanced Member level 3
Joined
Feb 5, 2002
Messages
839
Helped
58
Reputation
116
Reaction score
9
Trophy points
1,298
Location
Pakistan
Activity points
7,799
keypad

i dont have the code right now. but you should be able to get enough info on the internet.
 

afti_khan

Member level 2
Joined
Oct 29, 2005
Messages
53
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,697
Re: keypad

it's quite simple . just connect the 8 wires of the keypad with a port of the microcontroller. if it's 8051 connect with port1( for instance). but remember to connect all the rows wires at one nibble & the cols wires at other nibbles. then in ur coding first write 0fh at the port then read the port and store the result. the write f0h and do the same. then logically OR the two results. thats ur code for the pressed key.( if no key pressed u'll have ffh) then after a little delay repeat the same process( for debounce).


i've the coding if u need that i can upload it here for u
 

techie

Advanced Member level 3
Joined
Feb 5, 2002
Messages
839
Helped
58
Reputation
116
Reaction score
9
Trophy points
1,298
Location
Pakistan
Activity points
7,799
keypad

I have posted the code in the other post that you made
 

randika

Junior Member level 1
Joined
May 31, 2005
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,485
Re: keypad

hi, I'm sending a PICC code to you... It was originally written for PIC 16f877

But definitely you can get an idea about how to interface a keypad.

Sorry for not applying comments. I think you can understand it without a problem.
A simple code.

cya

Randika K

// reads the keypad and returns a charater
char kbd_read(){

delay_ms(120);
//delay_ms(1);

output_b(0b00001100);
if(!input(PIN_B4)){
return '1';
} else if(!input(PIN_B5)){
return '4';
} else if(!input(PIN_B6)){
return '7';
} else if(!input(PIN_B7)){
return '+';
}

output_b(0b00001010);
if(!input(PIN_B4)){
return '2';
} else if(!input(PIN_B5)){
return '5';
} else if(!input(PIN_B6)){
return '8';
} else if(!input(PIN_B7)){
return '0';
}

output_b(0b00000110);
if(!input(PIN_B4)){
return '3';
} else if(!input(PIN_B5)){
return '6';
} else if(!input(PIN_B6)){
return '9';
} else if(!input(PIN_B7)){
return '#';
} else {
return '+';
}



}
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top