20 x 4 LCD

Status
Not open for further replies.

pixman

Member
Hi
Can Someone please help me with the line address for a 20 x 4 LDC
On a 16 x 2 LDC you would use:
lcd_line1 movlw 0x80
call LCD cmd

lcd_line2 movlw 0xc0
call LCD cmd
as in Nigel's tutorial.

Using this does not work on this display.
 
As I understand it the line addresses start with:

00h, 40h, 14h, 54h

The third line continues after the first line, and the 4th line after the 2nd, weird innit.
 
I found the correct address after a long search on the net.
dr pepper is correct, the 3rd line continues from 1st line and 4th continues from the 2nd.
The start address is as follows:
Line 1: 0x80
Line 2: 0xc0
line 3: 0x94
Line 4: 0xD4

Tried it on a 20 x 4 last night and works.
 
Super.

Allthough the actual addresses you put are different.

There are some silly single line displays where the first half of the line starts at 0x00 and the second half 0x40.
 
In case there's any confusion, the addresses are 00h, 40h, 14h, 54h, however, commands have the top bit set and so the commands are 80h, c0h, 94h, d4h. So both values are correct.

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…