Phone-Keypad interface with PIC16F88/PIC16F84a

Thread Starter

Pinnacle187

Joined Apr 28, 2016
16
Hello, everyone I need a little help with making a Keypad interface with a LCD (16x2) and a PIC16F88 or PIC16F84 (they have same layout). I want to implement a keypad but with a phone keypad function (see image below), by that I mean is that if "2 button" is pressed once a "2" is displayed; twice "a", three times a "b". Also instead of a " * " and " # " buttons, ENTER and DEL bottons with those functions. Displaying something is not that difficult,but I honestly have no idea on how to make a program that does that, because it's the first time I use KEYPADs.




P.S. I have an image of the circuit I made in Proteus (see files). NOTE KEY PAD IS 4X3
link: http://prntscr.com/baw0l4
 

Attachments

Thread Starter

Pinnacle187

Joined Apr 28, 2016
16
UPDATE!!
I got most of the code to work. I can display numbers on the LCD but not letters (like a old cellphone keypad) and I haven't implemented the DELETE and ENTER bottons
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
You want to enter the characters you want for a particular button then use enter to validate the entry.
IOW if you want C then enter 2 four times and then enter.
Use a lookup table.
Max.
 

ErnieM

Joined Apr 24, 2011
8,377
My first question is does your code debounce the switches? It should do that as one day this may stop working when the keys double or triple down each time you press one once.

Getting one key to mean different things takes some planning: how will you know hitting 2 twice is a and not 22, unless you never enter that.

Offhand you need to set a state and track it, perhaps as simple as comparing the present key to the last one. If a slow 2.....2 means 22 while a fast 22 means a would need a timer running in the background (meaning a hardware timer and not a software delay). When last key and present key are equal and time is not expired you know it is a. Similar to get to b.
 

Thread Starter

Pinnacle187

Joined Apr 28, 2016
16
Instead if a ENTER BOTTON, I have decided to make it a SHIFT; so switch from numbers to letters. I only need that last bit, the shift to display numbers on LCD.
This the code that I have (winrar archive), dariipcc is the main code; kdb is the code for the keypad scan....
 

Attachments

Top