This post is about the line addresses for the 16x4/20x4 LCD display with 4 lines. Just for your information i would like to tell you that there is no any difference in interfacing the 16x2 LCD and the 16x4 LCD display in terms of hardware pin connections.
What i mean is, given the same circuit which was built for a 16x2 LCD display can be used with a 16x4 LCD display with no hardware changes needed at all. Even the program/code written for the 16x2 display works fine with the 16x4 LCD display except that you will only be able to display on the first two lines only. There are separate commands for setting the cursor to the required line in these displays. These commands set the line address and place the cursor at the appropriate line. Here i have listed down the line addresses for the 16x4/20x4 LCD display,
For displaying the characters on the 1st line send the command 0x80
For displaying the characters on the 2nd line send the command 0xC0
For displaying the characters on the 3rd line send the command 0x94
For displaying the characters on the 4th line send the command 0xD4
WriteLCDCommand( 0x80 ); // Sets cursor to line 1 of display
WriteLCDCommand( 0xC0 ); // Sets cursor to line 2 of display
WriteLCDCommand( 0x94 ); // Sets cursor to line 3 of display
WriteLCDCommand( 0xD4 ); // Sets cursor to line 4 of display
- 16x1 LCD displaying only first 8 characters - Reason
- Best discussion forums for Embedded systems
- 8051 microcontroller not able to drive ULN2003/ULN2803 motor driver?
- Where to buy electronics components in India?
- 16x2/16x4 LCD Display not working - Possible Reasons