Interface Busy Flag of LCD or OLED

Graham1359

New Member
I have the OLED device and my own 20x2 driver but have been trying to make the Busy flag work, I have a R/W line on C.4 and tried the following types of cold. The problem it seems to do few byte than freezes in a busy state. I did have a outside loop to exit but very slow timeout. The device is in 4 bit mode, If busy B7 should be set to high when Read mode, R/W=1


dirsB = %00000000 'only b.0 to b.3 to OLED
Port=$FF 'just not zero at start

Low RS 'command mode
High RnW 'read mode
do while Port<>0
High E 'enabled LCD/OLED
pulsOut E,1
Port=Pinb.3 'read LSB b3-b0
Port=Port << 4 'shift nibble to higher nibble
PulsOut E,1
Port=Pinb.3 'read MSB b7-b4
Low E
sertxd(#Port) 'I just see 1 or 16 and some zeros when not in a do loop just run once
loop
Low RnW 'write mode
High RS
Low E

dirsB = %00001111 'only b.0 to b.3 to OLED

I tried different orders of the control lines, it is not clear if the data is available when E is high or when it is pulse low.

Have any one done this or could help, thanks in advance.
Graham
 

hippy

Technical Support
Staff member
According to my LCD datasheet ( not a Rev-Ed one ) the data returned is only present and valid while E is high.
 

Graham1359

New Member
According to my LCD datasheet ( not a Rev-Ed one ) the data returned is only present and valid while E is high.
Thanks for your help I managed to find another PDF on the OLED display.

New code that works on commands and normal characters, reading the PDF again it states that RS must be low and the Busy Flag is on d7 and d6-d0 is the counter position, so is an eight bit byte. I was reading the first nibble and over writing the MSB with the LSB, just wrong, in fact do the handshake on E and just don't bother to read it.

revised code:

OLED_Busy:
dirsB = %00000000 'make inputs
'Symbol Busy = PinB.3 'd7 of OLED
Port=$FF 'not zero

Low RS 'command mode
High RnW 'read
low E 'disable

do
High E 'data available on low to high transition.
Port=Busy 'Busy=Pinb.3=d7 is the busy bit, read MSB Nibble
'port=port << 4
LOW E 'PulseOut too slow

High E 'high is new data
'Port=Port + Busy 'for LSB but overwrite Busy Bit so just don't read
Low E
Loop until Port=0

High RS
Low RnW 'write mode
dirsB = %00001111 'only b.0 to b.3 to OLED as outputs

Return


Measured the RnW pin in my old scope,
20x2 At 64MHz on Winstar OLED

Clear screen is 1160us
Command or zero delay is 311us
if you add sertxd(#Port) this increases to 680us


regards
Graham
 
Last edited:
Top