bperrybap:
It looks like that display is using a different memory mapping than typical hd44780 displays.
You can work around this by using the setRowOffset(row0, row1, row2, row3) function.
Each argument is the DDRAM memory address of column 0 of each row.
This function exists in the hd44780 library and in newer versions of LiquidCrystal. (around IDE 1.6.0 or newer)
From your tests it appears that the display either uses fully contiguous memory for the rows, or it autowraps to the next row.
A data sheet should show how memory is mapped.
Both hd44780 and LiquidCrystal use this mapping by default:
setRowOffsets(0x00, 0x40, 0x00 + cols, 0x40 + cols)
which for 24x4 display would be:
setRowOffsets(0x00, 0x40, 0x18, 0x58)
If you need to swap rows 1 and 2 then it would be:
setRowOffsets(0x00, 0x18, 0x40, 0x58)
--- bill
Bill,
i use the latest IDE (1.8.5)
I found the memory mapping in the datasheet of the controller that might be on the display.
When i put the values in (00,20,40,60) as per data sheet the 2th and 4th row starts just before half way the display.
I looked a bit further and i can set the controller is a specifc 4 line mode using the function set.
I am new to the programming and can't find how to do this, i see a couple of init's asuming it the display's init where all the bits are set in a sequence.
LiquidCrystal::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)
{
init(0, rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7);
}
I assume that LiquidCrystal::LiquidCrystal is defining a function to be called?
And that init() exucutes that function above?
(i also might be totally off here)
How can i tell what used to set the functionset?
i need to set:
DL=0
N=dont care
RE=0
DH=1
REV=0
As per datasheet they map to
DB0 = REV
DB1 = DH
DB2 = RE
DB3 = N
DB4 = DL
DB5 = 1
DB6 = 0
DB7 = 0
R/w = 0
RS = 0
your first bit (just before rs) is not specified even as enable
how can i tell what line the init contains the function set piece?
-Peter