Skip to main content
2 of 4
added 479 characters in body
david
  • 236
  • 1
  • 6

I experienced this while using a STM32f429 discovery board, and I found out there are two reasons that this happens.

  1. when using a fast microcontroller (180 MHz clock), if you send I2C packet consecutive LCD may not be that fast to understand it and as James said in other post LCD may lose some packet and get confused. To cope with that you have to put a delay between your packet.
  2. If you reset your MCU board while your LCD is writing something without cutting off power, LCD may get first nibble but lose the second 4bit nibble and interprets your initialize data as second nibble data to show on LCD and simply get confused. If LCD had something like software reset it could help but I did not find anything in datasheet. Though I think there is a hardware walkaround

 LCD I2C module based PCF8574 Schematic

if you could disconnect K in 8050 transistor and connect LCD Ground to that point then you could disconnect and connect LCD power just by toggle P3 pin through PCF8574 IC when you are initializing your LCD.actually you will lose some control over LCD backlight. you can consider R/W pin too because almost all firmware just write on LCD and simply lower this pin.

Sorry for bad English

david
  • 236
  • 1
  • 6