Page 1 of 1

Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 18 Sep 2014 10:18
by leo73
Hi
I wrote a simply Analogic-KeyNum for Pic 16F88, the program display numbers that you digit until "9999" number, you could use this code-function to make every think you have to select somethink.
Below is the wiring diagram of the keyboard and the pic system .
Leonardo Moretti

Re: Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 18 Sep 2014 11:23
by lejeff
Nice :D :D :D

One line instead of 7 for a 12 buttons keypad

Re: Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 18 Sep 2014 19:58
by leo73
Yes lejef , :D it's a asynchronous system , for synchronous system you
need to use the interrupt (two line pins) but the project work well and it's fairly stable
, i tryed it yet .

Re: Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 19 Sep 2014 08:28
by lejeff
Hi

I've created a small excel sheet to compute the ADC values for each button
Playing with the resistors values allow to increase the difference of input voltage between 2 buttons
May be it help to make your project more reliable

Re: Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 19 Sep 2014 13:44
by leo73
Hi lejeff
Thank you so much for your help , now i try to
Download your program and try to find the right
Values to every one resistor.We must remenber,when we make this key-num,to build with E12 series resistor metod are more 'commercial then the other series """where it's possible""".

((( In this time i'm studing a program to drive a little sound module to play .ad4 file, but before I have problems to run the sounds modules' even in stand alone mode. Have you ever heard the sound module wtv-020-sd? )))

Re: Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 19 Sep 2014 14:35
by lejeff
E12 serie means 10% tolerance
My opinion is that it is too large
The min or max ADC count could (in case of more than 2% error vs the nominal resistor value) overlap the max min ADC count of the adjacent buttons (sorted by ADC input voltage)
As Vin = (VCCPIC*R6)/(R(J1<->J3) + R6)
if the resistors are (unfortunatly) at the limit of E12 (10% error) the input voltage cumulated error can reach 20% of the expected value. So overlap cannot be avoid

Re: Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 19 Sep 2014 14:42
by leo73
Hi lejeff
I looked your program i think it's usefull (the 1100 and 1200 are e192 series resistor) , it'll be more usefull if i could start from delta Vin and the program calculate the resistors. :wink:

Re: Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 19 Sep 2014 14:46
by leo73
Hi lejeff
Yes you are right about the large tollerant, this problem is more big when you have a large keyBoard .

Re: Analogic KeyNum for 16F88 pic and 16x2 LCD display

Posted: 19 Sep 2014 15:22
by lejeff
Here
http://www.microchip.com/forums/m694613.aspx
It's said that resistors shall be 1% tolerance

On the excel sheet you can see that if you change R2X value there is no change for C1, C2 and C3 voltage values (your keypad)

These values are the most accurate with E96 resistors
VDD (V) 5
RC2 (R1) 1100
RC3 (R2) 1100
RC4 (R2x) 1370 (not necessary for 3x4 keypad)
RL1 (R3) 332
RL2 (R4) 301
RL3 (R5) 267
RGND(R6) 2210
Resistors tolerance (%) 1 (E96 series)