Electrical – HD44780 LCD – proper addressing for overseas 16×4 line display

character-lcdlcd

I bought a few 16 character by 4 line LCD's from ebay that are HD44780 compatible and today I was testing them.

The LCD advertisement is at: http://www.ebay.ca/itm/LCD-16×4-1604-Character-LCD-Display-Module-LCM-Yellow-Blacklight-5V-Arduino/401053633069

Various sources (including http://www.raviyp.com/embedded/142-16×4-lcd-line-addresses) tell me that:

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

I did use these codes for specifying the beginning of the line. The first two lines of the display are correct but the last two lines are always indented in by 4 spaces (with the last set of characters missing) no matter what I display on the screen.

For example, If I wanted to display "0123456789ABCDEF" on the first or second line, all of it will fit and be displayed. However, if I tried it on the third or fourth line then I would see " 0123456789AB".

Upon examining the LCD module circuit board, the only labels I see are the pin definitions on each side and on the back side, I see a big label "1604A".

I'm tempted to try 0x90 for the 3rd line and 0xD0 for the 4th line, but before I do, is there a way to know regardless of the display I use which addresses represent the start of each line?

Best Answer

I just checked one of my LCD libraries. I have in there "for a 4x16 line display the offset is 16 or 20". So, yes, move your offsets. Use 0x90 and 0xD0.