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.

pls i need help on interfacing 4x4 hex kepad to pic16f877

Status
Not open for further replies.

babatundeawe

Full Member level 5
Joined
Apr 12, 2007
Messages
244
Helped
16
Reputation
32
Reaction score
12
Trophy points
1,298
Location
Nigeria
Activity points
2,738
pic 74hc922

hi guys, pls i need help on interfacing 4x4 hex kepad to pic 16f877. pls good schematic and source code with comments will be appreciated.
thanks.
 

Re: pls i need help on interfacing 4x4 hex kepad to pic16f87

You can use this circuit, enable the pullup at RB4 - RB7 and set to zero RB0 - RB3 (only one for each cilce) to read each colon an read RB4 - RB7 to know hwo is pressed (red zero).

Code:
void Main(void)
{
//Enable pull ups for Bort B (4 to 7)
//Set bits 0 to 3 from port B to output mode

....
}

//Rotine to read a key (0 to 15) return true if pressed and false if not.
bool ReadKey(char keynr)
{
//Reset all outpurts
bit_set(Port_B, 0xF0);

//Select de colum
bit_clear(Port_B, (keynr >> 2));

//Read the line
return !(bit_test(Port_B, (keynr & 0x03) + 4));
}
if you have Any question, ask....

If I helped you, click at helped me...



babatundeawe said:
hi guys, pls i need help on interfacing 4x4 hex kepad to pic 16f877. pls good schematic and source code with comments will be appreciated.
thanks.
[/img]
 
If you want to avoid key debounce in your code use 74HC922 key encoder IC, which will nullify key debouncing problem


Bibin John
www.bibinjohn.tk
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top