3.3v ILI9341 TFT LCD 8 Pin - No CS Pin setup with DUE?

Hi,

I bought this TFT display

but im having no luck getting it to work with DUE.

Wiring:

8 Pins on TFT pcb are GND VCC CLK MOSI RES DC BLK MISO
TFT - DUE
GND - GND
VCC - 3.3V
RES - Digital Pin 30
DC - Digital Pin 31

CLK - NOT USED
MOSI - NOT USED
BLK - NOT USED
MISO - NOT USED

Coding
Looking at the ILI9341 library code, i see we can instantiate the TFT without CS pin using this option:

/*!  FROM ILI9341 Adafruit Lib
    @brief  Instantiate Adafruit ILI9341 driver with hardware SPI using the
            default SPI peripheral.
    @param  cs   Chip select pin # (OK to pass -1 if CS tied to GND).
    @param  dc   Data/Command pin # (required).
    @param  rst  Reset pin # (optional, pass -1 if unused).

    Adafruit_ILI9341::Adafruit_ILI9341(int8_t cs, int8_t dc, int8_t rst)
*/

With the DUE and Adafruit ILI9341 library (version 1.5.6) installed, I edited the graphicstest.ino example in attempt to get the TFT working.

#define TFT_CS    -1      // TFT CS  pin is connected to arduino pin 8  (no pin on TFT PCB)
#define TFT_DC    31     // TFT DC  pin is connected to arduino pin 31 
#define TFT_RST   30      // TFT RST pin is connected to arduino pin 30   (named RES on TFT PCB)

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

The sketch compiles, uploads and executes as expected and we see it goes through the motions in the Serial Monitor, but the screen remains white, before during and after sketch execution.

I've attached the full sketch for reference if it helps.

I understand there has been previous threads relating to this screen where others have attempted to it to work with 5v boards, unfortunately ive not been able to use those to help me here. Maybe someone used to the these screens can spot the issue straight away?

Thanks
Alex

graphicstest_edit.ino (10.3 KB)

It is straightforward:

Pin definition:
   Due  Display
1: GND  GND (power ground)
2: 3.3V VCC (power supply is 3.3V)
3: D76  CLK (clock line)
4: D75  MOSI (data entry)
5: D30  RES (reset line)
6: D31  DC (data / command select line)
7: 3.3V BLK (backlight)
8: D74  MISO (data output)

Note that D74, D75, D76 are on the 3x2 SPI header.

In your example sketch, comment out the "read diagnostics" statements.

Everything should work. But I really, really, really dislike SPI devices with missing CS pin.

If the display shows the graphics, you can uncomment the "read diagnostics" statements and try again.
Life is difficult without CS. Those statements might work.
You can probably leave BLK as n.c. or alternatively connect to a GPIO pin (or PWM pin).

David.

Thanks!!,

I actually figured it out wouldn't you believe, and came back here to triumphantly post as such, but you beat me to it. I realized the function call I made to the Adafruit library assumed i had used hardware SPI, but of course i hadn't actually connected those up.

I originally used the RST on the SPI header and set TST_RST = -1, not sure if i could omit RST connection altogether if sketch is set as TST_RST = -1
As you posted it also works using TST_RST = 30, when i connect RES to D30.

I bekieve the read diagnostics do work, here is the Serial Monitor output prioir to commenting out, the values were previously 0xFF when the screen was not working.....

ILI9341 Test!
Display Power Mode: 0x94
MADCTL Mode: 0x48
Pixel Format: 0x5
Image Format: 0x80
Self Diagnostic: 0xC0
Benchmark                Time (microseconds)
Screen fill              1291080
Text                     108915
Lines                    1063859
Horiz/Vert Lines         107818
Rectangles (outline)     70214
Rectangles (filled)      2679991
Circles (filled)         379072
Circles (outline)        464936
Triangles (outline)      235385
Triangles (filled)       926719
Rounded rects (outline)  187585
Rounded rects (filled)   2687367
Done!

When i comment them out i get the following results, im just providing these for completeness....

ILI9341 Test!
Benchmark                Time (microseconds)
Screen fill              1368783
Text                     112407
Lines                    1105817
Horiz/Vert Lines         114216
Rectangles (outline)     74280
Rectangles (filled)      2841395
Circles (filled)         397592
Circles (outline)        482435
Triangles (outline)      244959
Triangles (filled)       979351
Rounded rects (outline)  195677
Rounded rects (filled)   2847934
Done!

I'll throw a link to this thread in the review section on Amazon.

Thanks for taking the time!

Red ILI9341 SPI displays have a CS pin.
They also have 3.3V regulator, SD card and some have Touch Controller.
Some but not all have switchable LED backlight.

Anyway, I am pleased that you have the Blue SPI display working.

David.

This topic was automatically closed after 92 days. New replies are no longer allowed.