PDA

View Full Version : Read cursors position on LCD?



lab310
- 13th April 2005, 08:44
Is it possible to find current cursor possition on LCD (standard Hitachi controller) ? After reading LCD data sheet , couldnt find any address that holds cursors pos. , but maybe I'm wrong.

Melanie
- 13th April 2005, 09:39
Yes, the operation is called "Read Busy Flag and Address".

You need connection of the R/W line.

Set R/W=1 (usually set 0), set RS=0, Busy Flag is returned in DB7, Address Counter is returned in DB0 thru DB6. There is no equivallent PICBasic instruction. LCDIN sets R/W=1 and RS=1. Close, but no cigar. LCDIn and LCDOut don't check the Busy Flag, they just use blind timing.

I normally have the PIC keep track of the Cursors position - LCD's aren't that big, so how hard is it to lose your Cursor?

lab310
- 13th April 2005, 09:54
Yes , found that info too, but I'm using 4-bit connection to LCD so this won't work. No one mentions if this is possible when using 4bit instead of 8.
I have complex manu map, and could to some things much easier if I knew possition of cursor .

Melanie
- 13th April 2005, 10:03
Well.... you could try connecting the R/W line, assign a 2nd pin to the RS bit, put it and the existing RS pin line thru an AND gate (two Diodes and a Resistor would suffice) to the LCD, drive the new RS bit pin Low (forcing LCD RS Low) and then issue an LCDIN instruction... Do you feel lucky?

NavMicroSystems
- 13th April 2005, 13:20
Well.... you could try connecting the R/W line, assign a 2nd pin to the RS bit, put it and the existing RS pin line thru an AND gate (two Diodes and a Resistor would suffice) to the LCD, drive the new RS bit pin Low (forcing LCD RS Low) and then issue an LCDIN instruction... Do you feel lucky?

Lab,

do you really want to pay this price?

As Melanie already said, it is the PIC controlling the LCD, so how can you loose the cursor position?