LCD displaying just 8 characters and 8 blocks per line

Hi, I’m working through the exercises that came with the UNO R3 starter kit and I’m having problems with the LCD display (LCM1602C) when using the “Hello World” sketch.

I can’t seem to get it to display all 16x2 character positions. ( see attached picture )

Things that I’ve tried…

  1. I’ve rewired the breadboard several times.
  2. Wired the breadboard as per the Starter Kit’s instructions and as per an Arduino reference book. ( pin 5 to ground was missing from the reference book) It didn’t seem to make a difference.
  3. Tried an external power supply verses USB power with no difference.
  4. Searched the forum for similar issues.

I’m hoping that it’s just something dumb that I’ve done, but would certainly appreciate any suggestions.

cheers, Brian

Oh well, as the saying goes, post the code! Just as you are using it.

And explain which library you are using.

It is possible that the device is defective, but also possible that some inobvious problem in the code is doing this. Your wiring would seem to be OK - I for one cannot think of how a miswiring could do this since at least part of the display is correct.

Many LCD displays do not have there displays contiguous but have a break in them. Try printing out a long string, up to 64 characters and see if any appear in the second half of the display. If so you have to compensate for that in software.

Hi, Thanks for your review !!
Below is the “Hello World” code that I used. I should note that the LCD screen looks the same if I run this sketch or any other in the LiquidCrystal Examples folder like Autoscroll. The library file I’m using is also from the LiquidCrystal folder (see below).
I also added a delay(1000) before the “lcd.begin”, as I saw on a post that the LCD initialization might need that extra time, but that didn’t make a difference.

Thanks again !! Brian

/*
  LiquidCrystal Library - Hello World
 
 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
 library works with all LCD displays that are compatible with the 
 Hitachi HD44780 driver. There are many of them out there, and you
 can usually tell them by the 16-pin interface.
 
 This sketch prints "Hello World!" to the LCD
 and shows the time.
 
  The circuit:
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 5
 * LCD D5 pin to digital pin 4
 * LCD D6 pin to digital pin 3
 * LCD D7 pin to digital pin 2
 * LCD R/W pin to ground
 * 10K resistor:
 * ends to +5V and ground
 * wiper to LCD VO pin (pin 3)
 
 Library originally added 18 Apr 2008
 by David A. Mellis
 library modified 5 Jul 2009
 by Limor Fried (http://www.ladyada.net)
 example added 9 Jul 2009
 by Tom Igoe
 modified 22 Nov 2010
 by Tom Igoe
 
 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}

The library file used:

#ifndef LiquidCrystal_h
#define LiquidCrystal_h

#include <inttypes.h>
#include "Print.h"

// commands
#define LCD_CLEARDISPLAY 0x01
#define LCD_RETURNHOME 0x02
#define LCD_ENTRYMODESET 0x04
#define LCD_DISPLAYCONTROL 0x08
#define LCD_CURSORSHIFT 0x10
#define LCD_FUNCTIONSET 0x20
#define LCD_SETCGRAMADDR 0x40
#define LCD_SETDDRAMADDR 0x80

// flags for display entry mode
#define LCD_ENTRYRIGHT 0x00
#define LCD_ENTRYLEFT 0x02
#define LCD_ENTRYSHIFTINCREMENT 0x01
#define LCD_ENTRYSHIFTDECREMENT 0x00

// flags for display on/off control
#define LCD_DISPLAYON 0x04
#define LCD_DISPLAYOFF 0x00
#define LCD_CURSORON 0x02
#define LCD_CURSOROFF 0x00
#define LCD_BLINKON 0x01
#define LCD_BLINKOFF 0x00

// flags for display/cursor shift
#define LCD_DISPLAYMOVE 0x08
#define LCD_CURSORMOVE 0x00
#define LCD_MOVERIGHT 0x04
#define LCD_MOVELEFT 0x00

// flags for function set
#define LCD_8BITMODE 0x10
#define LCD_4BITMODE 0x00
#define LCD_2LINE 0x08
#define LCD_1LINE 0x00
#define LCD_5x10DOTS 0x04
#define LCD_5x8DOTS 0x00

class LiquidCrystal : public Print {
public:
  LiquidCrystal(uint8_t rs, uint8_t enable,
		uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
		uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
  LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
		uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
		uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
  LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
		uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);
  LiquidCrystal(uint8_t rs, uint8_t enable,
		uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3);

  void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
	    uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
	    uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
    
  void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);

  void clear();
  void home();

  void noDisplay();
  void display();
  void noBlink();
  void blink();
  void noCursor();
  void cursor();
  void scrollDisplayLeft();
  void scrollDisplayRight();
  void leftToRight();
  void rightToLeft();
  void autoscroll();
  void noAutoscroll();

  void createChar(uint8_t, uint8_t[]);
  void setCursor(uint8_t, uint8_t); 
  virtual size_t write(uint8_t);
  void command(uint8_t);
  
  using Print::write;
private:
  void send(uint8_t, uint8_t);
  void write4bits(uint8_t);
  void write8bits(uint8_t);
  void pulseEnable();

  uint8_t _rs_pin; // LOW: command.  HIGH: character.
  uint8_t _rw_pin; // LOW: write to LCD.  HIGH: read from LCD.
  uint8_t _enable_pin; // activated by a HIGH pulse.
  uint8_t _data_pins[8];

  uint8_t _displayfunction;
  uint8_t _displaycontrol;
  uint8_t _displaymode;

  uint8_t _initialized;

  uint8_t _numlines,_currline;
};

#endif

So did you try changing:-

lcd.print("hello, world!");

to

lcd.print("hello, world! abcdefghijklmnopqrstuvwxyz0123456789ABC");

any change in the display?

  1. Searched the forum for similar issues.

There have been several, you just didn't find them.

There is nothing in your code that would be causing a problem like this and your wiring has to be good otherwise you would not see any characters on the left hand side of the screen.

There are two chips (or epoxy blobs) on the back of your display and the smaller one of the two is responsible for displaying the characters on the right half of the screen. There is a problem with the connections between this chip and the 'glass'.

If you press down on the black metal bezel around the screen you can probably restore the missing characters. In that case you have a mechanical problem which you may or may not be able to fix by twisting the tabs that secure the bezel.

Don

Hi Grumpy Mike,
When I changing the print statement to:

lcd.print("hello, world! abcdefghijklmnopqrstuvwxyz0123456789ABC");

My display shows:
hello, w
1234567

With the first 3 numbers of line 2 changing as per the sketch to reflect the seconds since the last reset.

cheers, Brian

Thanks Don !! When I pushed down on the bezel some of the rectangular blocks turned into vertical lines. So I believe you are correct in saying that I have a hardware issue verses a software problem. I'll take the bezel off to see if I can "re-seat" it more securely.

cheers, Brian