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 problems

Hi all,
My software is based on RTX-Full and many tasks and functions call the lcd_print_msg function. Due to that I wrapped each calling with semaphore, but I still receive some bizarre characters on display.
Sometimes LCD display part of string where he suppose and other part in other place.
Sometimes, for no reason, some displayed text is erased.
I add some _nop_() after each LCD enable, but it didn't help.
Any ideas?

Thanks a lot,
Ruven

Parents
  • Okay, in fact of matter LCD display is slow device.

    Information you provided, is not enough to
    problem be recognized. Here are some possible reasons:

    1. Check board schematic and calculate hardware timings. Some fast microcontrollers have MOVX@ timings shorter than it is required for LCD device. In this case you may use stretch control to make WR and RD cycles' times long enough. For example, T89 devices have M0 bit of AUXR for this solution.

    2. Most LCD commands require about 100 mks to be done; there are some ones which require even 4 ms (!). If you use fast enough microcontroller so some NOPs may not help. Really, standard 8051 take 1mks for one NOP at 12Mhz; improved devices may do only 20ns etc.
    To test is it really your problem put alot of NOPs, for example, make loop cycle with 500 ones. If it helps so
    a) make additional routine with NOPs (not good idea if you have many time-sensitive tasks in your project);
    b) create a new routine which sends bytes to LCD and is based on interrupt of a timer with appropriate period. It is best solution I use in my ASM projects.
    Good days!

Reply
  • Okay, in fact of matter LCD display is slow device.

    Information you provided, is not enough to
    problem be recognized. Here are some possible reasons:

    1. Check board schematic and calculate hardware timings. Some fast microcontrollers have MOVX@ timings shorter than it is required for LCD device. In this case you may use stretch control to make WR and RD cycles' times long enough. For example, T89 devices have M0 bit of AUXR for this solution.

    2. Most LCD commands require about 100 mks to be done; there are some ones which require even 4 ms (!). If you use fast enough microcontroller so some NOPs may not help. Really, standard 8051 take 1mks for one NOP at 12Mhz; improved devices may do only 20ns etc.
    To test is it really your problem put alot of NOPs, for example, make loop cycle with 500 ones. If it helps so
    a) make additional routine with NOPs (not good idea if you have many time-sensitive tasks in your project);
    b) create a new routine which sends bytes to LCD and is based on interrupt of a timer with appropriate period. It is best solution I use in my ASM projects.
    Good days!

Children
No data