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

problem with lcd

Hi, I hope someone can help me
I have built an automatic trasnfer switch for genset
it makes all necesary to turn on the motor of the
generator when the mains goes down.
The circuit has a CPU and an LCD 2x16 Truly
the problem is that sometimes the lcd after hours of working ok hangs up and the display becomes black ( the codep still works ok)
I put big capacitors in the power source (4700uF - 7805-4700uF)
but the problem persists

  • i have a problem with a lcd (44780 compatible)
    some times i see a strange text on my 2*16 lcd (when i activate a power contactor)
    when i renitialise my mcu the problem go and it return when i activate a power contactor
    the solution is to reinitialise the lcd without restarting the mcu
    i use bascode 51 ,i know there are "initlcd" but the mcu restart with.
    my hardware connetion is good (rw ,gnd)

    a part of my program:
    $regfile = "m51def.dat"
    $crystal = 4000000
    $stack = 32
    Config Lcdpin = Pin , Db4 = P1.2 , Db5 = P1.3 , Db6 = P1.7 , Db7 = P1.3 , E = P1.8 , Rs = P1.1

    Config Lcd = 16 * 2
    Cursor Off Noblink
    Cls

    ::init_lcd_display_immediete(27);

  • Are all signals of the LCD correctly connected and always driven either high or low? Floating signals can give a lot of problems since they can pick up noise.

  • Another thing: Does you loose contact with the LCD or is it possible to read data from it?

    Embedded systems requires a lot of the development time spent thinking about the hardware, and one important thing when developing software for embedded systems is to make them self-detecting and self-correcting.

    Extra code should be added to verify that the hardware modules are still working as expected. If a problem is found, it is normal to try to reinitialize the hardware.

    It is also common to allow power-cycling of external hardware, to allow the "ultimate reset" of connected equipment without requiring the owner/user to disconnect the power cord.

    It is normally cheaper to use a plastic box than a metal box. But the end user may place their mobile phone directly on the box, or the box may be physically installed against other equipment that are allowed to emit very strong magnetic or electric fields.

    Parts of the certification of systems is that they do not get destroyed by external abuse. Depending on type of equipment, and type of certification, the system may be required to recover as soon as the disturbance is removed. But in some situations, the equipment may have to continue to give full or partial service when disturbed.

  • Hi,

    You don't posted any code, so it is impossible for you I cannot help to you.
    However...
    Seems your initlcd routine doesn't work with your LCD (maybe it doesn't contain an internal reset circuit?).
    I see you have the hd44780.pdf but I strongly recommended to apply a long delay first and after this send three reset commands (0x3) to the lcd.
    I wanted to attached here an example project written by me (it's for my project, it uses also the Busy flag, the source is in assembly but very well commented). The expected lcd inic steps are useful also for you I think. Study it!

    OK, an initlcd eats long time but it runs at begin and only once. If it's not enough, (maybe) your code is wrong elsewhere.
    And again: do not use the init lcd routine under IT!

    Without any code and schematic I cannot help more to you.
    Good luck.
    zuisti