Re: 4X4 matrix keypad-74c922- source code
- From: "Chris" <cfoley1064@xxxxxxxxx>
- Date: 22 Mar 2006 06:49:57 -0800
bb wrote:
hi......
im trying to interface a 4x4 matrix keypad using a 74c922 decoder to an
Atmel micrcontroller ...in c- programm.......
i would appreciate some pointers in how to create d source code that will
read from the output of the decoder...according to key pressed...
thxs
bb
Hi, bb. Assuming you're using external caps for the oscillator and the
keybounce mask, all you have to do is set your keycheck loop so it
happens at least twice during the component-selected debounce period.
Check for Data Available. If it's high, read the keypress data, then
set a software flag. Don't read data while the flag is set. Wait for
Data Available to be low again before resetting the flag. Read data
again when flag is reset and Data Available is high.
If you don't need to tri-state the '922 data outputs, that's the
easiest way. If you have bussed the data, clear the bus and then
toggle output enable to read the data as above. It's all in the data
***, available at the Fairchild Semiconductor website.
http://www.fairchildsemi.com/pf/MM/MM74C922.html
If this isn't an exercise in programming, though, the 74C922 is an
expensive way to do this job. If your code is so bound up that you
need a dedicated part to do keypad debounce, it might be better to get
another small uC to do this job at less cost and fewer pins (data can
also be sent from one uC to the other in serial format). You can also
have n-key rollover instead of just 2-key quite easily.
There's no law that says you can't have more than one uC on a board.
Good luck
Chris
.
- Follow-Ups:
- References:
- Prev by Date: Re: Freeware port analyzer
- Next by Date: Re: PCB Sensitivity to UV exposure?
- Previous by thread: 4X4 matrix keypad-74c922- source code
- Next by thread: Re: 4X4 matrix keypad-74c922- source code
- Index(es):