Go Down

Topic: Reading from HD44780-based LCDs (Read 4 times) previous topic - next topic


Hey, it's me again, this time with some interesting questions:
I have been working with a Hitachi HD44780-based LCD and as part of my project I am writing an extended library to perform read operations from the screen.

The datasheet for the HD44780 says the following regarding readings:

Read Busy Flag & Address01BF (DB7) Address (DB6-0)
Read data from CG/DD RAM11Data (DB7-0)

Now, the operation in question is trivial to implement when using 8bit mode, as all data channels are available. The question is, when working in 4bit mode, how is the data read then? I can't find any available documentation on this subject. Any help would be appreciated. Thanks


Basically, the same way it's sent into the HD44780, 4 bits at a time.  there will be two operations for every 8 bits, because its passed 4 bits at a time.

Take a look at page 42 of the datasheet http://www.sparkfun.com/datasheets/LCD/HD44780.pdf for more detail on how 4 bit operations work.


The datasheet you linked only says about write operations to the controller, it does not mention read operations.

I tried sending a pulse to the strobe (enable) to get the next bit, but that caused undesired side effects, like text randomly disappearing from the screen, which leads me to believe that approach is wrong.



As you probably know, when you write information to the LCD module in four-bit mode it temporarily stores the first group of four bits that it receives (with the first enable pulse).  After it receives the second group of four bits (with the second enable pulse) it reassembles them into an eight bit byte and deals with the reassembled byte.  

I assume that when you read information from the LCD module in four-bit mode your program would have to do essentially the same thing.  You would send an enable pulse, read the incoming data (the upper four bits of the incoming byte) and stash it away.  You would then generate another enable pulse, and read the incoming data (the lower four bits of the incoming byte).  You then have to do some swapping, masking, ORing etc. to reassemble the byte.



As I said, I already tried the approach of sending a pulse to the strobe [enable pin], to retrieve the second nibble. That did not work. The screen output is corrupted if that is done.

Go Up