Go Down

Topic: please help with 2.8 Spi display ili9341 (Read 1 time) previous topic - next topic




Yes,  that is how you wire resistors as potential divider.

But 1k0 is far too small.   Use 4k7 on the Arduino side.   And 10k on the GND side.

You also need potential dividers for RST and T_CS.

Are you using a breadboard or soldering on matrix board?

Code: [Select]

Place the 10k and 4k7 resistors on your breadboard with a gap for the display pins:
Place straight links e.g. from oT_DO to oMOSI
-  +   A   B   C   D   E    F  G  H  I  J
GND---10k--o   oT_CS - o--4k7--o  o---------->D3
               oMISO - o--4k7--o  o---------->D12
GND---10k--o   oSCK -- o--4k7--o  o---------->D13
GND---10k--o   oMOSI - o--4k7--o  o---------->D11
GND---10k--o   oDC --- o--4k7--o  o---------->D9
GND---10k--o   oRST -- o--4k7--o  o---------->D8
GND---10k--o   oCS --- o--4k7--o  o---------->D10
GND------------oGND --------------o---------->GND
               oVCC --------------o---------->5V

The display plugs into column C.
Run flying leads to a Uno.
Or plug the Nano into the same breadboard.

Much easier with a 3.3V Arduino.  You just have straight wires to the Zero or Due.

Wiring up the display is the hardest part.

Post a photo of your wiring.

Note that The XPT2046 is on the bus.  So you must add to any existing TFT programs
Code: [Select]

    digitalWrite(3, HIGH);   //de-select XPT2046
    pinMode(3, OUTPUT);



Feb 12, 2018, 08:27 pm Last Edit: Feb 12, 2018, 08:33 pm by ibrahem-H
I don't understand how to wire those just connect them together


Feb 12, 2018, 08:38 pm Last Edit: Feb 12, 2018, 08:40 pm by david_prentice
The XPT2046 and the ILI9341 are both SPI devices.   They go on the same SPI bus.   With different CS (chip select) pins.

You might be able to fit the display onto column D instead of column C
In which case you can run wire jumpers from T_DIN to column C of the MOSI row.
Similarly T_CLK to column C of the SCK row.
T_DO is easy to connect to the MISO row because there is no 10k on that row.



that is my wiring and you said T_Do I don't have that on my display so I thought you meant T_OUT


Feb 13, 2018, 04:17 pm Last Edit: Feb 13, 2018, 04:36 pm by david_prentice
I have two 2.4" boards like your one.  One says T_DO and the other says T_OUT.

Your photo looks wrong to me.  Perhaps this is a better diagram:
Code: [Select]

-   +    A    B    C    D     E  |  F   G   H   I   J
                        oT_IRQ   |
                MISO----oT_OUT   |
                MOSI----oT_DIN   |
                 SCK----oT_CLK   |
o-----10k-----o         oT_CS o---4k7---o   o---------->D3
                   o    oMISO o---4k7---o   o---------->D12
    o--------------o    oLED
o-----10k-----o    o    oSCK  o---4k7---o   o---------->D13
o-----10k-----o    o    oMOSI o---4k7---o   o---------->D11
o-----10k-----o         oDC   o---4k7---o   o---------->D9
o-----10k-----o         oRST  o---4k7---o   o---------->D8
o-----10k-----o         oCS   o---4k7---o   o---------->D10
o------------------o    oGND -o---------o   o---------->GND
    o--------------o    oVCC  o---------o   o---------->5V

The 10k plug between GND (-) column and column B
The 4k7 plug between column E and column G i.e. across the V notch
The link wires from T_OUT, T_DIN, T_CLK, LED can go in column C
The display plugs into column D
Run flying leads to the Uno.

Much easier with a 3.3V Arduino.  You just have straight wires to the Zero or Due.

I suggest that you omit the Touch jumper wires for the moment.
Just get the resistors correct for the TFT screen.

Then you can run regular examples from the Adafruit_ILI9341 library with this constructor:
Code: [Select]

Adafruit_ILI9341 tft(10, 9, 8);

I have run and tested programs on my similar TFT and Touchscreen.
When the TFT is working you can add the jumper wires on column C to enable the TouchScreen.

I am no good with cameras.   Otherwise I could show you photos instead of diagrams.
Mind you,  I can not identify the colour bands on your resistors from the photo.


Edit.   I have improved my diagram.  Shows the columns better.   To show where to insert wire links or resistors.


before I did try the  Adafruit_ILI9341 library example "graphictest" with the wiring that posted before with the 1k resistors and it did work but it doesn't include the touch part wiring


I removed all the wires and reconnect again according to your last post.


With the new wiring the Adafruit_ILI9341 library example "graphictest" don't work.
(Note: it does upload but it doesn't show anything)


those are my arduinos


Only just looked at your PNG.

It seems to be Infiduino R3 which is switchable 3V / 5V

So life is good.   Just switch to 3.3V and everything works beautifully.

I have attached a ZIP with different sketches,  wiring diagram,  flowchart.

I suggest that you use the "button_XPT2046.ino" wiring.   i.e. edit
button_ibrahim.ino: #if 0
button_XPT2046.ino:  #if 1

You will see that I got a 5V version working but it involved a lot of resistors.



Soo I wired my display similar to the upper wiring scheme the one without resistors.

 I tried both "button_XPT2046.ino" and "button_resistive.ino" i didn't try "button_ibrahim.ino"

because I couldn't find  "HCTFT_Touch.h" but both that I tried didn't work.

did they work for you?

and please if you can put a ling for "HCTFT_Touch.h"


Feb 18, 2018, 07:30 am Last Edit: Feb 18, 2018, 08:47 am by david_prentice
Google "HCTFT_Touch" and you should find it on GitHub.
Or go to GitHub and search for it there.

If you can't find it,    I will Zip it up and attach it for you.


Edit.   I found it on GitHub.    Clicked the Green button [Clone or Download].   Downloaded ZIP to my PC.
From your IDE you can install the library e.g.: 
Sketch->Include Library->Add .ZIP Library

As a general rule, you would only use libraries that are "approved" by the IDE Library Manager.
Be careful with unknown ZIP files that you find on the Internet.
Hobby Components provide good support for the products that they sell.   The HCTFT_Touch library works well.


the touch works on all of them but I can't see anything in the display it just a white screen.


Feb 18, 2018, 10:23 am Last Edit: Feb 18, 2018, 11:15 am by david_prentice
I double-checked my wiring with the scheme that I sent you.
I am using a Seeeduino switched to 3.3V GPIO.   Which should be the same as your Infiduino when you set the switch to 3.3V

I suggest that you print the wiring scheme on paper.  Then check each coloured wire and tick them with a pencil.

You can't get a simpler wiring scheme.   There is just one 33R to limit the LED current.   And three links e.g. T_DIN to MOSI.  T_OUT to MISO.  T_CLK to SCK.

You can remove all four T_xxx connections.   Then the Screen will be the only item on the SPI bus.

Note that jumper wires are not very reliable.   Swap with good wires one at a time.
The RST pin must be under program control.   The If the RST jumper wire is broken,  the Screen will just show white.


Edit.   If you add a 10k resistor like this,  the Touch Controller will be inactive by default.
Code: [Select]

-   +    A    B    C    D     E  |  F   G   H   I   J
              oT_OUT      o
              oT_DIN  o   |
              oT_CS   |   |   o---------o   o       o------>D3 blue
              oT_CLK  | o |                 |
              oMISO   | | o   o---------o   |       o------>D12 orng
              oLED    | |     o---33R---o   |       o------>5V  RED   
              oSCK    | o     o---------o   |       o------>D13 blue
              oMOSI   o       o---------o  10k      o------>D11 grn
              oDC             o---------o   |       o------>D9  yell
              oRST            o---------o   |       o------>D8  orng
              oCS             o---------o   |       o------>D10 wht
              oGND            o---------o   |       o------>GND BLACK
              oVCC            o---------o   o       o------>3.3V ORANGE
-   +    A    B    C    D     E  |  F   G   H   I   J

Go Up