This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

lcd & keyboard interface

Hi all,
I am using P89LV51 controller for interfacing LCD and keyboard. The LCD is directly interfaced while keyboard is interfaced through priority encoder. The LCD and keyboard routines are working fine saparately. But when I am getting input from keyboard, converting it to ascii value and trying to display on LCD, the value it displays is incorrect, and it increments the display by 2 or 3 instead of 1. How should I correct this problem?

Parents
  • Debounce is a question of speed. With slow sampling rate (such as doing serial communication), you may have a broken debounce logic but not see it.

    When you call your keyboard read function at a higher frequency, you may start seeing the bounces.

    Add a counter in your code that counts number of key presses. Press a known number of times and then check if the counter stepped the same number of times. If the counter did not step exactly as many times as you pressed, then your debounce is broken.

Reply
  • Debounce is a question of speed. With slow sampling rate (such as doing serial communication), you may have a broken debounce logic but not see it.

    When you call your keyboard read function at a higher frequency, you may start seeing the bounces.

    Add a counter in your code that counts number of key presses. Press a known number of times and then check if the counter stepped the same number of times. If the counter did not step exactly as many times as you pressed, then your debounce is broken.

Children
No data