TFT with 9bit SPI (no C/D), can it be used with Arduino?

I now have connected RST to D3, and yes, MOSI is correct, I use the standard pins for Wemos D1 R2.

I have replaced the series resistor I used on the MISO path of 4.7k to 330. This was most likely the problem.

Now I get a more reasonable response:

data sheet specific calls
controller reg(0x04) = 0x000000
controller reg(0x09) = 0x00610000
controller reg(0x0A) = 0x08
controller reg(0x0B) = 0x00
controller reg(0x0C) = 0x06
controller reg(0x0D) = 0x00
controller reg(0x0E) = 0x00
controller reg(0x0F) = 0x00
controller reg(0x2E) = 0x2A2A2A
controller reg(0xA1) = 0xFFFFFFFF
controller reg(0xBF) = 0x00000000
controller reg(0xD3) = 0x40009340
controller reg(0xDA) = 0x00
controller reg(0xDB) = 0x00
controller reg(0xDC) = 0x00

Thank you.

Jean-Marc

Ah-ha. You have an ILI9340. I have never seen one of those.

It is almost identical to the ILI9341. (most of which are actually ILI9341V now)

David.

Your code on Wemos D1 is too fast for my scope with a maximum sampling rate of 48MHz!

But with a SPI speed of ~200kHz (two 1us delays) I get the same values.

Mr. Bodmer may be right that SPI speed of 80MHz gives nearly reliable transfers.

Thank you, this was a pleasure with your help, and I can attack the next step.

Jean-Marc

With the help of the ST7735_readreg_diag I try to find out if my KeDey 3.5 SPI TFTLCD 480*320 is usable on Arduinos, e.g. Wemos D1.

https://www.aliexpress.com/item/Electric-Unit-New-High-end-3-5-LCD-Touch-Screen-Display-Module-Board-320x480-RGB-For/32614671903.html

It has MISO, MOSI, CLK, L_CS, T_CS and IRQ, but no C/D.

So it is most likely 9bit, and the results of readreg_diag seem to confirm this.

But I can't really interpret the result, nor have I any idea for a candidate display library. I will try some anyway.

char interface = NINEBITS | HAS_MISO;

Read registers 9-bit SPI with MISO
data sheet specific calls
controller reg(0x04) = 0xFFC000
controller reg(0x09) = 0xE07C0000
controller reg(0x0A) = 0xE1
controller reg(0x0B) = 0xE0
controller reg(0x0C) = 0xFF
controller reg(0x0D) = 0xF0
controller reg(0x0E) = 0xFF
controller reg(0x0F) = 0xFF
controller reg(0x2E) = 0x000000
controller reg(0xA1) = 0xE07A0000
controller reg(0xBF) = 0x00070707
controller reg(0xD3) = 0x6E040606
controller reg(0xDA) = 0x72
controller reg(0xDB) = 0x6E
controller reg(0xDC) = 0x6F


char interface = NINEBITS | SDA_INPUT;  //ILI9481 SPI

Read registers 9-bit SPI with MISO
data sheet specific calls
controller reg(0x04) = 0xFFFFFF
controller reg(0x09) = 0xFFFFFFFF
controller reg(0x0A) = 0xFF
controller reg(0x0B) = 0xFF
controller reg(0x0C) = 0xFF
controller reg(0x0D) = 0xFF
controller reg(0x0E) = 0xFF
controller reg(0x0F) = 0xFF
controller reg(0x2E) = 0xFFFFFF
controller reg(0xA1) = 0xFFFFFFFF
controller reg(0xBF) = 0xFFFFFFFF
controller reg(0xD3) = 0xFFFFFFFF
controller reg(0xDA) = 0xFF
controller reg(0xDB) = 0xFF
controller reg(0xDC) = 0xFF


char interface = HAS_MISO;  //ILI9341 SPI

Read registers 8-bit SPI with MISO (+ DC)
data sheet specific calls
controller reg(0x04) = 0xFFE000
controller reg(0x09) = 0x407A0000
controller reg(0x0A) = 0x2E
controller reg(0x0B) = 0x2E
controller reg(0x0C) = 0x33
controller reg(0x0D) = 0x30
controller reg(0x0E) = 0x34
controller reg(0x0F) = 0x34
controller reg(0x2E) = 0xF00000
controller reg(0xA1) = 0x007A0000
controller reg(0xBF) = 0x00E00000
controller reg(0xD3) = 0x51000404
controller reg(0xDA) = 0x41
controller reg(0xDB) = 0x00
controller reg(0xDC) = 0x01


char interface = 0;    //regular ST7735, ILI9163

Bi-directional Read registers SDA (+ DC)
data sheet specific calls
controller reg(0x04) = 0xFFFFFF
controller reg(0x09) = 0xFFFFFFFF
controller reg(0x0A) = 0xFF
controller reg(0x0B) = 0xFF
controller reg(0x0C) = 0xFF
controller reg(0x0D) = 0xFF
controller reg(0x0E) = 0xFF
controller reg(0x0F) = 0xFF
controller reg(0x2E) = 0xFFFFFF
controller reg(0xA1) = 0xFFFFFFFF
controller reg(0xBF) = 0xFFFFFFFF
controller reg(0xD3) = 0xFFFFFFFF
controller reg(0xDA) = 0xFF
controller reg(0xDB) = 0xFF
controller reg(0xDC) = 0xFF

PS: with the magnifying glass I see 3 74HC595D and one XPT2046 on the backside.

For some humor with this display, visit:

http://en.bascomavr.3bb.ru/viewtopic.php?id=743&p=5

It looks as if the display is intended for Raspberry Pi.
If it has HC595 chips, it sounds as if it is taking SPI commands and converting to 8080 16-bit parallel to drive the display.

Ask Kedei for the schematic. Make sure that you get the correct "Revision".
Kedei seems to have a "unique" approach to hardware design. And a "witchcraft" approach to software.

It obviously works with the RPi.
I wish you luck when you try to make it work with anything else.
I would guess that it is quite practical with your high speed ESP8266. Not very wise for a Uno.

I do not have an RPi.

David.

Hi David, thank you for the response.

Sometimes the obvious ideas just don't come to me, I have not yet looked for the home page of KeDei.

The version I got is quite new: 6.3 2016/11/1, and the TFT part looks different than on AliExpress.
And the Russians seem not quite sure about the controller, 9325 is mentioned.

I do have a RasPi, and some Orange Pi, but nearly no experience.
And I prefer the direct control the Arduino IDE and its libraries provide.

But I still aim at bigger displays, targeted at Raspberry Pi, to use with Arduinos, and have started a topic for that (no results so far):

https://forum.arduino.cc/index.php?topic=439397.msg3026794#msg3026794

Previous threads about Kedei have shown pcbs with different revision numbers.
I think Kedei comes from China. You just need to get the correct schematic and software to match your hardware revision.

I am fairly certain that the RPi has got 3.3V logic. RPi shields will expect 3.3V logic.
You can create clever Arduino software as much as you like. The Arduino user will always connect 5V logic however much you advise against it.

The whole point of Arduino Shields was to ensure that hardware could be correctly connected.
Likewise, RPi Shields have a different shape for the same reason.

David.

Yes, I will not burn this display. I am preparing a prototype shield with level converter, to use Arduino UNO with any of these displays, because UTFT doesn't compile for ESP2266.

The KeDei 3.5 for Raspi is for 3.3V logic signals, and has a line regulator for the 5V power connector.

But I will use it finally with Wemos D1 mini, which is 3.3V logic, like the Arduino Due.

(I had not even backlight on the Due with the KeDei, connected wrong somehow, even with same pins used?).

Jean-Marc

Warning: do not make the same mistake that I did twice now!

On the 11.09.2016 I bought TFT display for Raspberry Pi, with the intent to try to use it with Arduino later.
It turned out to be nice but rather slow on Raspi, and the download contained only OS images and object files (.ko = kernel object? I assume). It is a KeDei 3.5 version 6.2. It was ~15$.

On the 4.12.2016 I looked for SPI displays and ordered several. Didn't remember KeDei, ordered 2 "half price" KeDei 3.5 for the "bargain price" of ~13$ each.

I don't think now that it ever can be used with Arduinos, unless somebody finds driver source for me.

I don't want to ask KeDei, the information I saw is not promising, and their web presentation can't be told informative.

Maybe I will try later with Waveshare, I already have their 4.3 ePaper display (my next toy).

david_prentice:
It looks as if the display is intended for Raspberry Pi.
If it has HC595 chips, it sounds as if it is taking SPI commands and converting to 8080 16-bit parallel to drive the display.

Ask Kedei for the schematic. Make sure that you get the correct "Revision".
Kedei seems to have a "unique" approach to hardware design. And a "witchcraft" approach to software.

It obviously works with the RPi.
I wish you luck when you try to make it work with anything else.
I would guess that it is quite practical with your high speed ESP8266. Not very wise for a Uno.

I do not have an RPi.

David.

David,

Just for a last chance, may I ask you if you know of any other display with this combination HC595 and 16bit parallel? Which library might be used for such a display?

I noticed that the general SERIAL_4PIN number is the same as for a 8bit display:

#define ILI9325D_8 4
#define SERIAL_4PIN 4

I tried to use UTFT with this, but got nothing on display (nearly black, but with backlight).

Thank you

Jean-Marc

If you find a schematic, or any knowledgeable Wiki on RaspPi, I am sure that you/we can make it work.
I don't have a RaspPi. I don't have a RaspPi display shield.

I am sure that STM32 or MBED users have probably experimented with RPi shields.

Incidentally, my Wemos D1 arrived this afternoon. Pretty impressive when I only ordered it on Boxing Day.
It is the "Wemos D1 (Retired)" in the Arduino IDE.

Is it worth buying the D1 R2 ?

David.

David,

I do not know the retired version, nor the differences. I prefer the Wemos D1 mini, I have just one D1 R2.
It has the advantage of the Arduino connector, but with the 3 duplicated pins. The D1 mini is better suited for breadboard use, and the D1 mini Pro has more flash memory, for use with the spiffs filesystem (no experience yet).

I usually order them from the Wemos shop on AliExpress, and get them in about 2 Weeks.
And there is a cute oled shield for the mini, enough e.g. for a temperature and humidity value show.
For the mini, take at least the V2 version, it has lower deep sleep current.

Jean-Marc

david_prentice:
It looks as if the display is intended for Raspberry Pi.
If it has HC595 chips, it sounds as if it is taking SPI commands and converting to 8080 16-bit parallel to drive the display.

Ask Kedei for the schematic. Make sure that you get the correct "Revision".
Kedei seems to have a "unique" approach to hardware design. And a "witchcraft" approach to software.

It obviously works with the RPi.
I wish you luck when you try to make it work with anything else.
I would guess that it is quite practical with your high speed ESP8266. Not very wise for a Uno.

I do not have an RPi.

David.

The schematics would definitely be helpful. Maybe someone who speaks Chinese or has relations with KeDei could step in.

From information I googled I am quite sure that there is one of the known controllers behind these HC595 chips, I saw mention of ILI9486 and ILI9325.

There is an Arduino library for HC595, so I could try to use readreg through that library as next step. But for now I turn to the Waveshare EPD.

I found helpful information:

For the way such displays are constructed:

For the KeDei 3.5 display:

http://frec.pl/blog/compiling-custom-raspberry-pi-kernel-with-kedei-35/

Jean-Marc

Did you ever try to use the touch overlay as TFT, and the TFT as touch overlay?

The inking on the KeDei seems wrong compared to the Waveshare knock off I just received, L_CS & T_CS exchanged. Needs more investigation, but maybe the readreg values I get can help:

Read registers 9-bit SPI with MISO
data sheet specific calls
controller reg(0x04) = 0x07FF80
controller reg(0x09) = 0x0FF00000
controller reg(0x0A) = 0x07
controller reg(0x0B) = 0x00
controller reg(0x0C) = 0x07
controller reg(0x0D) = 0x07
controller reg(0x0E) = 0x07
controller reg(0x0F) = 0x01
controller reg(0x2E) = 0x000000
controller reg(0xA1) = 0xFFF00000
controller reg(0xBF) = 0x00000000
controller reg(0xD3) = 0x0A00182B
controller reg(0xDA) = 0x00
controller reg(0xDB) = 0x00
controller reg(0xDC) = 0x00

Jean-Marc

There is a discussion on this subject on STM32 forum
It looks as if there are several schemes for SPI to parallel. Most of these seem to use 4040 and 4049.
You could equally use HC595.

It all seems crazy to me. Most controllers have a native SPI interface. You just need to access the IM# pins to select it.

If you use regular SPI, you have a readable interface. The shift register schemes do not look as if they are readable.

As I said earlier, trace your pcb schematic. It will not be difficult.

I have not followed the STM32 thread. But you can.
Likewise, you can probably ask Kedei himself.

David.

The reason may be simple: the copy should be different enough, otherwise you run the risk to get more than just a response about copyright notice inclusion!

Jean-Marc

david_prentice:
There is a discussion on this subject on STM32 forum
It looks as if there are several schemes for SPI to parallel. Most of these seem to use 4040 and 4049.
You could equally use HC595.

It all seems crazy to me. Most controllers have a native SPI interface. You just need to access the IM# pins to select it.

If you use regular SPI, you have a readable interface. The shift register schemes do not look as if they are readable.

As I said earlier, trace your pcb schematic. It will not be difficult.

I have not followed the STM32 thread. But you can.
Likewise, you can probably ask Kedei himself.

David.

There are secrets even Auntie Google can't help to solve; it knows nothing about FPC-X035N14-26A.

Dissecting the KeDei 3.5 inch Raspberry Pi display revealed a connector with this marking.

Dissecting deeper showed the layer for touch control, the tft part, and the backlight part.

The controller seems to be hidden at the connector side of the tft; maybe a lengthy piece of silicon.

There must be a controller with memory, because still images by Raspi show no SPI traffic.

SPI transfers seem to be ~18 bits, which would correspond to the 3 74HC595.
One of the extra bits quite certainly is for RS, but without a reasonable guess of the controller used, there are too many combinations to try.
(I tried some init sequences from UTFT, with no reaction of the display).

Other Raspi displays are more promising, and the Waveshare knock-off works well, thanks to David for the link.

I avoid unpeeling a TFT panel from its sticky tape mounting. I doubt if you find anything very interesting. ---- except for the bare 3.3V module and its flexi ribbons.

The discussion on the STM32 forum seems to be about 2 strategies:

  1. 16-bit SPI fills HC595/HC4094 shift registers. The 16th clock latches the data and strobes it to the TFT 16-bit parallel interface.

  2. 24-bit SPI fills HC595 shift registers. The /WR and DC control signals are contained in the 'extra' 8-bits.

I would guess that the actual TFT controller is ILI9481 or ILI9486 or similar.
You should be able to drive either scheme with AVR or DUE.

Parallel TFTs are more available/cheaper than 8-bit (or 9-bit) SPI TFTs.
Hence the shenagins to drive the displays from a RaspPi SPI.

These schemes are nothing like your 9-bit SPI interface to a regular 9-bit TFT.

David.

Edit. If you manage to identify the flexi-ribbon, look for the IM# signals. If they are accessible, I would select and use the 8-bit SPI interface. Throw away the shift registers.