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 Reply Children
  • Hi Mr. Per Westermark
    I am already using debounsing from some references on web and when i am reading the keys in controller and sending it through RS232, the hyper terminal is showing correct values without mutiple keys shows only one key for one press, but while the problem with LCD display is i am getting wrong value and sometimes right value with 2 or 3 increment in lcd cursor position.

  • 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.