Function setting on SPLC780D LCD
Do you have the bottom 4 bits of the data tied to ground?

You should first reset the LCD by sending the 0x30 command three times. Although the LCD will still be in 8-bit mode the bottom four bits are hardwired to 0 so you don't need to send the separate nibbles.

Now send the 0x20 command, again in 8 bit mode. When this command finishes the LCD will be in 4 bit mode.

To enable 2 rows, send command 0x28. Now you are in 4 bit mode so you need to send two nibbles.

Writing to the LCD through a port expander will require up to eight writes to the port expander for each byte written to the LCD. This is necessary because of the timing sequence required for the various control signals. The sequence I use is:


Set the appropriate value on RS for data or command
Set EN high
Put bottom nibble of data/command on D[7:4]
Bring EN low
Bring EN high
Put top nibble on D[7:4]
Bring EN low
Bring RS low (optional)


Remember that it takes a long time for the LCD to process a command and you must wait for it to finish before starting another command or sending another data byte. The LCD I am using needs many microseconds for some commands so I am using a system tick of 1ms and writing a byte at every tick interrupt. If you don't want to wait you need to observe the BUSY status on D7 instead.