3
\$\begingroup\$

It often happens that a HD44780 16x2 LCD shows garbled characters during usage. Most help on the web advises for using snubbing techniques to prevent voltage noise such as induction spike. I've done all that but the problem still persists. What can I do ?

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

This problem occurs in 4 bit mode, the LCD screen misses a data nibble (a character is made of two 4bits nibbles) and then all subsequent characters are offset by 4bit. You can check that this is your problem by checking that the garbage displayed is always repeated for a known string that is supposed to be shown, for example "Stop" will always show "7Fπ...".

This can occur for several reasons but the main one in my case was low power on the MCU controlling the display. The MCU can still work on lower voltage but when it sets the "EN" (enable) pin of the LCD to HIGH, if it's below the min value for that LCD (2.2V for example ) then the 4bit nibble wont be recorded when the "EN" is set to low again making the display garbled until this error happens again and the display is restored.

In order to fix this, it's best for the MCU to wait until it's supply voltage returns to a value above the min value of the LCD min input HIGH voltage plus a safety margin. For example on MSP430 energia or arduino before calling lcd.print you'd always call something like this:

setup(){  
   analogReference(INTERNAL2V5);   
}  

void waitVoltage(){  
  while(true){  
    // 3v(what we want)/2.5 (reference) x1024/2=614  
    //we read VSS/2 on port 11, we want more than 2.5v to write on the lcd  
    if(analogRead(0x1011)>613){  
      break;  
    }  
    delay(50);   
  }   
} 
\$\endgroup\$
2
  • 2
    \$\begingroup\$ Or you could use a strong (1k) pullup to the LCD's postive supply and drive the E signal in open-collector mode (to output a low, set it to output+low, to output a high, set it as in input)... that would ensure that an E would be seen as a high by the LCD. Honestly though if this is your problem you might want to address the actual issue instead of trying to band-aid it since it's also likely your data signals will be corrupted as well. \$\endgroup\$
    – akohlsmith
    Feb 10, 2015 at 19:07
  • \$\begingroup\$ I did put capacitors and diodes all over the place to snub the induction noise. But even the lights (mains) in the room flicker when I turn the pump on/off. So band aid seems the best for now. \$\endgroup\$ Feb 15, 2015 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.