2
votes

I am having a hard time finding succinct tutorials regrading the initialization of an LCD controller. I have read in the datasheet there is a specific sequence of bits that should be sent to the LCD. Such a initialization sequence is presented here:

enter image description here

I simply cannot follow the information presented here. I can see that the first few steps require the user to power the device, wait a sufficient amount of time, and then set the state of a few data lines. I can understand through the following:

Assuming we use the byte format as follows: D7 D6 D5 D4 RS RW X X

  • Power on
  • wait >40mS
  • Write 0011 0000 => 0x30
  • wait >4.1mS
  • write 0011 0000 => 0x30
  • wait >100uS
  • write 0011 0000 => 0x30

After which I have no idea. I have scoured the datasheet and have found little explaining the references to N, I/D, D, B, F, C shown below (some not shown). Further, any tutorial I have read often references a mysterious "Function Set" (i.e. below with Function set: interface is 8 bits long ?) that am unsure about.

The actual LCD model that I have is: WH2004A-CFH-JT# But from what I have read, most LCDs are derivatives of the HD44780

As such, my first attempt at initializing this display was going to be realizing the sequence given in the datasheet for that display.

Are there any good resources that would be recommended? Can anyone explain what the "Function Set is and the associated variables B, C, F, I/D .. etc?

Further, is it that once in 4-bit mode that information is sent to the LCD simply by first presenting the 4-bit nibble of the highest data bits (7, 6, 5, 4), clocking in that data, and then repeating with the lower-bit nibble?

1
I took me about 2 seconds, and Google, to find 'Sets interface data length (DL), number of display line (N), and character font (F)', 'Reads busy flag (BF) indicating internal operation being performed and reads CGRAM or DDRAM address counter contents (depending on previous instruction).', 'Sets on/off of all display (D), cursor on/off (C), and blink of cursor position character (B).'. It's all there in the docs. I know it's confusing, ('cos hardware interfacing often is), but all the data on such common devices is out there. - Martin James
@MartinJames Great detective work! You solved the crime! ;-) - Fiddling Bits
Are you aware of whether or not the last table is 9 separate data write events? Or are there only 5? They are grouped together but no mention is made of this. - sherrellbc
They are separate write events. The 0 in the first line in DB5 indicates that the next input is the second line of the instruction. - uncleO

1 Answers

1
votes
B ->  The character at the the cursor position blinks when B = 1
Blinking is performed by switching between all blank dots and the display character

C ->  The cursor is displayed when C = 1 and is not displayed when C = 0.
The cursor is displayed as 5 dots in the 8th line when the 5 x 7 dot character font is selected and as 5 dots in the 11th line when the 5 x 10 dot character font is selected. 

    enter code here

D ->  The display is ON when D = 1 and OFF when D = 0. The DD RAM contents remain unchanged.    

Function set specifies of 
    1. DL -> number data length (4 bit or 8 bit) 
        Data sent or received in 8 bit lengths (DB7-DB0) when DL = 1
        Data sent or received in 4 bit lengths (DB7-DB4) when DL = 0 
    2.N -> Sets number of display lines.
    3.f -> Sets character font.

After setting function set , set CGRAM Address and DDRAM Address (Refer Data Sheet)

that check BF flag read and write operation is performed.

This might be help you in bit...