I have been playing around with a 3 by 4 keypad
for sometime now. I have written a program that
detects when a key is pushed and then determines
which key is pushed.
I am using a 16C84 because it has EEPROM, which I
would like to use to store a four digit code, each
digit in a different address. I want to use it as a
code lock, but I am note sure how to go about
determining whether the code entered and the one
stored in EEPROM is the same, to allow it to unlock.
I would appreciate any ideas on how to go about this.
Thanks in advance.
voice (w) +27 17 6311299
Hi to all engineers.
speaking of keypad decoding I remembered LM922 keypad decoder chip.
well it works nice but the price is very high 9-10$.
my current project I am working on needed keypad routine I even have 922
but I decided not to use it and write a keypad routine and make it available
for every one to use.
I did it my way it works very good with midrange pic but I will do
some changes to make it work with base line pics later.
I am thinking to add serial routine 9600 baud rate and parallel out like
I think I need bigger pic like pic16c55
8 pins are used to interface keypad. 4x4
4 pins for data output.
1 pin for data available output.
1 pin for serial out
1 jumpers to select serial or parallel
1 jumper to select 4x4 or 3x4
total 16 I/O
what do you think ?
|Andre Abelian wrote:
A thought; If you jumpered the 4th column high (for example) on
startup, you could have that signify a 3x4 keypad, versus pulled low by
a pull-down resistor for 4x4. Recycling that pin gives you one pin free
<G> (Just don't try to then pull that pin LOW later <G>) (I'd remove
the pulldown resistor, too, if I could in the 3x4 case <G>)
Another, you could use the shift register tricks to reduce your needed
pins for keyboard interfacing by at least 2 (it's nice, wish I was the
first to show it here!) - with an 8-pin out shift register, you could
have a "8x2" keypad, and only use 4 pins total for keyboard
interfacing. (Of course, if you have PIC pins to spare, just use them
for direct interfacing, as Shift Register + D + C + R costs and PCB
space do add up, but if it lets you use a smaller cheaper part <G>)
Pull ClkIn low & hold it there to cause !Reset to occur...
| Shift Register
I was thinking of a little multiplexer to have a low number of Input pins
used on your PIC.
This is was I mean:
S4 MULTIPLEXER-----> Bit 0, Bit 1, Bit 2.
I all keys are released, All bits '0'.
S1 pressed: value 1 = 001
S2 pressed: value 2 = 010
S3 pressed: value 3 = 011
S4 pressed: value 4 = 100
S5 pressed: value 5 = 101
S6 pressed: value 1 = 110
S7 pressed: value 1 = 111
You only have to check 3 pins with your PIC in stead of 7.
I am familiar with the 74HCT138 (a DEmultiplexer), can anyone tell me about
a Multiplexer IC?
I think this idea would be very useful.
If it's not, please relpy.
Peter L. Peres
On Thu, 7 Jan 1999, Skybyte wrote:
> I was thinking of a little multiplexer to have a low number of Input pins
> used on your PIC.
> This is was I mean:
For a small number of pins used, try two parallel in/serial out shift
registers, to read 16 keys withtout any kind of scanning, with 3 IO pins,
and enough chording capability to make an octopus envious. There is even
guarantee that all the keys are read in at the exact same time (to within
the serial/parallel signal timing's specs). Sole problem: the keys can't
be in a matrix, and a pull up/down is needed for each (2 8-fold SIPPs for
example). This is 4 parts, and is still probably cheaper than 16 diodes
(depending on who or what does the assembly). Sample part number that can
be used: CMOS 4021 Some of the 3 IO pins can be shared with other systems.
The idea can be expanded as required (i.e. 24 keys = 3 x HC4021, 3 x
SIPP) and non-matrixable switches etc can be interfaced easily too.
hope this helps,
Adriano De Minicis
"Rigby-Jones, Michael" wrote:
> Have a look at http://home.clara.net/mikerj/keypad.html for a possible
> method of interfacing a 3x4 (or 4x4 with modifications) to a PIC using only
> 4 pins.
Nice idea. You could use those SOT-23 (SMD) dual cathode diodes (like BAV70)
to replace each pair of 1N4148s, reducing the external components count
from 6 to 3.
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- New search...