View previous topic :: View next topic |
Author |
Message |
kmp84
Joined: 02 Feb 2010 Posts: 354
|
flex_keypad driver using #int_rb |
Posted: Wed Sep 12, 2012 3:49 am |
|
|
Hi Friend !
Any driver for flex_keypad 4x3 using port b (RB7-RB4) interrupts instead of timer interrupt scanning? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Wed Sep 12, 2012 4:22 am |
|
|
Realistically, using change interrupts for keyboards, does not work terribly well
Problem is that most keys _will_ give multiple contacts when pushed, normally make, break, make, break, make type patterns. This is why drivers implement debounce, which is always time based.
It would be possible to write a driver, where on the first contact, a time is read, but unless you know for sure that a key is going to produce the same number of make edges every time, you are back to having to read the key again a 'time' later....
Best Wishes |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Wed Sep 12, 2012 5:37 pm |
|
|
I coded an 8x8 mini keyboard encoder several months ago as a subsystem in somebody else's design for a consumer communication device.
I had the luxury of using the full A and B ports on a 16f886 and sending key data via TTL/RS-232 to a host device responsible for the main heavy lift.
To have control of debounce and key repeat latency, its not just a good idea: it is essential to use a system timer for this.
and with that support - the key matrix is simply POLLED by sourcing from one port and doing a bit check on the other. |
|
|
|