SOLUTION:
I fixed the problem by readjusting my potentiometer to set the contrast voltage to be appropriate for when the LCD was initialized as an 8x2 display.
The ideal potentiometer value for the backlight contrast of an LCD may be different when the display is initialized to have 1 line as opposed to when it is initialized to have 2 lines because the duty cycle of each active pixel is higher when initialized as a 1 line display, which makes complete sense. Read this reply by bperrybap in a different thread for more information.
ORIGINAL POST:
I have done a lot of research to try to get my 16x1 LCD working but I haven't been able to. I am able to print characters on only the first half of the display.
I am aware of the very helpful work that has been done by Donald "Floresta" Weiman in this area. I believe I have read all of the relevant content on their website but sadly I have still not solved this problem.
After looking at countless threads, I'm also aware of the usual answers these posts get which have unfortunately not helped me. I've listed below the proposed solutions that I have already tried:
- "16x1 displays are actually 8x2 internally so you need to configure the LiquidCrystal library as such and move the cursor to the second line to display text on the second half of the display."
- "Check your wiring."
- "Try printing a bunch of characters across the entire RAM range to see if characters show up on the second half."
- "Try the hd44780 library and use their LineWrap example sketch." (result was the same, only displaying on the first half)
None of these proposed solutions have worked for me despite them seeming to work for literally everyone else. I'm thinking my LCD might be an oddball and I should just buy a different one, but I wanted to make a post as a last ditch effort to see if I can still use this one as it fits my project perfectly and I've already bought two of them.
Finally, here are the useful details of the scenario:
LCD details:
Digikey link: Digikey
Datasheet: PDF
Controller type: ST7066U
Controller datasheet: PDF
Module DDRAM map:
Schematic:
Relevant code:
#include "Adafruit_LiquidCrystal.h"
Adafruit_LiquidCrystal LCD(4, 3, 5, 6, 7, 8, 9, 10, 14, 15);
void setup() {
// LCD screen configuration
LCD.begin(16, 1);
for (int i = 0; i < 200; i++) {
LCD.print("e");
}
}
Results of the above code:
Observations I have made:
- I have tried the following code, which is what everyone's first suggestion will be:
Code and result
#include "Adafruit_LiquidCrystal.h"
Adafruit_LiquidCrystal LCD(4, 3, 5, 6, 7, 8, 9, 10, 14, 15);
void setup() {
// LCD screen configuration
LCD.begin(8, 2);
LCD.print("First8ch");
LCD.setCursor(0, 1);
LCD.print("Last8ch.");
}
- When using both Adafruit_LiquidCrystal.h and hd44780.h, configuring the display with more than one line results in a blank display. 16x1 and 8x1 = first half working. 16x2, 8x2 = blank screen.
- I have a "type 1 module" (according to Donald Weiman) meaning it has 1 black circular IC on the back. This means the second half of the display has addresses 40-47, just like the datasheet says. This information seems to all line up but hasn't helped me find a solution unfortunately.
- Using the full constructor and passing in all 8 data pins does not solve the problem. I initially tried just passing 4 data pins so I have tried that as well.
- Adding a delay to the for loop test does not help both when configured as 16x1 and when configured as 8x2.
- I bought two of these displays and have tried swapping in the fresh one with the same results.
This seems to be a tough one but I'm sure there's something I'm overlooking as usual. Thank you in advance for any responses.





