- Sun Oct 26, 2008 3:13 pm
#57817
I'm in the middle of reformatting my PC (I'm on my laptop at the moment) so I don't have the code to hand but will post it when my PC's up and running again.
It's pretty simple though - check Skylark's code for the basics, but you just need to setup the Arduino to talk to the screen over SPI, wire it up, then send out the initialisation code over SPI and then start sending out screen data. Skylark's code shows all the packets that need sending, with a few notes when doing it for an Arduino:
RESET on the screen should be pulled high
EXTCLK can be pulled low (to use internal oscillator) or I guess supplied an external clock (not tried)
0x04 as a packet in Skylark's code means set the CS line high, while 0x00 means set it low
The basic data scheme is you send the device address with one bit toggled to represent either an index or data, then you send the index address (essentially the register you want to change) and then the data. Both index and data are 16 bit so two one-byte transmissions. You can see how to do the toggling bit from Skylark's code (the device addressed ORd with either index or data).
Data is sent after (iirc) 0x21 as the index, and is the normal 565 RGB form.
Note that nothing at all happens after connecting power - the screen only responds (it goes black) after a correct initialisation sequence.