[solved] DIP204-4 with SPI

  1. From the datasheet:

"Before transferring real data, start byte has to be transferred. It is composed of succeeding 5 “High” bits,
read write control bit (R/W), register selection bit (RS), and end bit that indicates the end of start byte.
Whenever succeeding 5 “High” bits are detected by KS0073, it resets the serial transfer counter and prepares
to receive next informations.
The next input data is the register selection bit which determines which register is to be used, and read write
control bit that determines the direction of data. Then end bit is transferred, which must have “Low” value t
show the end of start byte. (Refer to Fig 19, Fig 20)".

It looks to me that you are trying to send the start byte, however you are sending it in reverse order. I think you are also sending the data in reverse order. Try removing all the calls to reverseByte.

  1. On a Uno you should be using pin 10 as SS, not pin 53.

  2. You probably need to include delays after sending some commands, see the datasheet for details.

  3. You may need to send the FunctionSet command before you send DisplayOn. EDIT: You're doing that already, although maybe you need to set 4-bit mode instead of 8-bit mode.

btw I've been through this sort of thing before, writing a driver for a glcd with ST7920 controller in SPI mode. It took me a few attempts and lots of referring to the datasheet to get it working.