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

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ •

  • @DavidTLutz
    @DavidTLutz 2 роки тому +13

    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  2 роки тому +1

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

  • @Pete-pp7kt
    @Pete-pp7kt 29 днів тому +1

    Awesome video series on the ILI9341 TFT touchscreen.I'm using a Arduino Nano, TXS0108E Logic Level Shifter Converter , and ILI9341, 3.2" TFT touchscreen, and your code worked perfectly first try. I really appreciate the time you took to explain what each of the pins does and how to hook them up.
    I'm working my way through your videos for a second time, so I can use your information to try nd built a menu system where I can adjust the values of each button. Thanks Pete

    • @BytesNBits
      @BytesNBits  29 днів тому

      Great to hear you got it all working.

  • @mellee3436
    @mellee3436 2 роки тому +4

    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  2 роки тому

      Great to hear you've got your project working.

    • @mellee3436
      @mellee3436 2 роки тому

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

  • @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 :)

  • @LeraarStijn
    @LeraarStijn Рік тому

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

    • @BytesNBits
      @BytesNBits  Рік тому

      Glad it was helpful!

    • @DaddiJazz
      @DaddiJazz 4 місяці тому

      Hi I am trying this out, and get code to compile and run but nothing on the screen, except in the end approximately 1/3 of the sceen has a different shade (grayish). I also tried out a different setup with 10k resistors, but it returned the same result. any recomendation for how to debug this?

  • @activ8me3
    @activ8me3 3 роки тому +1

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

    • @activ8me3
      @activ8me3 3 роки тому

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

    • @BytesNBits
      @BytesNBits  3 роки тому

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

  • @viktorhugo8252
    @viktorhugo8252 Рік тому

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

  • @rondivecchia4561
    @rondivecchia4561 9 місяців тому

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

    • @BytesNBits
      @BytesNBits  9 місяців тому

      Glad it was helpful!

  • @WowRodg
    @WowRodg 19 днів тому

    Very helpful for my aircraft engine monitoring system project. Thanks a bunch !

    • @BytesNBits
      @BytesNBits  19 днів тому

      No problem. Hope you get it working.

  • @dankclee
    @dankclee 2 роки тому +1

    Thank you for publishing this 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 Рік тому

      Most software wants SD_CS to be pin 5 on esp32.

  • @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.

  • @gammacount1328
    @gammacount1328 2 роки тому

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

  • @robconnelly202
    @robconnelly202 3 роки тому

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

  • @Harry-Powney
    @Harry-Powney 4 роки тому

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

  • @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!

  • @accci4551
    @accci4551 7 місяців тому

    Thx for publishing this video! now I know wha the LED at the display is

  • @johnvine5731
    @johnvine5731 2 роки тому

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

  • @atihrot755
    @atihrot755 2 роки тому

    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  2 роки тому

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

  • @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.

  • @drlerkan
    @drlerkan 3 роки тому

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

    • @BytesNBits
      @BytesNBits  3 роки тому +1

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

  • @jimdesposito9433
    @jimdesposito9433 Рік тому

    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.

  • @pablomesquita1859
    @pablomesquita1859 20 днів тому

    Thank you very much for the video. I managed to get my display working, now I can "play" with it... lol
    I just can't use the entire screen... there is a strip on the sides of the SD card pins that is not rendered with each update, giving the impression that the entire screen is not being used.

    • @BytesNBits
      @BytesNBits  20 днів тому

      check the rotation parameter on the screen initialisation. You might be displaying a portrait display on a landscape screen.

    • @pablomesquita1859
      @pablomesquita1859 18 днів тому

      @@BytesNBits Thanks for the reply but I ended up discovering that my display controller is the ST7789. I just changed the code and everything worked perfectly.

  • @Ikmijnnaam
    @Ikmijnnaam 8 місяців тому

    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  8 місяців тому

      Thanks. Good luck with the course.

  • @larrybud
    @larrybud Рік тому

    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  Рік тому +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.

  • @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:
      ua-cam.com/video/7x1P80X1V3E/v-deo.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.

  • @Pete-pp7kt
    @Pete-pp7kt 28 днів тому

    I was wondering if you have or were consider making a video comparing an Uno shield LCD to a breakout LCD? I have not been able to find a video comparing them, and how to alter my code to switch between a shield LCD and breakout LCD. Thanks Pete

    • @BytesNBits
      @BytesNBits  28 днів тому

      I haven't looked at the shield LCDs. But if you've got a SPI shield it will be pretty much the same as in the video. You just need to get hold of the shield data sheet to find out which pins it is using for the connections. If you use those in the code it should just about work.

    • @Pete-pp7kt
      @Pete-pp7kt 23 дні тому

      @@BytesNBits Unfortunately I have not had much luck coverting the pinouts. The TFT LCD breakout is MISO, MOSI, CS, SCK etc. while the shields are RD, WR, RS, CS, RST etc. I'm sure for someone with experiene this would be pretty easy, but for someone new to TFT LCD's there's not much out there to help us .

    • @BytesNBits
      @BytesNBits  22 дні тому

      @@Pete-pp7kt It can get confusing as they all use variations on the names. The RD and WR will be the MISO and MOSI. If it's printed on the shield the RD (read) is probably MOSI (master out slave in - slave is the LCD panel). RS may the DC connection unless there's one more obvious, RST will be reset. There should also be a CLK pin. CS is the chip select. If you've got some driver code with the shield that may give you some clues.

  • @mahlodibogashu5211
    @mahlodibogashu5211 3 роки тому

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

  • @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.

  • @trombonista92
    @trombonista92 2 роки тому

    very high production quality ,

  • @jefferyosei101
    @jefferyosei101 7 місяців тому

    Thank you so much, this is EXACTLY what i needed!

    • @BytesNBits
      @BytesNBits  7 місяців тому

      Glad it was helpful!

  • @nucleoy6000
    @nucleoy6000 11 місяців тому

    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  11 місяців тому

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

  • @MOHJH59
    @MOHJH59 3 роки тому

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

  • @djix030
    @djix030 Рік тому

    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  Рік тому

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

  • @michaeldutsonlandscapephot2184
    @michaeldutsonlandscapephot2184 3 роки тому +2

    Excellent video Bob,. Probably about the clearest and most understandable ones on UA-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  3 роки тому +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 - ua-cam.com/video/FI7yXDi-fKA/v-deo.html
      Simple SD card images - ua-cam.com/video/aVCWLk10sAw/v-deo.html
      Writing your own image handler - ua-cam.com/video/exjzGMX4fqs/v-deo.html
      Have fun!

    • @michaeldutsonlandscapephot2184
      @michaeldutsonlandscapephot2184 3 роки тому

      @@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  3 роки тому +1

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

    • @michaeldutsonlandscapephot2184
      @michaeldutsonlandscapephot2184 3 роки тому +1

      @@BytesNBits WAF is generally an unachievable goal! 🙄

  • @alnoorratansi9364
    @alnoorratansi9364 3 роки тому

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

    • @BytesNBits
      @BytesNBits  3 роки тому

      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 3 роки тому

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

    • @BytesNBits
      @BytesNBits  3 роки тому

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

  • @makermatrix9815
    @makermatrix9815 3 роки тому

    Fantastic. Glad I found your channel.

    • @BytesNBits
      @BytesNBits  3 роки тому

      Thanks. I hope you find it useful.

  • @mbanc443
    @mbanc443 10 місяців тому

    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  10 місяців тому

      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.

  • @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.

  • @Fachher
    @Fachher 2 роки тому

    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  2 роки тому +1

      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.

  • @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?

  • @GetRealwithMike
    @GetRealwithMike Рік тому

    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  Рік тому

      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.

  • @71Elizabeth_Bergman
    @71Elizabeth_Bergman 3 місяці тому

    Thanks, all I had were 6.8k/3.3k for the divider but it works great.😊

    • @BytesNBits
      @BytesNBits  3 місяці тому

      Great. As long as the ratios are about right. Also look at level shifter ICs. Bit more expensive but a better solution.

  • @CanaleYouTubeGeneralista
    @CanaleYouTubeGeneralista 5 місяців тому

    Hi, I have to make a digital thermometer with an Arduino nano and a sht41 sensor, which display do you recommend ? Which is the easiest display to manage and the most supported as libraries ? I don't need the Touch.

    • @BytesNBits
      @BytesNBits  5 місяців тому +1

      Any of the spi based displays should be fine. Work out what resolution and size you need then check that the driver chip is sorted by the software package.

    • @CanaleYouTubeGeneralista
      @CanaleYouTubeGeneralista 5 місяців тому

      @@BytesNBits Thanks for the explanations, I was thinking of taking the 2.8 TFT SPI display with ST7789V chip, I hope it will be good as a support for the libraries.

  • @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.

  • @RealDevastatia
    @RealDevastatia Рік тому

    You have neat handwriting. :D

  • @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!

  • @srideepaindu818
    @srideepaindu818 Рік тому

    Worked like a Charm :D... Thanks

  • @impossibletechie8059
    @impossibletechie8059 2 роки тому +1

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

    • @BytesNBits
      @BytesNBits  2 роки тому +1

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

    • @impossibletechie8059
      @impossibletechie8059 2 роки тому

      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 2 роки тому

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

  • @tothlaszlo8008
    @tothlaszlo8008 9 місяців тому

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

  • @ayesha7oo2
    @ayesha7oo2 2 роки тому

    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  2 роки тому

      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.

  • @VimmmUk
    @VimmmUk 6 місяців тому

    Very useful content. Thank you!

  • @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!

  • @ezion67
    @ezion67 2 роки тому

    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  2 роки тому

      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 2 роки тому

      @@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.

  • @tiagosilva2196
    @tiagosilva2196 4 роки тому

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

  • @PavolFilek
    @PavolFilek 2 роки тому

    Beautiful explanation.

  • @saydiy1528
    @saydiy1528 Рік тому

    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  Рік тому +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 Рік тому

      @@BytesNBits Thanks.

  • @traflaw8286
    @traflaw8286 9 місяців тому

    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  9 місяців тому

      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.

  • @sudheerillipilli4691
    @sudheerillipilli4691 3 роки тому

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

    • @BytesNBits
      @BytesNBits  3 роки тому

      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.

  • @Bilalahmad7788-x9n
    @Bilalahmad7788-x9n 2 роки тому

    Greatly explained.
    Thank you.

  • @rhythmlalim4018
    @rhythmlalim4018 8 місяців тому

    Hi Bytes, what if we not put a resistors on it? Can it still work and safe to use even if no resistor? tia

    • @BytesNBits
      @BytesNBits  8 місяців тому

      I'd advise against connecting the pins directly as you're feeding 5V into a 3.3V input. The best solution is a bi directional level shifter IC.

  • @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!

  • @freddycrespo4107
    @freddycrespo4107 Рік тому

    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  Рік тому

      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.

  • @mrminister1152
    @mrminister1152 4 місяці тому

    Hello, this video made me curious why my touchscreen doesn't work, and why I am reading only 4079 preasure, x = 17 and y = 0. And I found a problem - the problem is MISO connection. While I connect MISO from display (SDO) and MISO from touchscreen (TDO) touchscreen is not working. I'm connecting it via breadboard and voltage divider. While I disconnect MISO from display touchscreen starts working.

    • @BytesNBits
      @BytesNBits  4 місяці тому +1

      Make sure you've got separate chip select outputs to each device and that you initialise these to the correct states before trying to talk to any devices. I think I cover a bit of that in the video.
      the voltage divider circuit isn;t the best option. If you use bi directional logic level converters it's a much better solution.

    • @mrminister1152
      @mrminister1152 3 місяці тому

      @@BytesNBits Well, that was weird. I changed connections - before i had 2 separate wires directly connected via voltage divider - it didn't work. But when I soldered them together and connected almost the same way, but this time to the source of signal I had one wire, but to the display were connected 2 wires - it started working properly. What a great example of micro-scale capacities and impedances. Or just too much voltage drop in source of signal by connecting MISO to the display via two voltage dividers or whatever.
      Never again haha
      ps. now I'm using proper level shifters.
      Thank You for Your advice after that period of time after uploading video ;)

  • @dienau6313
    @dienau6313 10 місяців тому

    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  10 місяців тому +1

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

    • @dienau6313
      @dienau6313 10 місяців тому

      @@BytesNBits thank you

  • @neilfpv
    @neilfpv Рік тому

    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  Рік тому +1

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

    • @neilfpv
      @neilfpv Рік тому

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

  • @kevinolofson9905
    @kevinolofson9905 16 днів тому +1

    I have that exact piece but mine is just giving a white screen, I followed the video....

    • @BytesNBits
      @BytesNBits  14 днів тому

      Check your wiring and pinouts both on the device and in the code.

    • @paragbharadia2895
      @paragbharadia2895 10 днів тому

      did you found any solution to your problem? i am facing the same! i used 2.2k and 4.7k and 4.7k and 10k for both i am getting white screen only ..!

  • @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 - ua-cam.com/video/Oh9vgomyuOI/v-deo.html. Have fun!

  • @MrBobWareham
    @MrBobWareham Рік тому

    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  Рік тому

      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 Рік тому

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

  • @MADARAUCHIHA-lk3wg
    @MADARAUCHIHA-lk3wg 9 місяців тому

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

    • @BytesNBits
      @BytesNBits  9 місяців тому

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

  • @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.

  • @PneumaticSteel
    @PneumaticSteel Рік тому

    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.

  • @sfs-lyder8560
    @sfs-lyder8560 Рік тому

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

    • @BytesNBits
      @BytesNBits  Рік тому +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.

  • @DrivenDaiIy
    @DrivenDaiIy 6 днів тому

    My code keeps saying compilation error 'digitalwrite' was not declared in this scope I would appreciate any guidance on this matter. It is on the line of code digitalwrite(7, HIGH);
    Update: I got that problem figured out but now all I get is a white screen

    • @BytesNBits
      @BytesNBits  5 днів тому

      Start with the basics. Check your wiring and pins and make sure they match with the pins in the code. Make sure your screen is using the ILI9341 driver chip. Hope you get it working.

    • @DrivenDaiIy
      @DrivenDaiIy 5 днів тому

      @@BytesNBits I just looked and mine is a ST7796U. I am new to coding and am not sure how to go about settings this up

    • @BytesNBits
      @BytesNBits  4 дні тому

      @DrivenDaiIy You'll need to find a driver that supports the ST7796U. The general setup will be the same, just use the new driver in place of my driver.

  • @salustianomoreno1394
    @salustianomoreno1394 4 роки тому

    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  4 роки тому +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 3 роки тому

      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 3 роки тому

      @Musa Enoch instablaster =)

    • @musaenoch2277
      @musaenoch2277 3 роки тому

      @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 3 роки тому

      @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!

  • @philluvschips3787
    @philluvschips3787 Рік тому

    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  Рік тому

      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.

  • @ninjaop5617
    @ninjaop5617 Рік тому

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

    • @BytesNBits
      @BytesNBits  Рік тому

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

    • @ninjaop5617
      @ninjaop5617 Рік тому

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

    • @ninjaop5617
      @ninjaop5617 Рік тому

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

  • @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.

  • @atihrot755
    @atihrot755 2 роки тому

    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  2 роки тому

      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.

  • @kalamabidin922
    @kalamabidin922 Рік тому

    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  Рік тому

      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.

  • @felipefranco8977
    @felipefranco8977 4 місяці тому

    Tenho uma dúvida, meu display LCD diz ser protocolo SPI, entretanto ao invés de
    "MOSI" e "SIMO", eu tenho um único canal bidirecional "SDA", Sei que posso conecta-lo normalmente, entretanto como declaro este canal no meu esp-32 ou arduíno?
    Seria "#define TFT_SDA x"?
    E outra dúvida, eu uso a mesma biblioteca que utilizou no vídeo para SPI? isso me parece I2C

    • @BytesNBits
      @BytesNBits  4 місяці тому

      You'll need to have a look at the lcd data sheet. As you've said SPI usually has 2 data connections. MOSI is from the master to the LCD. MISO is from the LCD to the master. SDA might be the MOSI as sometimes the MISO isn't needed. If it is a bi directional signal it might not be an SPI interface. SDA does match with I2C so it might be using that.

    • @felipefranco8977
      @felipefranco8977 4 місяці тому

      @@BytesNBits isto faz sentido, infelizmente não encontrei o datasheet mesmo navegando bastante, de qualquer forma, sei que ele pode ser I2C, também pode ser SPI, vou considerar que "SDA" seja um "MOSI", vamos ver o que acontece, obrigado pela atenção e ajuda!!! Estou inscrito

  • @taranagnew436
    @taranagnew436 3 роки тому

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

    • @BytesNBits
      @BytesNBits  3 роки тому

      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.

  • @denakkusativ1072
    @denakkusativ1072 2 роки тому

    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  2 роки тому

      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 2 роки тому

      @@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  2 роки тому

      @@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 2 роки тому

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

  • @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.

  • @legosinmotion1231
    @legosinmotion1231 Рік тому

    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  Рік тому

      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 Рік тому

      @@BytesNBits Ok thank you for your response

  • @eldjmasterfreddy4366
    @eldjmasterfreddy4366 Місяць тому

    Great presentation

  • @rizkylevy8154
    @rizkylevy8154 3 роки тому +1

    does this ILI9341 require a resistor?

    • @BytesNBits
      @BytesNBits  3 роки тому

      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.

  • @SUHANISHARMA-mk4sv
    @SUHANISHARMA-mk4sv 2 роки тому

    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  2 роки тому

      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 2 роки тому

      @@BytesNBits I'll try that, thank you

    • @zexanein
      @zexanein Рік тому

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

    • @SUHANISHARMA-mk4sv
      @SUHANISHARMA-mk4sv Рік тому

      @@zexanein 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 Рік тому

      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.

  • @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.

  • @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.

  • @איתיאלאדרי-ר4ד
    @איתיאלאדרי-ר4ד Рік тому

    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  Рік тому

      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.

    • @איתיאלאדרי-ר4ד
      @איתיאלאדרי-ר4ד Рік тому

      @@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

  • @rizkylevy8154
    @rizkylevy8154 3 роки тому +1

    Should with resistor?

    • @BytesNBits
      @BytesNBits  3 роки тому

      Hi, I think I caught your later question first...

  • @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.

  • @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

  • @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 Спасибо !

  • @яемпеченье
    @яемпеченье Рік тому

    Your tutorial is great but my tft screen doesn't work for some reason. My resistors have right resistance and i connected everything correctly. But when i upload the code my screen doesn't show anything and also my TX led doesn't glow, it blinks couple of times and then turns off. Can someone please tell what's the problem might be and how to solve it?

    • @BytesNBits
      @BytesNBits  Рік тому +1

      If you're sure all the wiring is correct check what driver chip your TFT uses. The tutorial shows an ILI9341 powered panel. If you've got a different driver chip you'll need to replace the ILI9341 driver with one for your screen. It should drop in fairly easily but you might need to modify a couple of the references and method calls.

    • @яемпеченье
      @яемпеченье Рік тому

      ​@@BytesNBits Thank you for an answer, but it turned out that my breadboard was defective. I replaced it and everything worked:)

    • @BytesNBits
      @BytesNBits  Рік тому

      @@яемпеченье Great!

  • @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!

  • @sudheerillipilli4691
    @sudheerillipilli4691 3 роки тому

    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  3 роки тому

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

  • @atihrot755
    @atihrot755 2 роки тому

    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  2 роки тому

      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 11 місяців тому

      ​@@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.

  • @irfanarefin1265
    @irfanarefin1265 Рік тому

    can it be used on esp32?

    • @BytesNBits
      @BytesNBits  Рік тому +1

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

    • @irfanarefin1265
      @irfanarefin1265 Рік тому

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