How to read data from lcd?

Status
Not open for further replies.
Joined
Dec 4, 2012
Messages
4,280
Helped
822
Reputation
1,654
Reaction score
791
Trophy points
1,393
Location
Bangalore, India
Visit site
Activity points
0
I want to know how to read data from LCD? (HD44780).

We have to make RS and RW pins = 1. Then what. Will the LCD data be placed on LAD_DATA port? LCD_DATA port will we output port then how to read data? I need to shift text on particular lines of LCD. I am using 4-bit LCD.
 

I assume you're using an HD44780 based LCD, as I could understand from other posts of yours.

Before reading you must enable the PIC to read data from the LCD data pins, so change the TRIS registers values to 1 for the LCD pins (except for En, RS, and RW). Then set RW to 1 (READ) - the LCD will return some data on the LCD data pins. In case of 4-bit data mode you must make a two pass read. Read the first 4-bits, send a CK to the LCD via the En pin, and then read the remaining 4-bits (data is transferred in high-to-low order, the first 4 bits are the higher 4 bits).

Although, I can only see this useful for reading the busy flag instead of calling a delay routine. It saves you some space on the PIC but, to me, it's not worth the effort made for reading. If you want to read the content written on the LCD I'd suggest you to store a string on the PIC memory, it will take you very less code overhead.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…