keyboard for PIC16f84

Status
Not open for further replies.

Maryam

New Member
I have a pic16f84 microcontroller circuit ,I wan to put a keyboard for it to receive a password to work,but I 've used all R0-R7 except R3 ,how can I do that and what part of program should I add to mine?
 
Maryam said:
I have a pic16f84 microcontroller circuit ,I wan to put a keyboard for it to receive a password to work,but I 've used all R0-R7 except R3 ,how can I do that and what part of program should I add to mine?

Have a look at my tutorials, where I show how to scan a matrix keypad, but it takes a fair few I/O pins.

You could use a serial keyboard of some kind, how many keys do you need?.
 
I 've already used all my I/O pins except (RA3 & RB7) ,and I want a 4*3 keyboard . I think I should have a swithching in my I/O pins between keyboard and my LCD. how can I do this switching in hardware and whitch part of program should be added ?
 
You could interface a standard AT keyboard, which would require only 2 pins. Or you could switch to a PIC with more I/O pins (Maybe the 16F628 or even the 16F87x series). Multiplexing I/O pins alternatively often involves using D-latches, such as the 74573.
 
Maryam said:
I 've already used all my I/O pins except (RA3 & RB7) ,and I want a 4*3 keyboard . I think I should have a swithching in my I/O pins between keyboard and my LCD. how can I do this switching in hardware and whitch part of program should be added ?

You could multiplex between them, but it makes it far more complicated, it's easier to use a better PIC, or use a second one to scan the keypad.
 
thank you very much for your quick and good solution ,
I prefer to add a pic16f84 on my board,then I need a program for it and connect perfectly to my first PIC.
I 'll thank you if you help me in writing a program(ofcourse compatible with PIC16F84) whitch accept a password by a keyboard ,then compare it and if it was true gives a 1 in one output pin ,then I can change my program to check if a right password is enterd begin its work.
 
Using a resistor matrix with your keypad, you can interface a 4x3 or even larger ones using a single A/D channel. I've done it before with a 4x4 matrix keypad and it works very well. IIRC, microchip has an application note on how to do it. It consists of using a small grid of resistors to create unique voltage divider values for each key. With each unique divider, you get a unique value with the A/D.

Best of luck!

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