Reading data back from lm016l LCD(HD44780)

displaylcdmicrocontroller

How to read data back from a lm016l lcd(HD44780 based)?I couldn't find any useful data on reading except writing.I have followed hd44780 datasheet ,but when i try to display what i read back,the whole display clears off.could anyone help me with the reading procedure?

Best Answer

The datasheet seems fairly clear on this.

First, set the RS line appropriately ie LOW to read the status register, or HIGH to read the data register. If you reading data, the address register must of course be written-to first.

  1. Set the R/W line HIGH.
  2. Wait at least 40ns (\$t_{AS}\$)
  3. Set the enable line E HIGH.
  4. Wait at least 160ns for the data to settle (\$t_{DDR}\$)
  5. Read the data lines.
  6. Set the enable line E LOW
  7. Wait at least 5ns (\$t_{DHR}\$)

enter image description here

I will add the caveat that I have never had a reason to read the character data before. However I've not had a problem reading the status register (RS=LOW).


EDIT ...

In answer to your comment about 4 bit mode, I'm not aware of any problem (although I have not personally used 4 bit mode). I would add that I have always used the initialization procedure on pages 45-46 rather than rely on the automatic initialization working correctly, but I doubt that this is an issue if you can write to the display OK.

Are you sure that the display clears as a direct result of the read operation, or is it possible that a previous write operation has cleared the display, resulting in the read operation returning space characters?