I'm trying to code the 4-bit initialization process this LCD (page 25) and I'm seeing two rows of bits, with the second containing letters I have not seen before (N, F, D, C, B, I/D, and S). What do I do with these? What do they mean? And do I need to provide a delay in between the rows, in addition to the explicitly stated delays? Thanks.
-
\$\begingroup\$ All things covered in the datasheet! \$\endgroup\$– StainlessSteelRatCommented Oct 18, 2021 at 23:23
-
\$\begingroup\$ I downvoted your question because the answer is easily found in the datasheet \$\endgroup\$– jsotolaCommented Oct 19, 2021 at 4:36
-
\$\begingroup\$ the question asking about the delay between rows should be asked separately \$\endgroup\$– jsotolaCommented Oct 19, 2021 at 4:38
3 Answers
A few pages above, you can find the definitions for each individual bit of each register that you're modifying here; here's one example:
This section starts on page 18.
'X' means does not care, so you can put an 1 or 0. Usually this can be found when you have a smaller data to send compared to word size. For example in I2C you can only send 8b, so if you need to send 12b you can do it sending 8b and later 4b (or 4b and later 8b, depending on LSB).
Check pages 27/28 to see how you need to send the 4b data and timing.
As diagram says: get ready 4b, set EN to 1, set EN to 0, put another 4b etc...
-
\$\begingroup\$ OP said "not X's" in the question and your answer only covers 'X's. Downvoting until corrected, I'm afraid. Hearth's earlier answer already answered the question fully, anyway. \$\endgroup\$– TonyMCommented Oct 18, 2021 at 23:07
-
1\$\begingroup\$ ok, my answer is covering the second part: "do I need to provide delaybetween the rows?", and the answer is no. BTW Hearth dont say nothing about timing as I did \$\endgroup\$ Commented Oct 18, 2021 at 23:19
-
\$\begingroup\$ He said: " I'm trying to code the 4-bit initialization process this LCD (page 25) and I'm seeing two rows of bits, with the second containing letters I have not seen before " So I replied thinking about 'X'. AFTER EDIT, he adds: "(...) I have not seen before (N, F, D, C, B, I/D, and S)." So my question replies to first unespecified question. \$\endgroup\$ Commented Oct 18, 2021 at 23:40
-
\$\begingroup\$ SO hang on, pg 25 seems to say that I need to wait >37us between each 4+4 (8 total) bit inputs, but is ambiguous about whether I should do anything with the "E" input or how long the delays between each set of 4 bits should be. On the other hand, 27 says I need to Delay > 80us between 8 bits in total, but specifies that I should use "E" to signal each set of 4 bits? SO: 1. Do I use "E?" 2. Should the larger delay btwn each 8 bits be 80 or 37us? \$\endgroup\$– jcuCommented Oct 19, 2021 at 0:07
-
2\$\begingroup\$ The datasheet tells you all you need to know about E. It tells you about the setup time for the control and data to E going high. The min time for E to be high. The hold time for control and data and E low minimum time. Off the top of my head it us around 500ns min for E high or low. That’s a min period of 1us. All this has been done to death on the web - it really hasn’t changed since the hd44780 came out in the 80’s. \$\endgroup\$– KartmanCommented Oct 19, 2021 at 4:40
The letters are the instruction and control bits how to set up the LCD explained on datasheet page 17.
Yes you need to make sure the LCD bus timings requirements are not violated, including set-up and hold times for RS, RW, and data, and the maximum frequency of E. Depending on how you are using the LCD, delays might be required so that a MCU running at 100 MHz can work with the LCD bus that is slower than 1 MHz.