key matrix scanning
John Payson email (remove spam text)
> somebody please tell me whether a
> X-Y key matrix is efficient, if i
> am checking for key combinations
> rather than single-key presses.
> i ask because the 16c84 has only 1k
> of code space, and key matrix
> scanning consumes a lot of space.
Matrix scanning doesn't have to use a lot of space; it depends what you're
looking for. If you have, e.g., a full 4x8 matrix and you want to look for
all possible key combinations (and you've put in diodes as needed) your best
bet is probably do do something like this:
Twenty words of code space (plus the delay routine); 4 bytes of registers.
Doing a decent debounce would probably require another 4 bytes; a better
debounce (if you're calling the routine often enough to require one) would
probably take 8 to 16 bytes. Note, btw, that you can replace the "delays"
above with debounce code if desired (which will take a few microseconds to
execute, giving the next keyboard row time to settle).
Is the above approach too register-hungry for you, or are you looking for
In reply to: <9708151818.AA00759@shakti.hal.com> from "Ravindra Divekar" at Aug 15, 97 11:18:47 am
See also: www.piclist.com/techref/index.htm?key=key+matrix+scanning
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the