Go Down

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

ibrahem-H


david_prentice

@Ibrahem,

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
              
               oT_IRQ
       MISO----oT_DO
       MOSI----oT_DIN
        SCK----oT_CLK
GND---10k--o   oT_CS - o--4k7--o  o---------->D3
               oMISO - o--4k7--o  o---------->D12
        VCC----oLED
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);


David.

ibrahem-H

#17
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
    oT_IRQ
       MISO----oT_DO
       MOSI----oT_DIN
        SCK----oT_CLK
?

david_prentice

#18
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.

David.

ibrahem-H

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

david_prentice

#20
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.

David.

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

ibrahem-H

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

ibrahem-H

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

ibrahem-H

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

ibrahem-H

those are my arduinos

david_prentice

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.

David.

Go Up