aldinlapinig
Joined: 16 Dec 2005 Posts: 22
|
keypad not working properly after sometime... |
Posted: Sat Feb 11, 2006 8:15 pm |
|
|
hi,
i'm using KBD.C driver of the CCS C compiler to drive a 3x4 keypad. At first, it was working fine. But after some time of editing and adding codes, the keypad doesn't work reliably already. For example, if I press '1' button, it wud sometimes recognize it as '2' or '3'. If I press '*', it will give me a '#' or '0'. What could possibly be wrong?
I see this code in the KBD.C file:
#define KBD_DEBOUNCE_FACTOR 33 // Set this number to apx n/333
// n is the number of times you expect
// to call kbd_getc each second
I suspect that this is the reason why I could not get proper data from the keypad. Can anybody give me idea how to solve for the right value for the debounce factor? I don't have idea on how long will it take for the pic to execute one instruction.(well, i believe that execution time will be dependent on the instruction it has to execute.)
If there are any other causes of the problem, what could that be? (is it a short in the keypad internal connection?)
Thank you very much...
kind regards,
-=alDin=- |
|