Connect an SPI TFT with Touchscreen to your Arduino - ILI9341 LCD with XPT2046 Touch screen

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2020
  • You can get buy some really cheap LCD and touchscreen modules from places like eBay. They're actually great devices that let you add a display to your Arduino and microcontroller projects for under £10. But they don't come with any documentation so they can be a bit tricky to get working if you've never used them before.
    In this video I'll walk you through the connections and software needed to get them working. My screen is a generic, red, Chinese sourced device using the very common combination of an ILI9341 based LCD module with a touchscreen driven by the XPT2046 touch controller.
    You can easily get hold of one of these touchscreens at Amazon or eBay.
    Amazon: amzn.to/39ZyWMD
    eBay : ebay.us/sOCSyI
    Make sure you visit the project pages on my website for circuit diagrams and breadboard layouts, along with more information and details.
    bytesnbits.co.uk/spi-lcd-setu...
    ILI9341 Library
    github.com/adafruit/Adafruit_...
    XPT2046 Library
    github.com/PaulStoffregen/XPT...
    Adafruit GFX Library
    github.com/adafruit/Adafruit-...
    Adafruit LCD tutorial
    learn.adafruit.com/adafruit-2...
    Adafruit GFX Library Tutorial
    learn.adafruit.com/adafruit-g...

ความคิดเห็น • 332

  • @mellee3436
    @mellee3436 ปีที่แล้ว +3

    Thanks very much for this. After literally thousands of experiments/hours (over a year or so) with Arduino Uno and ILI9341 I finally got it working, thanks to this excellent video. The voltage dividers were my problem. I used 4.7K and 10K resistors in my setup. Thanks again.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Great to hear you've got your project working.

    • @mellee3436
      @mellee3436 ปีที่แล้ว

      @@BytesNBits I'm using the ILI9341 FAST driver for experiments now..

  • @gammacount1328
    @gammacount1328 ปีที่แล้ว

    Great job! Very clear and comprehensive explanations. Thank you.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Glad it was helpful!

  • @rondivecchia4561
    @rondivecchia4561 หลายเดือนก่อน

    Very informative! Thank you for taking the time to put this together. It is much appreciated.

    • @BytesNBits
      @BytesNBits  หลายเดือนก่อน

      Glad it was helpful!

  • @Harry-Powney
    @Harry-Powney 3 ปีที่แล้ว

    Thank you for your efforts, this has helped me enormously. I look forward to your future videos

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Glad it was helpful!

  • @dankclee
    @dankclee ปีที่แล้ว +1

    Thank you for publishing this video!!

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Glad it was helpful!

  • @stijndepuysseleir2499
    @stijndepuysseleir2499 ปีที่แล้ว

    Thanks for pointing out the HIGH values for the CS pin. From white to working...

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Glad it was helpful!

  • @DavidTLutz
    @DavidTLutz ปีที่แล้ว +8

    Thanks for a GREAT tutorial! I spent 2 several hour periods trying to figure out why I could never get anything but a white screen. I checked all connections several times. I finally fired up the oscilloscope and found that I only had 1.1V on the clock signal. Checking my voltage divider I discovered that a 10K resistor had snuck into my 2.2K resistors. That one got used for the clock signal. Once replaced everything worked fine. Lesson: once you run out of big options as the problem, try the little ones - maybe try them first. 🙂

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +1

      Hi. That's a really awkward 'bug' to have to find. Glad it all worked in the end.

  • @mahlodibogashu5211
    @mahlodibogashu5211 2 ปีที่แล้ว

    Thank I just got the exact lcd and i will be following up thanks for your effort sir.

  • @danielfromca
    @danielfromca 2 ปีที่แล้ว +2

    Thanks so much for this really great & well explained tutorial. Definitely helped me understand better how to connect the display to an Arduino & how they work together.

  • @drlerkan
    @drlerkan 2 ปีที่แล้ว

    You really explained it very well. I found answers to many questions. thanks.
    I subscribed for your other important information :)

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +1

      Thanks for the sub! I hope you find my other videos useful.

  • @BartdeBoisblanc
    @BartdeBoisblanc ปีที่แล้ว

    This and your video on how to modify the Adafruit and Touchscreen sketches are great quite helpful. By the way I think that game is called breakout. Pong usually has two players with paddles.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. You're absolutely right. Just me talking off the top of my head!

  • @robconnelly202
    @robconnelly202 2 ปีที่แล้ว

    Super helpful and very clear. You just saved me boatloads of time.

  • @atihrot755
    @atihrot755 ปีที่แล้ว

    Thank you for your advice. I wish you a nice rest of the bottom. This screen gave me a hard time. I like watching your works, I'm always learning something. Keep up the good work and good luck. Could you post some codes for the clock or the weather station. Or some games. Thank you.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Glad you're enjoying the channel. Lots of projects to come. Just trying to find time to make them!

  • @johnvine5731
    @johnvine5731 2 ปีที่แล้ว

    Another thumbs up here. That was a great help. Thanks very much for your kind efforts.

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +1

      Glad it helped

  • @makermatrix9815
    @makermatrix9815 3 ปีที่แล้ว +7

    I learned that you don't need to burn another pin on the Uno to get the TFT Reset function working on these screens. It can piggyback off the Uno's Reset pin, which is otherwise useless unless you plan to get into HVSP tools to recover the chip afterwards. The bit of magic that allows this is to tell the library to use a negative number for TFT_RST. This activates a software TFT Reset function, removing the need for a separate digital pin from the MCU. This only appears to be documented in the library code itself. I've also seen it documented that you can hook TFT Reset to a pullup, but I was not able to make that work. Piggybacking on the Uno RST pin is working great on three different screens I've got here, though.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +2

      Hi. Thanks for the tip. I'll try that out. Always good to save a pin for later :)

  • @makermatrix9815
    @makermatrix9815 3 ปีที่แล้ว

    Fantastic. Glad I found your channel.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Thanks. I hope you find it useful.

  • @MOHJH59
    @MOHJH59 2 ปีที่แล้ว

    So detailed needed instruction...thank you so much...

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      Glad it was helpful!

  • @BilalAhmad-dd3eu
    @BilalAhmad-dd3eu ปีที่แล้ว

    Greatly explained.
    Thank you.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Glad it was helpful!

  • @trombonista92
    @trombonista92 ปีที่แล้ว

    very high production quality ,

  • @56NeilWatson
    @56NeilWatson 2 ปีที่แล้ว

    Thanks (name?) for this tutorial. I have need of a touch screen for another project someone has done which I'm copying. I thought I'd have a play first to get familiar with it first and have learnt a few things. I went down the road of using a TXSO108E level shifter board which works really well.

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      Hi. The level shifters are much better than the resistor dividers.

  • @activ8me3
    @activ8me3 2 ปีที่แล้ว

    I really like your style. You are not a snob maker - like most. Wow.

    • @activ8me3
      @activ8me3 2 ปีที่แล้ว

      ... and I liked your reference to adafruit. The tiny Ai corp that my daughter and are startuping is going north too.

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      Hi Armin. Thanks. I try to keep it real. Good luck with the new venture.

  • @tothlaszlo8008
    @tothlaszlo8008 หลายเดือนก่อน

    Thank you the video! Its verry big help to understanding! 👍

    • @BytesNBits
      @BytesNBits  หลายเดือนก่อน

      You are welcome!

  • @PavolFilek
    @PavolFilek ปีที่แล้ว

    Beautiful explanation.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Thanks. Hope it helped.

  • @jimdesposito9433
    @jimdesposito9433 9 หลายเดือนก่อน

    Great tutorial, thank you! BTW, you can use an Arduino Nano, or probably any other Arduino board, as long as you select the right one in the 'boards' drop-down.

    • @BytesNBits
      @BytesNBits  9 หลายเดือนก่อน

      Thanks for the info!

  • @tiagosilva2196
    @tiagosilva2196 3 ปีที่แล้ว

    Great Video!! A real lifesaver!! Thanks so much!!

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      You're welcome!

  • @coby1kenobii
    @coby1kenobii 3 ปีที่แล้ว

    Great video, thanks!

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hope you found it useful!

  • @epicdaniel508
    @epicdaniel508 8 หลายเดือนก่อน

    Great video!

    • @BytesNBits
      @BytesNBits  8 หลายเดือนก่อน +1

      Glad you enjoyed it

  • @michaeldutsonlandscapephot2184
    @michaeldutsonlandscapephot2184 2 ปีที่แล้ว +2

    Excellent video Bob,. Probably about the clearest and most understandable ones on TH-cam; very nicely done. Thanks for taking the time to post this. I've now placed an order for a similar 4" screen which I will be using as the settings and data readout interface on a replacement range cooker controller I'm building. A bit of a learning curve, but such is life.
    I understand that bitmap images can be installed on the SD card and then uploaded on screen - did you try this at all?? I was hoping to use a bitmap image created in Photoshop and then use the touchscreen co-ordinates to see when a particular 'button' is pressed. Not sure how data readout would work with a bitmap image background though.

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +1

      Hi Michael. Thanks for the comments. Sounds like a great project!
      I did make a few videos in the series on the touch panel and SD card. Have a look at these...
      SD card - th-cam.com/video/FI7yXDi-fKA/w-d-xo.html
      Simple SD card images - th-cam.com/video/aVCWLk10sAw/w-d-xo.html
      Writing your own image handler - th-cam.com/video/exjzGMX4fqs/w-d-xo.html
      Have fun!

    • @michaeldutsonlandscapephot2184
      @michaeldutsonlandscapephot2184 2 ปีที่แล้ว

      @@BytesNBits Cheers Bob. It's a dark evenings project for me. I'm struggling to get parts for the range cooker in the kitchen, and those I can get are priced at well over 200 quid to overhaul the full control system. It's a no brainer to do it using modern components which offer far more accuracy and options. Your videos certainly help in making the new controller have the Wife Acceptance Factor. 👍🏻

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +1

      @@michaeldutsonlandscapephot2184 Great. I like the 'Wife Acceptance Factor' idea. That sounds like a hard target to reach.

    • @michaeldutsonlandscapephot2184
      @michaeldutsonlandscapephot2184 2 ปีที่แล้ว +1

      @@BytesNBits WAF is generally an unachievable goal! 🙄

  • @srideepaindu818
    @srideepaindu818 5 หลายเดือนก่อน

    Worked like a Charm :D... Thanks

    • @BytesNBits
      @BytesNBits  5 หลายเดือนก่อน

      Glad it helped

  • @maruanuar
    @maruanuar 3 ปีที่แล้ว

    Hey great video ! Was wondering if you could share the software you used to draw the circuits at minute 9:56 ?

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi. I used Fritzing (fritzing.org/) for this project.

  • @Gouzation
    @Gouzation 2 ปีที่แล้ว

    Hi, Great video i was just wondering if this is the same screen that you used in your retropie GPIO gamepad video?

  • @williampowell7518
    @williampowell7518 2 ปีที่แล้ว +1

    Great tutorial. I am a novice with mcirocontrollers but I am trying to use the SD card slot but unsure of the physical connections to use. for the sd card slot there is a sd_cs,sd_mosi,sd_miso & sd_sck

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +1

      Hi. The mosi, miso and sck connections are the SPI bus so you just run the same connections as you're using on the LCD side. The cs (chip select) needs to run back to a separate output pin on the Arduino to allow it to select what device it wants to talk to on the SPI interface.

    • @mellee3436
      @mellee3436 7 หลายเดือนก่อน

      Most software wants SD_CS to be pin 5 on esp32.

  • @nucleoy6000
    @nucleoy6000 2 หลายเดือนก่อน

    Hello! nice video! I was wondering why don't you use the 3.3V output from the arduino board itself to power the screen instead of using the 5V output and doing the voltage conversion bridge? thx!

    • @BytesNBits
      @BytesNBits  2 หลายเดือนก่อน

      Even if you use the 3.3V output for power the IO pins run at 5V.

  • @sudheerillipilli4691
    @sudheerillipilli4691 2 ปีที่แล้ว

    Sir, hardware spi settings are enough for speeding of screen or any other things need ? Nice explanation.

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      There are a number of ways of speeding up the screen but most need a more powerful microcontroller board. I've done some tutorials for the Raspberry Pi which will give you some ideas.

  • @TomasCarrascoFerrarezi
    @TomasCarrascoFerrarezi ปีที่แล้ว

    Awesome tutorial, just a question, is this library compatible with the ILI9486 chip? i'm looking for a bigger screen and they all seem to run on this chip

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      No. The Adafruit driver only supports a small range of chips - have a look in the source code notes at the top of the listing. You'll need to find a suitable driver. Have a look at this project - www.engineersgarage.com/arduino-ili9486-driver-3-5-inch-tft-lcd-touch-screen/.
      The drivers are often compatible with the Adafruit GFX library so most of the code will be the same as in the tutorial.

  • @nielspaulin2647
    @nielspaulin2647 ปีที่แล้ว

    EXCELLENT

  • @mbanc443
    @mbanc443 2 หลายเดือนก่อน

    Hello, and thank you very much for a valuable info on those type of ILI9341 with UNO but I'm using Mega2560 and it still doesn't work w/ it. Any idea why? Thx in advance! Great job here!

    • @BytesNBits
      @BytesNBits  2 หลายเดือนก่อน

      Make sure you check what pins you're using for the connections. You'll need to use one of the SPI channels and then a few general IO pins on the Mega2560 and then adjust the code to match with what you've used. The driver code should be compatible.
      I hope you get it going.

  • @RealDevastatia
    @RealDevastatia 9 หลายเดือนก่อน

    You have neat handwriting. :D

    • @BytesNBits
      @BytesNBits  9 หลายเดือนก่อน

      Thank you! 😊

  • @djix030
    @djix030 5 หลายเดือนก่อน

    Hi, I have this screen connected to an ESP32-S3 with the 3.3V it works perfectly! , why do you use the 5V with this army of resistor ??

    • @BytesNBits
      @BytesNBits  5 หลายเดือนก่อน

      With the ESP32 you can remove the resistors. The video is based on the Arduino which runs at 5V.

  • @alnoorratansi9364
    @alnoorratansi9364 2 ปีที่แล้ว

    Hi Great Video, What does the voltage jumper do at the back of the screen ??

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      I have no idea! I can't see it mentioned in any of the documentation. There are some schematics you can download for the screen but I haven't got the software to open them.

    • @alnoorratansi9364
      @alnoorratansi9364 2 ปีที่แล้ว

      @@BytesNBits I found out , If it is lest open then it is set for 5v , if shorted it is set 3.3v

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      @@alnoorratansi9364 That's great thanks. I'll make a note of that one!

  • @viktorhugo8252
    @viktorhugo8252 ปีที่แล้ว

    @ 8:35, If there is no voltage regulator on the TFT you have to use 3,3Voltage for VCC and LED

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Thanks for spotting that.

  • @Benqo
    @Benqo 3 ปีที่แล้ว

    Hi, I have found some tutorials with just 10k resistors between the screen and Adruino´s pins instead of the voltage dividers. Which alternative is better?

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi. It's sort of a personal choice, both will work. The best solution is actually to use logic level converters. They are also a neater package to connect up!

  • @salustianomoreno1394
    @salustianomoreno1394 3 ปีที่แล้ว

    Hello, thank you very much for your work, it has helped me to configure the TFT, I have not found anything better anywhere else, excellent work.
    I have to connect two TFTs to control them from my arduino MEGA, my presumption is if I have to add another group of redistances or is it possible to share the common terminals, with the resistors that I use for the first display?
    Thank you very much from Spain

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi. The data signals like MISO, MOSI and CLK can be simply connected to your second display. You'll just need to assign a new chip select pin. I haven't tried it, but I expect in the software you'll be able to create a second TFT object and initialise it with the same data pins but new CS pin. You'll then have one TFT object talking to one display and the other talking to the other display. Let me know how you get on.

    • @musaenoch2277
      @musaenoch2277 2 ปีที่แล้ว

      I dont mean to be off topic but does any of you know a tool to get back into an instagram account??
      I was stupid forgot my login password. I appreciate any help you can offer me

    • @everettjoseph6400
      @everettjoseph6400 2 ปีที่แล้ว

      @Musa Enoch instablaster =)

    • @musaenoch2277
      @musaenoch2277 2 ปีที่แล้ว

      @Everett Joseph i really appreciate your reply. I found the site thru google and Im waiting for the hacking stuff now.
      I see it takes quite some time so I will reply here later when my account password hopefully is recovered.

    • @musaenoch2277
      @musaenoch2277 2 ปีที่แล้ว

      @Everett Joseph It did the trick and I actually got access to my account again. I am so happy!
      Thanks so much, you really help me out!

  • @MrBobWareham
    @MrBobWareham 6 หลายเดือนก่อน

    Loved the video it was very interesting, but why did you use Arduino and not use esp32 as it has so much more power to drive the screen?

    • @BytesNBits
      @BytesNBits  6 หลายเดือนก่อน

      Thanks. The video is really more to show people how to connect up and use an SPI screen. The Arduino is the more common beginner board. Yes, in a real project you'd probably opt for the ESP32 or RP2040.

    • @MrBobWareham
      @MrBobWareham 6 หลายเดือนก่อน

      Thanks for the reply, love the channel and your presentation.Bob@@BytesNBits

  • @GetRealwithMike
    @GetRealwithMike 7 หลายเดือนก่อน

    Great tutorial. I want to make video screens for my model spacecraft. It would show a video clip of the different systems on board. I can create the video but I wanted to learn how to build the screen using a Nano and a smaller screen that the one here. Can you make a tutorial for that? Thanks

    • @BytesNBits
      @BytesNBits  7 หลายเดือนก่อน

      To get video to work you'll need a more powerful system. I'd go for a Raspberry Pi Zero. Arduinos and even Pi Pico or ESP32 will struggle to get any video playback.

  • @NayanPrakash06
    @NayanPrakash06 3 ปีที่แล้ว

    Hello.. Thank you for the video.. Have made the connections and works well .. Is it possible to interface the SD card (the one present on the module) as well .. If yes, can u please share the procedure.. Will be of great help.. I tired interfacing by selecting a different CS and making it HIGH but didn't work ..

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi. You're on the right track. You need to connect the data and clock lines to the SD card connections and, as you rightly did, connect a new output from the Arduino to the chip select on the SD card interface. Again make sure you set it inactive before starting to initialise the SPI devices. From there you need to learn how to use the SD card package. Have a look at www.arduino.cc/en/reference/SD. There are a few examples for you to look through and see how the package is used.
      I hope this helps.

    • @NayanPrakash06
      @NayanPrakash06 3 ปีที่แล้ว

      @@BytesNBits Thank you for the reply. I tired the mentioned method but the combination of three doesn't work. Tested the wiring and code multiple times. When connected and used separately i.e. SD card only or Display and touch only, works well. If is it possible for u, can you please try out using all the three together?? Will be of great help. Thanks in advance!

  • @ezion67
    @ezion67 ปีที่แล้ว

    Thanks for the nice tutorial. I try to understand the ins and outs, level shifting from 5v to 3v3 using voltage dividers is straight forward. However the MISO lines need shifting UP from 3v3 to 5v. How does that work with this resistor set up? What am I missing?
    The only thing I can think of is that the MISO pin (input) on the Arduino is 3v3 compatible and should be connected WITHOUT the voltage divider?
    Edit: I checked the data sheet. The inputs on the ATMega328p are not 3v3 compatible. Assuming the the circuit is NOT operating in the gray "it might work" era. Is maybe the internal pull up used together with the voltage divider to create a offset on the the MISO input pin?
    Please clarify, thanks in advance.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. You're absolutely right on the voltage levels. The 3.3V signal works more from the flexibility of the Arduino than by true digital signal levels. This circuit used voltage dividers to show the principle with simple components. In reality you're much better off using level shift ICs.

    • @ezion67
      @ezion67 ปีที่แล้ว

      @@BytesNBits Thanks for your answer. I did the calculation, even using the internal pull up to create a voltage offset it would still operate on what you call "the flexibility of the Arduino". So for me active level shifters it is.

  • @denakkusativ1072
    @denakkusativ1072 ปีที่แล้ว

    Thank you so much for the video. I got one question though: Is it possible to loosen the pcb on the back? I obviously do not want to remove it, but for my project I need a bit more space behind the display itself. I know there is a cable coming from the LCD display that’s connected to the shield (I think that’s how it’s called), so it has to be possible, right?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. These displays tend to have a ribbon cable coming out of them which is connected to the circuit board. The actual lcd panel is then stuck to the pcb. As long as you don't damage the ribbon cable you should be fine. You can also buy the displays with just the ribbon cable so you can solder to your own circuits. Have a look on eBay. I hope this helps.

    • @denakkusativ1072
      @denakkusativ1072 ปีที่แล้ว

      @@BytesNBits Thanks for the incredibly fast response. You said that the lcd panel is ‚stuck‘ to the pcb. Is it possible to tell how they typically assemble them? Is it some type of double sided tape or glue? Do you have experience with separating the two components without damaging either of them?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      @@denakkusativ1072 I has a look at my panel. It looks like there are two trips of double sided tape along two edges of the panel. Only guessing though. There don't seem to be any screws or solder points holding it on.

    • @denakkusativ1072
      @denakkusativ1072 ปีที่แล้ว

      @@BytesNBits That sounds very promising to me. Thank you so much

  • @Fachher
    @Fachher ปีที่แล้ว

    Thank you for this video. It helped me to correctly connect my display to my Arduino. Before this video I've connected everything directly without any resistor. My display showed one single frame and then turns white. Now the graphicstest example renders letters, rectangle, lines etc but not on the whole screen. It is more like 240x240 instead of 240x320. What could be the reason for it. I double checked the wiring.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. You need to play around with the screen dimensions and rotation to get it to match your screen. If you've set the screen dimensions it sounds like you might have it rotated incorrectly.

  • @reiniermariscotes4455
    @reiniermariscotes4455 7 หลายเดือนก่อน

    Is it okay to use a 10k resistors if I dont want to make a voltage divider?

    • @BytesNBits
      @BytesNBits  7 หลายเดือนก่อน

      The ideal solution is to use a level shifter IC. But whatever works for you is a good choice.

  • @SUHANISHARMA-mk4sv
    @SUHANISHARMA-mk4sv ปีที่แล้ว

    Hello, @bytesnbits, thank you so much for this tutorial, I wish I had found it earlier. I'm a beginner at mechatronics, so my biggest source of learning is youtube. Previously I referred to some other video on youtube and there they had connected VCC to 3.3v and all the other SPI pins directly to Arduino Uno, after that I spent several hours trying to fix what when wrong and I realized the mistake I made initially but now when I'm trying to run it with the right connections and logic level, it is just showing a white screen and flickers. Is it possible that I've already damaged my component?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. That's a possibility. The screens are quite tolerant to 5V but if you've been playing about with them at that level for a while it may well have damaged one or more inputs. If you can get hold of a spare and get your display up and running, then try the non working one to see if it is OK.

    • @SUHANISHARMA-mk4sv
      @SUHANISHARMA-mk4sv ปีที่แล้ว

      @@BytesNBits I'll try that, thank you

    • @notchurn
      @notchurn ปีที่แล้ว

      @@SUHANISHARMA-mk4sv i had same issue. Do you have any advices?

    • @SUHANISHARMA-mk4sv
      @SUHANISHARMA-mk4sv ปีที่แล้ว

      @@notchurn Luckily my tft lcd was fine, for me the issue was in the code, I ran the graphics test in parts instead of running the whole code at once and it worked.

    • @stevechapman7564
      @stevechapman7564 7 หลายเดือนก่อน

      I have just purchased 2 of these screens and had the same issues. I found that I had to bridge out the jumper on the back of the board called J1 it is between the 2 3pin SOT devices. hope it helps.

  • @patrickk2791
    @patrickk2791 3 ปีที่แล้ว

    Hi, first of all thank you for the well made video, it's been very interesting and a great help! Secondly, I was wondering if the values of the resistors are crucial or if it is just the ratio that matters. I haven't got 2.2k and 5.1k, but I do have 4.7k and a 10k, which should be ~3.4 Volts (I measured it to be ~3.38). But I am uncertain if this will have any other effects?
    You see, my screen is only functional when I do not have the Touch SPI connected. My touch is functional even with the TFT SPI pins connected, but then the screen only shows white, and sometimes flickers when I sent data to it. I suspect it's the difference in values of the voltage divider resistors, but I am unsure of the effect of having (roughly) the same ratio, but higher resistance values.
    Your advice is much appreciated.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi Patrick. The resistors should be ok. The current drawn by the inputs is around 1uA. The screen not working when the touch is connected can often be the chip select functions getting mixed up on initialising the classes. Are you making sure to set both chip selects inactive (high) before you initialise the library classes?
      // avoid chip select contention
      pinMode(TS_CS, OUTPUT);
      digitalWrite(TS_CS, HIGH);
      pinMode(TFT_CS, OUTPUT);
      digitalWrite(TFT_CS, HIGH);
      tft.begin();
      ts.begin();
      I hope this helps.

    • @patrickk2791
      @patrickk2791 3 ปีที่แล้ว

      @@BytesNBits Hi, thank you for the fast response. I am indeed setting the chip select pins to high before calling the tft and ts begin functions. So something else is going wrong.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi. If it's just the resistors that are different you could rule them out by adding a level shifter, e.g. amzn.to/3eyDRqp. They are useful to have around anyway. I'd also check that your connections are all secure. I found that if using the touch caused the board to shift it could blank the screen.
      You could also try connecting the SPI to the touch but wiring the CS pin high (3.3V inactive). Comment out the touch screen code and see if it works. This should try to separate out a software error or a hardware / circuit error.

    • @patrickk2791
      @patrickk2791 3 ปีที่แล้ว

      Hi! That happens to be the exact level shifter ordered earlier this week, along with a whole bunch of resistors including the 2.2k and the 5.1k Ohms, they should arrive shortly and I will report back my findings.
      Until then I have found the following;
      With the touch SPI disconnected and the T_CS wired directly to the 3.3V pin on the Uno, the TFT screen functions like normal (with the slightly modified graphicstest script). Slowly adding more touch SPI pins makes it more and more unstable:
      - With T_CS to 3.3v, T_DO and screen MISO shared connection, it seems to be ok.
      - Further adding T_DIN shared connection to screen MOSI sometimes creates missing or discoloured pixels/short lines on the screen, sometimes functions like normal, and sometimes messes up the fill screen color wipes then functions like normal to end up with a white screen after a few seconds.
      - When I add the T_SCK to the screen SCK, it just seizes to work entirely it is fully white, with sometimes a flicker of black.
      This is all without any touchscreen code in the sketch, purely the graphicstest example with the lines added as shown in your video.
      With this I feel like it has to be in the hardware somewhere, but am at a loss of what it could be.

    • @patrickk2791
      @patrickk2791 3 ปีที่แล้ว +2

      EDITED, see below!
      Update from my side as promised:
      I switched the voltage divider setup from the 4k7 and 10k to 2k2 and 5k1. I also unplugged all my (rigid) breadboard wiring and replaced it with (flexible) jumper wires which allowed me more colours and a tidier layout. The screen now works with both touch and tft SPI connected (Minus the T_IRQ). It can even register the touch and act upon it by updating the screen.
      One issue still remains, like you said; sometimes while using the touch functionality on the screen, the tft just goes completely white. I wonder if soldering it to a perfboard would solve this.
      I have yet to try the level shifter, I shall edit this comment as soon as I've got something conclusive to share.
      EDIT 1:
      I still have yet to test the level shifter, but I have discovered something interesting while playing around with drawing on the screen while simultaneously using the touch functionality. The blanking/becoming completely white of the screen is caused by touching and releasing a lot, while data is being sent to the screen. The larger the amount of data (such as fillScreen's or large amounts of text) the bigger the chance it will get stuck on the white screen. Sending no data at all allows me to quickly tap the touch screen without ever causing the white screen to appear.
      Have you got any advise on how to resolve this?
      EDIT 2:
      I hooked up and tested the level shifter, it is working fantastically now! I used the TXS0108E level shifter for those interested, same one as linked by Bytes N Bits. The connections are as follows:
      I have the OE pin connected to ground with a 10k pull-down, and connected to the 3.3v pin of the Arduino.
      VA is also connected to this 3.3v pin.
      VB is connected to 5V.
      GND to GND.
      A1-A7 to the TFT LCD Touchscreen
      B1-B7 to the Arduino pins.
      I can do full fillScreen's while tapping like a madman, and still experience no white screen whatsoever.
      I am so relieved. Thank you for helping me!
      Purely out of interest and for educational value, do you know why using this level shifter made such a big difference compared to the voltage divider setup?
      Thanks again,
      Patrick

  • @sfs-lyder8560
    @sfs-lyder8560 4 หลายเดือนก่อน

    Hi, how do i wire the display pin and Arduino pin into Bi-Directional logic level converter?

    • @BytesNBits
      @BytesNBits  4 หลายเดือนก่อน +1

      Most of the logic level converters are fairly straight forward to use. They have two sides, one for each logic voltage. Just wire the signal from one device to it's correct voltage side, and the corresponding signal to the corresponding output on the other voltage side. Just make sure that you check which voltage levels are which in the IC data sheet.

  • @dienau6313
    @dienau6313 หลายเดือนก่อน

    Sir may I have a question? is there any touchscreen library used for esp32? Since the XPT2046_Touchscreen library just used for arduino uno.

    • @BytesNBits
      @BytesNBits  หลายเดือนก่อน +1

      The Arduino library should work for the ESP32 as long as you program it in the Arduino IDE

    • @dienau6313
      @dienau6313 หลายเดือนก่อน

      @@BytesNBits thank you

  • @melaxoho4037
    @melaxoho4037 2 ปีที่แล้ว

    Hi,
    nice explain video but i think there is a misstake in minute 8:15. You say the Pin "LED" should be connected to 5V - that's wrong. And never put 5V on a Input of a 3,3V Display - it can be destroyed!
    This pin is a control Pin for the LED Backlight - not the power for it. (you can see the Transistor at the PCB that is the switch for the Cathode to GND) It should be connected to a GPIO Pin for the PWM input for the backlight control. It is by default pulled high (backlight on) you can PWM at any frequency or pull down to turn the backlight off. Brightness adaption a.s.o. You can see that in the schematic of the displays.
    And the Signal MISO is not needed at these Displays - i always let it unconnected. So we have 8 Pins to use these Displays: GND, 5V (itern transformed to 3,3V by the Regulator XC6206P33), MOSI/SDI, DC/RS, CS/SS, Reset, SCK and LED Control. That's it.
    Greetings from Germany

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      Hi. Thanks for the tips. You're absolutely correct.

  • @lalithkumarreddy8311
    @lalithkumarreddy8311 3 ปีที่แล้ว

    Sir which esp32 board should i go for if i want to display images?I mean number of pins and all! A link of the esp32 specs you are using is highly appreciated!

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi. Pretty much any of the ESP32 boards will work (much better that the Uno I was using!). As long as it's got an SPI interface and a couple of spare I/O pins it will be fine.

  • @Venaber
    @Venaber 9 หลายเดือนก่อน

    thanks

    • @BytesNBits
      @BytesNBits  9 หลายเดือนก่อน

      You're welcome!

  • @freddycrespo4107
    @freddycrespo4107 5 หลายเดือนก่อน

    Hi Sr. I got a TFT ili9341 LCD and it is not SPI, but parallet communication for 8 o 10 wires. Please, is there a way to use or convert in a SPI one?. Thanks for give us informations.

    • @BytesNBits
      @BytesNBits  5 หลายเดือนก่อน

      Hi, You'll need to use a display driver that supports your parallel device. I don't think you can convert it to the standard SPI interface if it's been wired up as the parallel version, but please check out some datasheets to make sure. There may be some sort of mode command you can send it.

  • @philluvschips3787
    @philluvschips3787 7 หลายเดือนก่อน

    I bought a shield, there is no MOSI,MISO,CS or DC, it's XM,YP,YM and XP, no Adafruit examples work, only MCUFRIEND library, i can't figure this one out!?

    • @BytesNBits
      @BytesNBits  7 หลายเดือนก่อน

      Is there a data sheet for the screen? the XM etc sound like touchscreen pins. The SPI MOSI etc may not be marked and just connected to the relevant pins on the arduino connector. If you can find the datasheet it should tell you which connections are on which pins so you can map it correctly to the Arduino library. I expect it's simply a pin mapping issue.

  • @traflaw8286
    @traflaw8286 22 วันที่ผ่านมา

    hello sir, i managed to make the lcd work using the calibration code u made, but when i tried it again the next day, it won't display anymore. I didn't touch the wirings.

    • @BytesNBits
      @BytesNBits  17 วันที่ผ่านมา

      That's a strange one. Not sure what to say if it was all working. Have you checked in case a wire has come loose.

  • @Vagubando
    @Vagubando ปีที่แล้ว

    At the end of your video is a pong game. Where is this library (sketch) located?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      I made a video for the game - th-cam.com/video/Oh9vgomyuOI/w-d-xo.html. Have fun!

  • @michaelhartrey8937
    @michaelhartrey8937 3 ปีที่แล้ว

    Have you tried to use the touch interrupt pin on one of these displays? I’ve been using one for an ESP32 internet radio but I had to resort to polling for touch inputs. When trying to use the T_IRQ pin it kept firing all the time without the screen being touched. I’m wondering if it was my particular screen or whether I’m missing something.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi Michael. The T_IRQ pin is best thought of as a prompt to start polling the touch panel. Once you enable the interrupt function in your code the screen will wait until a touch event before pulling the T_IRQ pin low. Once it's pulled low you need to disable the interrupt and then handle the touch input. The T_IRQ input will give multiple triggers as you talk to and handle the touch event, so disabling it will mask of these multiple interrupt triggers. Once you've finished handling the touch event and the screen isn't being touched you can re enable the interrupt to wait for the next event.
      Have a look at github.com/PaulStoffregen/XPT2046_Touchscreen, at the bottom of the readme file. He covers this in more detail.
      I hope this helps.

    • @michaelhartrey8937
      @michaelhartrey8937 3 ปีที่แล้ว +1

      @@BytesNBits Thanks, I’ll take another look at it.

  • @fjalarsigurdarson4862
    @fjalarsigurdarson4862 ปีที่แล้ว

    The Arduino does have a 3.3V output, clearly marked. The thing is, most of these smaller screens say they need 3.3V but they do not really kick in unless they get 5V.

    • @aspirin4709
      @aspirin4709 ปีที่แล้ว

      Sir,is it ok to connect it's to an arduino nano wit series resistance of 10k.

    • @fjalarsigurdarson4862
      @fjalarsigurdarson4862 ปีที่แล้ว

      @@aspirin4709 I am simply not that smart in electronics to advice anyone :-) I just know this fact about the 3,3V and the screens from experience and from reliable sources. I highly recommend this guy:
      th-cam.com/video/7x1P80X1V3E/w-d-xo.html

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +4

      Hi. The 3.3V output on the Arduino is for supplying power. The atual IO pins operate at 5V logic which has to be shifted down for the LCD inputs.
      Using a 10K resistor is fine but you'll need to double the paired resistors in the voltage dividers.

  • @legosinmotion1231
    @legosinmotion1231 4 หลายเดือนก่อน

    Hello I have a question. I have an Arduino uno and it has a 3.3V pin do I still need the resistors or can I just use the 3.3V pin?

    • @BytesNBits
      @BytesNBits  4 หลายเดือนก่อน

      The 3.3V pin is a useful power supply for some sensors. The Arduino io pins run at 5V logic so you'll still need to change logic level. Better than the resistors is to use a bi directional logic level converter IC.

    • @legosinmotion1231
      @legosinmotion1231 4 หลายเดือนก่อน

      @@BytesNBits Ok thank you for your response

  • @pixnone9477
    @pixnone9477 ปีที่แล้ว

    For d1 mini what pin are the right ones?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      You'd need to have a look at the datasheet for your device. The hardware SPI pins should be marked. The chip select, etc can then be any general IO pins.

  • @Ikmijnnaam
    @Ikmijnnaam 14 วันที่ผ่านมา

    Hahaha look at that.......... that is one HELL of a familiar pencil jeeeeeez who would have thought I got that one in green lol ....... how funny hmzzz thanks for the video it is hard to get my hear around being a student of electronics and your video really helps out a lot !!! Work is so much easier with guys like you who explain things, oiiiii electronics haha.......and then to think I am busy to make a voltage read out so I can see what voltage my batteries got and will have ones charging haha being busy for 3 weeks now I need to learn so much oemfffff.....great video !!!

    • @BytesNBits
      @BytesNBits  14 วันที่ผ่านมา

      Thanks. Good luck with the course.

  • @neilfpv
    @neilfpv 5 หลายเดือนก่อน

    Great video! I bought a 1.8 TFT screen. In the description, it says "ST7735 ILI9225 ILI9341". Now I am confused which mine is. How can I find out which mine exactly is?

    • @BytesNBits
      @BytesNBits  5 หลายเดือนก่อน +1

      Can you find the datasheet for the actual device you have?

    • @neilfpv
      @neilfpv 5 หลายเดือนก่อน

      @@BytesNBits hi. Someone told me in esp32 discord today that mine is an ST7735. Thanks a lot!

  • @RandomTorok
    @RandomTorok ปีที่แล้ว

    I read something that if you short J1 then you can simply use 3.3 volts to power the device. Have you heard that or tried it?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      I haven't come across that. It could well be true. I'd check the data sheet for your panel first though!

  • @ayesha7oo2
    @ayesha7oo2 ปีที่แล้ว

    Thanks for your video. Could you please give me the fritzing diagram of ILI9341 TFT display? I have 2.4 inch ILI9325 TFT LCD display and can't find the fritzing part anywhere. Your display is very similar to mine.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. I had to create one from scratch. Find something similar and modify that part. It's a good skill to learn as it means you'll never be without a part model.

  • @saydiy1528
    @saydiy1528 10 หลายเดือนก่อน

    good job. my touch screen just output: Pressure = 4095, x = 8191, y = 8191 , seems not working, what can be? I used 3.3V-5V 4 Channels Logic Level Converter instead on resistances.

    • @BytesNBits
      @BytesNBits  10 หลายเดือนก่อน +1

      The logic level converters are a better option than the resistors so that will be fine. Have you tried running the touchscreen with the LCD disconnected to make sure there is no interference from the other SPI device?

    • @saydiy1528
      @saydiy1528 10 หลายเดือนก่อน

      @@BytesNBits Thanks.

  • @taranagnew436
    @taranagnew436 2 ปีที่แล้ว

    can you make a custom cable that uses a (connector on the back of a rgb matrix)?

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      Hi. Yes. Generally you'd use a 40 way ribbon cable with header to connect to the GPIO on the RPi, then rework the wires at the LCD end. The LCD signals should all be in one block on the ribbon cable so you can just break those out quite easily. You're then left with the other GPIO pins on the rest of the ribbon cable so you'll have to work out how to connect those to the rest of your circuit.
      For this project I'll eventually mount the Raspberry Pi on a circuit board and break out the LCD pins to a connector on that which will then connect to the LCD panel.

  • @Evilslayer73
    @Evilslayer73 3 ปีที่แล้ว

    arduino Mega have a 3.3 volt ouput so can i use that instead of assembling resistance?

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi. Yes. That will connect directly to the TFT panel.

  • @user-uj9sb7qe8q
    @user-uj9sb7qe8q 9 หลายเดือนก่อน

    Heyy
    I have a question
    Im using Arduino mega2560 and ili9341 when I'm using just the touch and the screen it works amazing but when I'm trying to add the sd card it’s failing and of course, I'm using a different cs
    And when I tried it separately the sd card works fine
    So I think there is a problem with the bus but I don't know how to solve this I already try to fix it for 2 days
    So if u have some advice or tutorial on how to use everything together it will be great
    Thank u

    • @BytesNBits
      @BytesNBits  9 หลายเดือนก่อน

      As you say it should all work if you're using separate CS lines. Have you tried SD + screen and SD + touch to see which ones can't work together? Make sure you're careful with the initialisation of the devices. The CS lines need to be stable and off before you start talking to any devices on the bus. I think I ended up putting in a short delay to let the devices clear the bus before the real code started.
      The resistor voltage step downs aren't the best solution. Use logic level converters for a more reliable solution. Maybe a CS line is floating out of spec - only guessing now!
      I hope this helps.

    • @user-uj9sb7qe8q
      @user-uj9sb7qe8q 9 หลายเดือนก่อน

      @@BytesNBits ok I will try it today and I let u know if something works
      And I will try to find which combination cannot work together
      Thank u for u answer

  • @josealfredomartinezmartine7481
    @josealfredomartinezmartine7481 2 ปีที่แล้ว

    Hello. I need some help, I have to connect a Texas Instruments RM57L8 to a TFT touch screen. Do you know where can I find info about this? Thank you.

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว +1

      Hi. You'll need to get hold of the microcontroller datasheet. If it has an SPI interface you're good to go. Use the driver package in the video to find out the initialisation codes for the LCD and touchscreen. If it doesn's have an SPI interface you'll need to code one in software. There are a few examples on the internet for guidance. Best of luck!

  • @atihrot755
    @atihrot755 ปีที่แล้ว

    Dear Sir. I finally found a way to get it up and running. It's already drawing correctly, but there are still some little things that I can't confirm. I installed the SPFD 5408-master library, where I opened and installed the SPFD 5408 TouchScreen subfolder in that library. X and Y minimum and maximum should be set there. Those numbers should have been entered in the code SPFD 5408 tftpaint. It also had to be reinstalled and now it works properly. But now it only works with a finger. With a small writing pen, the LCD does not respond at all. If you have any suggestions, thank you.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. You've probably got a capacitive touchscreen, like your phone will have. These do not respond to the plastic stylus pens. You'll need a capacitive touchscreen pen.

  • @ninjaop5617
    @ninjaop5617 10 หลายเดือนก่อน

    NICE lecture but i have done that you told in vedio but my display only showing white screen only can you help?

    • @BytesNBits
      @BytesNBits  10 หลายเดือนก่อน

      The white screen is usually some connection issue. Please make sure you check your wiring and the pin definitions in the sketch.

    • @ninjaop5617
      @ninjaop5617 10 หลายเดือนก่อน

      I tried it many times but there is no connection issue sir

    • @ninjaop5617
      @ninjaop5617 10 หลายเดือนก่อน

      I have tried it with esp8266 also and with many libraries but it always shows white screen some suggestions?

  • @kalamabidin922
    @kalamabidin922 10 หลายเดือนก่อน

    Hi,
    Am working for 2.4inch SPI TfT LCD with Arduino ide on Arduino Uno r3,
    But after uploading the code it is showing only white screen.
    Have reconnected multiple times, check with different codes.
    But same issue.
    Mine lcd is non touch, and am not using Arduino shield tft lcd.
    How to solve this issue . any idea.
    Am just doing simple text print .

    • @BytesNBits
      @BytesNBits  10 หลายเดือนก่อน

      Try adding some serial print statements to see if the main code loop is running or getting blocked by the LCD driver. Are there any other SPI devices on the channel? Try using a different SPI output from the Arduino, or try the software SPI driver. Make sure your chip select signal is all set up correctly and the reset pin on the display is connected correctly. If it's not being driven by the Arduino make sure it tied to the non active state - you'll need to check your display datasheet. Also make sure the driver chip in your display matches with the driver you're using. I hope this helps.

  • @sudheerillipilli4691
    @sudheerillipilli4691 2 ปีที่แล้ว

    what changes i need for working this hardware spi on raspberry pi pico using adafruit library
    why hardware spi doesnot work on raspberry pi pico using arduino ide

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      Hi. You'd need to check the Arduino documentation for the Pico. Check you're using the correct pins, etc.

  • @RandomTorok
    @RandomTorok ปีที่แล้ว

    Why did you choose those resistors for the voltage divider?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      The ratios are the important choice to get the correct voltage division. After that it's down to making sure enough current is drawn to get the division and not swamp the output. Then down to what I had in my resistor store! It's not super important as long as you're in that sort of region.
      A much better solution is to use a level shifter IC. I used resistors for a quick and cheap setup.

    • @RandomTorok
      @RandomTorok ปีที่แล้ว

      @@BytesNBits Can you provide me with a link to one of these level shifter IC. I managed to build a voltage divider that produced 3.4 volts using a 220 Ohm resistor array and a 100 Ohm array. The math worked. I then ordered a 5.1K array and a 2.2K array but unfortunately these new arrays produced 3.9 volts.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      @@RandomTorok You want something like this : www.adafruit.com/product/395. The bi directional ones are really useful.

  • @wandersongw
    @wandersongw ปีที่แล้ว

    are there some way to play videos in this TFTs?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +1

      Hi. The TFT can manage about 20-30 fps. Unfortunately the Arduino hasn't enough power or resources for video. So, yes the screen can just about do it, but you'll need a Raspberry Pi or something like that. I did use this exact screen for a Pi powered game console and could get around 50fps.

  • @nexuzinnovation-com
    @nexuzinnovation-com 3 ปีที่แล้ว +1

    Hi, whenever I connect the T_DO to MISO, the display went white screen, I followed exactly the diagram you mentioned. Please advise.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi,
      Can you get the screen working without the touch panel connected?
      Can you get the touch panel working without the screen connected? Try printing values to the serial port so you can see what it's doing.
      If both are working separately check your wiring. Make sure your LCD reset line is connected and specified in the LCD setup code and that the chip select pins are all correctly initialised. Also check you're pulling both chip select pins high before initialising both the LCD and touch panel objects - this can cause errors if pins are left floating.
      Let me know how you get on. Good Luck!

    • @nexuzinnovation-com
      @nexuzinnovation-com 3 ปีที่แล้ว

      ​1. Can you get the screen working without the touch panel connected?
      - Yes
      2. Can you get the touch panel working without the screen connected?
      - Yes
      Both 1 and 2 above were running separate sketch.
      3. Make sure your LCD reset line is connected and specified in the LCD setup code and that the chip select pins are all correctly initialised.
      - Yes
      4. Also check you're pulling both chip select pins high before initialising both the LCD and touch panel objects - this can cause errors if pins are left floating.
      - Yes
      This morning, I try to move the T_CLK, T_DIN and T_DO to the voltage divider adjacently and respectively, the display works normal. However, I try to merge both Touch and ILI9341 functions together but can't detect any touch signal, any idea ? Do I need to enable low to TCS_PIN and TFT_CS ?
      Please advise.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi,
      This is a tricky one!
      When you say you moved the T_CLK etc to the voltage divider; are you using separate voltage dividers for the touch and LCD signals. If so you only need a single divider per signal and then connect the mid point to both touch and LCD connections. The SPI signals should be common to each circuit.
      What resistor values are you using on the voltage dividers? Playing with those might help. If your voltage level is dropping too low it will cause random errors.
      Try removing the voltage divider from the MISO signal. This is driven by the LCD and touch screen so will be at the safe 3.3V. It's really just signals from the Arduino to the devices that need the voltage drop.
      I hope this helps.

    • @nexuzinnovation-com
      @nexuzinnovation-com 3 ปีที่แล้ว

      @@BytesNBits ,
      1. If so you only need a single divider per signal and then connect the mid point to both touch and LCD connections.
      - Yes, I am putting both CLK and T_CLK to the same mid point of the voltage divider.
      2. What resistor values are you using on the voltage dividers?
      - as per your mentioned, 2.2kΩ and 5.1kΩ where I measured all the voltage divider output, they are about 3.1 - 3.29V each.
      3. Try removing the voltage divider from the MISO signal.
      - but based on your diagram, it is using voltage divider that connected T_DO with SDO ?
      - do you means the T_DO line can be free from voltage divider and direct connecting to Arduino pin 12 instead ?
      I have made a mistake where I put the initial object as: XPT2046_Touchscreen ts( TCH_CS, TIRQ_PIN ); , later I removed the TIRQ_PIN parameter, the sketch can detects the touch input.
      However, by merging the ILI9341 and XPT2046 routines within the loop(), I have to use digitalWrite( LOW ) to select the targeted device to function and is very slow, I am still trial-and-error how to calibrate, may be sir, you can share how you scheduled the touch and ili9341 tasking in your Arkanoid game :o) ?

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi,
      The T_DO, SDO and pin 12 can just be connected together. The voltage divider is really just there to make sure any 5V output from the Arduino doesn't damage the other devices. If you've got it working with the divider in place I'd leave it in.
      If you have a look at this tutorial you'll get the same code used in the Arduino program (I'll be doing that video soon).
      bytesnbits.co.uk/arduino-touchscreen-calibration-coding/
      Have Fun!

  • @konstantinosdamaskos4138
    @konstantinosdamaskos4138 3 ปีที่แล้ว

    Hello, the tft freezes after some hours. What can i do? I think it must be a stability issue. How i can reduse the noise on spi pins and make more stable the connections?
    Thanks in responce and congrats for tha amazing channel.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      How have you made the connection between arduino and screen? On my tests I just had the screen plugged into a breadboard. Any movement would freeze the screen. If you've used proper connectors make sure the wire length isn't too long and that the wires aren't running past anything like a motor. You can also try reducing the SPI data rate. Is the screen getting hot? This could cause issues. If you've got an oscilloscope check the signal voltage at the screen after the voltage dividers. Make sure it's not too low or high, and not drifting with time.
      I hope this helps and thanks for the comments.

    • @konstantinosdamaskos4138
      @konstantinosdamaskos4138 3 ปีที่แล้ว

      @@BytesNBits I have the screen plugged into a breadboard too, and i have connected to the pins of a nucleo with 12 cm jumber wires. Also, why i have to reduse the SPI data rate?
      Thank you for the help!

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi. Your setup should work OK. 12cm doesn't seem too long. Does it freeze when you use the touchscreen or just while it's sitting there with no touching? Reducing the data rate can help with signal noise. Slower rates can be more robust. If you've got an oscilloscope or can borrow one you should be able to see any interference. Is the microcontroller still running when it freezes - it's not that which has stopped?
      On the noise issue, does it always run for a few hours before crashing? If so I'm not sure noise is the issue. Noise would tend to be constant so you should get random crashes, some after a few minutes, etc. Is your power supply OK? Just thinking of anything that could be going wrong.
      The other option is to periodically reset the display in your code. You can use the hardware RST line (pull it low I think) or there is a software reset function in the library if you've got the reset line connected to the microcontroller.
      I hope this helps.

    • @konstantinosdamaskos4138
      @konstantinosdamaskos4138 3 ปีที่แล้ว +1

      @@BytesNBits Thank you for your advice, it freezes after a couple of hours but the microcontroller and the other function's still work. I will try the software reset.
      Thanks and keep the good job with your channel.

  • @rushikeshkumawat1361
    @rushikeshkumawat1361 ปีที่แล้ว

    I always get white screen always and I use 1 kiloohm resistor. Is it ok to use such resistor? Or is it mandatory to use 10 K resistor?
    Will I get output If I use 10k resistor?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      The ratio of the resistors is the important factor to get the voltage division. Or use a bi directional level shifting IC which is a much more reliable solution.

  • @adamdaniels8554
    @adamdaniels8554 ปีที่แล้ว

    I have an SPI 1.7 in. LCD screen I want to wire into my Windows 10 desktop as a performance monitor. Could i do so using something similar to this, an arduino nano, or other feasible means? LCD Driver IC: ST7735S

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      There would be a few stages to this project. I think it would be hard to wire the panel directly to your PC so you'd need to use a microcontroller or something like a Raspberry Pi. This would then drive the LCD panel. You'd then need to get the PC performance data to that device so it could display it.
      The other option is to use a small HDMI lad panel that would plug in to your PC as a second monitor. Then just display the performance stuff on there.

  • @danielsolis321
    @danielsolis321 3 ปีที่แล้ว

    thanks a lot¡

  • @rushikeshkumawat1361
    @rushikeshkumawat1361 ปีที่แล้ว

    Can I use 1 kiloohm resistor as pull up ?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      1K is maybe a bit low but should still work fine.

  • @larrybud
    @larrybud 5 หลายเดือนก่อน

    10:00, I'm not following something: Why don't you have to define your clk, miso, and mosi pins in your code (line 29 vs line 27)?

    • @BytesNBits
      @BytesNBits  5 หลายเดือนก่อน +1

      The library tft driver defaults to using the hardware SPI pins. We simply tell it what extra pins we're using for the CS, DC and RST. If you're using other pins for the SPI signals you can add those pin definitions as per the commented out line.

  • @marc-antoineaubin2032
    @marc-antoineaubin2032 3 ปีที่แล้ว

    Hi, thanks you for your video its really helpful, but I have an issue with the compilation, first i tried on an arduino Mega, but the same message was appearing every single time : Error with compilation on Arduino Mega2560... i thought my arduino went bad so I tried an other....but same issue here....So I thought, maybe the programming of the library does not allow any other Arduino type (even when changing the Pins number in the sketch) ...So then I ordered an Arduino Uno...the same one in this video and the same TFT screen....but same issue (Error with compilation on Arduino Uno)....my usb port is select properly and my Arduino card type either....I watched your video about 10 times , the libraries are the same (same versions) , the encodings is written in the exact same way, and the wires are properly connect with the resistances divider for each data pins....Do you have any ideas of what's wrong with my setup ?
    Thanks a lot for you time !!!
    Have a nice day :D !

    • @marc-antoineaubin2032
      @marc-antoineaubin2032 3 ปีที่แล้ว

      I was finally able to make it works !!! I installed the Adafruit BusIO library and it works instantly !! :D

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi Marc. Glad to hear you got it working. Did you install the libraries through the library manager? Usually that will install all the extra libraries that a package requires. Have fun with the screen!

  • @impossibletechie8059
    @impossibletechie8059 ปีที่แล้ว +1

    will this work only with display if i dont want the touch functions?

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +1

      Yes. Just leave it the touch screen code and connections.

    • @impossibletechie8059
      @impossibletechie8059 ปีที่แล้ว

      Thanks for the response. I have tried another circuit with only 10k resistors and it doesn't seem to be working. What might be the reason behind that? I only see white screen.

    • @impossibletechie8059
      @impossibletechie8059 ปีที่แล้ว

      @@BytesNBits i tried the exact same thing. all i see is white screen. what would be the better way to debug this?

  • @diyk-h-m2423
    @diyk-h-m2423 3 ปีที่แล้ว

    hello sir can you tell me about how to use SD card LCD 2.8 inch SPI with Arduino Uno

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว +1

      Hi. A couple of people have asked for this. I'll make a video over the next week or so.
      Basically you need to connect the data and clock lines to the sd card and then use a spare output from the Arduino to control the CS input on the sd card. You should then be able to use the SD card library to talk to the device. I'll cover it in full detail on the video when it's ready.

    • @diyk-h-m2423
      @diyk-h-m2423 3 ปีที่แล้ว +1

      @@BytesNBits yes thank you sir

  • @user-bx3qg6sh4w
    @user-bx3qg6sh4w ปีที่แล้ว

    Amazing tutorial! However, I did encounter a problem. To begin with, I'm an amateur.
    After I've connected the wires and uploaded the program, my screen doesn't show anything but white, and I'm unsure of where I did wrong. I don't have 2,2K and 5,1K resistors so I tried both 2K and 4,7K, and 4,7K and 10K. Is it the resistors?
    For the code, I copied this tutorial. I chose the recommended port and chose Arduino Mega as the board (which is the board I use), and still nothing shows up to my tft lcd screen. And this tutorial when HIGH and OUTPUT is written, it shines in light blue, but when I write it it's simply black. But I've heard that that shouldn't matter.
    It would be deeply appreciated if someone has a good answer!

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. Your resistor values should be fine. If in doubt have a look at a bi directional level shifting IC. It's a much better solution.
      In moving to the Mega board did you change the pin assignments to match your board? I don;t think the pins are compatible between boards. You need to choose an SPI channel on the Mega and set the code up to use that one. Then add the generic IO pins to complete the SPI interface to the panel. Good luck!

    • @stevechapman7564
      @stevechapman7564 7 หลายเดือนก่อน

      try to bridge out the jumper on the back of the board J1 it fixed 2 of my boards

  • @hal47
    @hal47 ปีที่แล้ว

    Hi sir
    How to use this screen to play movie

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +1

      Hi. These SPI based screens are not really the right interface for video work. The serial channel is not fast enough. Similarly the Arduino doesn't have enough computing power to decode video.
      You might be able to get low quality video (very low fps) using this lcd panel with a Raspberry Pi. I did use some software to get around 50fps for retro gaming so maybe 10-15 fps might be possible for video.
      Have a look at hdmi connected screens. There are some small ones around.

  • @hotstuff6131
    @hotstuff6131 2 ปีที่แล้ว

    The touch input is very finicky for me. I used the onoffbutton example, but sometimes it takes a few tries for the input to go through, and sometimes it takes only one try. And once in a while the ts.begin in the example code apparently doesn't register, leading to the whole code being inoperable.

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      Hi. Do you have a spare screen to test with. It might be a dodgy unit.

    • @hotstuff6131
      @hotstuff6131 2 ปีที่แล้ว

      @@BytesNBits oh I'm in a class about this stuff and the whole class seems to be having issue s with it haha. The pjrc website we use said to use a few of the pins for both a touch input and some output s. Could it be that the teensy is getting interrupted by both an input and output to the same pin?

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      @@hotstuff6131 The touch screen should only need the SPI connections and a chip select pin. If you're trying to use any of these pins for more than one function you will upset the touch screen controller. Try disabling the code that uses the pins for the second function or try my sample code to just talk to the touch panel. If that all works you know the panel is OK. If not then you've got some other sort of problem. I hope this helps.

    • @hotstuff6131
      @hotstuff6131 2 ปีที่แล้ว

      @@BytesNBits will try when I get the chance!

  • @user-yv8pc8mt7e
    @user-yv8pc8mt7e 3 ปีที่แล้ว

    Could you please share the game program code?
    I want to run the 'arkanoid' game once.

    • @BytesNBits
      @BytesNBits  3 ปีที่แล้ว

      Hi, I'm working on the full video for the game so that should be live in the next day or two. I'll give out the full listing with that so you can have a go!

  • @XXXXXX-wl6zk
    @XXXXXX-wl6zk ปีที่แล้ว

    Nice toutorial.
    I have problem with my 2,8" TFT with touch screen. I connected it with arduino with 2,2k and 4,7k resistors, but picture is moved. I sent picture that showing problem to seller and he send me two files one "c" and secound "hex" without manual how use it.
    Pls help me solve this problem. Sorry for my bad english.

    • @XXXXXX-wl6zk
      @XXXXXX-wl6zk ปีที่แล้ว

      Problem has solved. I changed two line in Adafruit_ILI9341.h file in libraries/Adafruit_ILI9341 folder from:
      #define ILI9341_TFTWIDTH 240 ///< ILI9341 max TFT width
      #define ILI9341_TFTHEIGHT 320 ///< ILI9341 max TFT height
      into
      #define ILI9341_TFTWIDTH 320 ///< ILI9341 max TFT width
      #define ILI9341_TFTHEIGHT 240 ///< ILI9341 max TFT height
      And now TFT work perfectly.
      The comand tft.setRotation(1); do not solv this problem.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Good to hear you've got it sorted out.

  • @Vagubando
    @Vagubando ปีที่แล้ว

    I have letters inverted vertically on such a display. I have tried many libraries, but there is no result. Advise me where to dig ?????

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว +1

      The Adafruit GFX library has a setRotation method that allows you to specify the screen rotation. From memory it takes an integer parameter of 0-3 for each of the 4 90 degree rotations.

    • @Vagubando
      @Vagubando ปีที่แล้ว

      @@BytesNBits Спасибо !

  • @atihrot755
    @atihrot755 ปีที่แล้ว

    Dear Sir. I have a 2.8 inch LCD display but I can't find the driver on the SM245 ST chip. Please help. Well thank you. I can't set drawing on the screen. It doesn't work at all.

    • @BytesNBits
      @BytesNBits  ปีที่แล้ว

      Hi. Each driver chip needs a specific sequence of setup instructions to get it to work. These should be in the driver chip data sheet. If you look at the ILI9341 library code you'll see this sequence being sent out. If you haven't got a ready made driver library you'll need to modify one of the exiting drivers for your chip. Make sure you do a good search on Google. Most of the chips have a ready made driver out there somewhere.

    • @inanitas
      @inanitas 3 หลายเดือนก่อน

      ​@@BytesNBits How do we find out which chip our display uses? I ordered one off of amazon and figured they'd supply more details with the package. It doesn't say which chip is used anywhere thougt and the only visible IC is the touch screen chip.

  • @rizkylevy8154
    @rizkylevy8154 2 ปีที่แล้ว +1

    does this ILI9341 require a resistor?

    • @BytesNBits
      @BytesNBits  2 ปีที่แล้ว

      The spec calls for 3.3V on the inputs so I've played safe and added the voltage dividers. You can probably get away without but I'd hate to advise it in case someone destroys their panel. Level shifter ICs give a neater solution if you want to keep things on the safe side.

  • @MADARAUCHIHA-lk3wg
    @MADARAUCHIHA-lk3wg 20 วันที่ผ่านมา

    I did everything you say in this video...but my display isn't working...please help me...😢

    • @BytesNBits
      @BytesNBits  17 วันที่ผ่านมา

      Usually it's a wiring fault or your code doesn;t match up with the pins you're using.

  • @irfanarefin1265
    @irfanarefin1265 4 หลายเดือนก่อน

    can it be used on esp32?

    • @BytesNBits
      @BytesNBits  4 หลายเดือนก่อน +1

      Yes. The Arduino library should be fine. Just make sure you use appropriate io pins.

    • @irfanarefin1265
      @irfanarefin1265 4 หลายเดือนก่อน

      @@BytesNBits Thank you for the reply. I'll try to work with it