About Driving TFT with 3-wire SPI (no D/C pin, 9 bit data)

ngjones
Posts: 2
Joined: Tue Mar 19, 2019 3:22 am

About Driving TFT with 3-wire SPI (no D/C pin, 9 bit data)

Postby ngjones » Fri Apr 12, 2019 2:12 am

Hi,

I am able to drive a TFT display using SPI with 4 wires which are CS, CLK, MOSI, D/C. But recently, I am working on driving another TFT display using SPI with only CS, CLK, MOSI (without D/C pin). The trick is that I need to add once more bit in front of the 8 bits data/command I want to send. And that bit indicates whether the following 8 bits is command or not. Is it possible for esp32 to send 9 bit signal a time. What is the best way to implement it? Is there any limitation to that (i.e. cannot use dma)?

Please comment, thank you.

Thanks,
Jones

ESP_Sprite
Posts: 2651
Joined: Thu Nov 26, 2015 4:08 am

Re: About Driving TFT with 3-wire SPI (no D/C pin, 9 bit data)

Postby ESP_Sprite » Sun Apr 14, 2019 10:59 am

It's no different from other ways to control a SPI device, but you have to keep in mind that you need to pack the 9 bits of the data into the 8 bits you feed into the SPI peripheral. So for instance, a 3x9-bit transaction would have this data: dc 7 6 5 4 3 2 1 | 0 dc 7 6 5 4 3 2 | 1 0 dc 7 6 5 4 3 | 2 1 x x x x (Note that I'm not sure about the word or bit ordering, but you get the idea I hope.)

Who is online

Users browsing this forum: Bing [Bot] and 21 guests