Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Simple Diode question....

Status
Not open for further replies.
Easy as pie. Just put the E and RS on their own 2 pins, then connect 2 PIC pins to D4 and D5, and connect the same 2 PIC pins to D6 and D7 with 2 RC networks.

Same basic system as my Shift1-LCD uses, but a derivative. You hold the 2 D pins steady until the 2 caps charge to the required level (the cap voltages will control D6 and D7), then set the 2 D pins to the values you want for D4 and D5, then strobe E within a few uS before the caps have time to change voltage again.

This should give quite high data rates and only needs 4 PIC pins to derive the 6 needed for operating the LCD. Total cost 2R and 2C.
 
Now that's a cool ideal Roman Black. I love trying to get the most out of a 12f683 so much
fun seeing it control a lot of things with just 6 pins.
And even more fun is using a 12f508 lots of fun.
 
Back to it: I breadboarded that voltage-divider keypad and had an Aargh! moment.
Thanks to real small spread between keys on the lowest row (*, 0, #, D), key press resistances bobbing around from 25 Ohms to 45 Ohms, and 5% resistors, my "0" and "#" keys had identical values. I triple-checked the wiring, and found a mistake, but it still had the same problem. So I have to rework the resistor values to get larger ADC increments between keys and try, try again.
But the basic idea still holds true. You can have multiple switches (read: keypad) connected to a single ADC pin and figure when one was pressed and get a value that determines which was pressed.
Later!
 
The trick is to use much larger resistance on your external resistors, so the <60 ohms of the keypads is insignificant. If your voltage divider is in 5k steps then it won't even notice a 60 ohm difference.
 
This time for sure

It finally dawned on me to grab some precision 1% resistors from work and revisit this keypad-to-ADC-pin project again. This time I'm using 200 Ohm resistors instead of 220 Ohm resistors. This gives me more "space" between ADC readings.
Attached is the latest JPG drawing of the circuit. This drawing includes the measured resistances and measured ADC readings for each key. It is evident there is plenty of "space" between ADC readings for each key. Which is a good thing, because some of the key switches on this cheapo Ebay keypad make lousy connections while pressing and cause widely varying readings. The extra "space" allowed me to use very forgiving values in the conditional routines to determine which key was pressed at the time.

So, it works, even with sloppy switches, and here is the drawing:
KeyPad Using ADC.JPG
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top