Thanks for your video. I just received my ILI9341 SPI display and implemented your suggestions. The ratings are now 10 to 30 times faster. I use a Wemos Lolin32 lite board and that works. Thanks.
Thanks for posting the video! I've been working on a project that just needs a boost in performance to make a better UI and this has really helped me. 😃
I've been breaking my head trying to get the TFT LCD ST7735 to work on the HSPI. After watching this video imma just stow away the ST7735 LCD and switch to an ILI9341. You give hope to get a LCD screen to work on the HSPI. Much Thanks. ₍˄·͈༝·͈˄₎ฅ
Thank you very much. You have done a great service :-). I did two things wrong. 1, I added some extra parameters to the Adafruit_ILI9341 tft = Adafruit_ILI9341(_cs, _dc, _rst);. I added Mosi and Clock and the screen ran white and slow. After I just left your code alone it ran the same fast speed as yours but still white. 2, Somewhere I read to tie the reset pin on the LCD to 5v ?, so changed it to 3v and now all good. :--) :--) . LuaNode Doit esp32 with BangGood 2.4 ili9341 240X320.
I've found that the pins for hardware SPI are fixed for most boards, but you (e.g. ESP32 is 5-CLK and 23-MOSI), but if you look at the boards.txt file in the Arduino IDE, then you can change the pins around a little. I find it's easier to have all SPI pins grouped together on a dev-board, so the cabling is easier/neater.
Excellent video! I was wondering if there was a chance that the SSD1289 could be covered in the same fashion? I've been struggling with it for a while. I also watched your hardware SPI and other videos, all of which are great! Keep making videos. This is an amazing resource.
Well there’s no doubt the majority of SSD1289 displays have an SPI interface and there are drivers around for the Arduino IDE and so it should not be that difficult to get one working, I don’t have a display to try so can’t help at the moment. I self fund all of my videos and devices so I have to work within what I need and have at my disposal. If you need help I’ll gladly provide that. Have you tried connecting the display up as per an SPI bus including DC connections, etc.
Yes if you buy the correct display, some don't have the touch device fitted, but if they do they usually share the SPI bus connections and require one extra connection for Touch-CS (chip select). There is much discussion on the Squix forum (he uses the touch sensor) about the device XPT2046 as some don't work, the question is, are the displays sold cheap because they are faulty or is the chip a fake or is the chip different, no-one is really sure. The one I have works OK. You can get a touch event (someone touched the screen) and then get coordinates of the touch which is then easily matched to some virtual grid to determine what the touch request is - a button press for example. Hope this helps.
I cant get the xpt2046 to work worth a damn. gonna try it full seperate connection before i make any conclusions. when I recived the screen i swapped out the dupont header for jst xh and jummpered the Din Dout over to MOSI and MISO..same with clk. i used like a 4pin but only populated 2 to bring down the alert and cs for the touch. I've been able to see screen pressure readings and last night I was getting reports of possition untill i touched it then it read 0,0 but obviously this is total shit and im geting sick of wasting time.
Fake chip suspected on your board, or at best out of specifications. It’s prevalent, maybe the manufacturer sells boards that don’t pass QC and these are then sold to us by unscrupulous suppliers.
ive got another display where i slipped while soldering on the floor (had 3 work benches 12 months ago... long story) I also have some chipquick low melt (not required but nice) I think ill swap and see if that one does any better before exploring other routes.
I just swapped dead display 1s touch chip on to display 2 and now between some random(will look it up in a bit)library for touch and ada's display library i have both working! good call on bad chip!
I just ran your example files and got very comparable results, except for the "Lines" test (Lines 221590 in stead of ~20000). Do you have any idea why this could be? ILI9341 Test! Display Power Mode: 0x0 MADCTL Mode: 0x0 Pixel Format: 0x0 Image Format: 0x0 Self Diagnostic: 0x0 Benchmark Time (microseconds) Screen fill 195239 Text 23588 Lines 221590 Horiz/Vert Lines 17353 Rectangles (outline) 11309 Rectangles (filled) 405569 Circles (filled) 69598 Circles (outline) 97600 Triangles (outline) 48862 Triangles (filled) 148905 Rounded rects (outline) 36590 Rounded rects (filled) 410276 Done!
Thanks for the quick reply. There are indeed changes to the lineDrawing function. I could not pinpoint a version that has the better results though. No Problem.
maarten vermeij, it’s been updated so many times it would take a while to go through the github changes, but it will show the changes. Ideally a change log would be maintained, but alas not.
Hey G6EJD, I tried your code on my stm32 board (NODE-L476RG), the software spi code seemed to run at a comprable speed to your ESP32 however, the hardware spi code ran much slower (slower than the software SPI). Do you know why this is? Any reply would be really appreciated.
This will all be a function of the compiler and how it implements the SPI bus. For example if you specify an SPI bus on general purpose GPIO pins none of which have an SPI secondary function then the compiler has to create a software based SPI bus, but if you just happened to have chosen pins that can also support hardware SPI; you need to examine the layout of your board to check what pins are made available, where and for that board the device supports 3 standard and 1 quad SPI buses. Without inspecting the compiler choices made to confirm, the effect your seeing is a function of the compiler and the pins you’ve chosen.
This is genius! What a difference! How did you figure it out? Also, if I need to use software implementation on another connected device how to do it? SPI.begin only accepts three parameters, which seems to then conflict with the Adafruit_ILI9341 function. Thanks again for this, and your many other excellent videos.
All SPI devices with the exception of an individual Chip Select line share the same bus, so wire them all in parallel. The CS separates and control individual devices. Using the software implementation allows any pins to be used but slows down the bus speed as the software has to manage the protocol rather than hardware. But in general you can always use the hardware assignment of pins leaving just the CS to be assigned by SPI.begin.
@@G6EJD Thanks Dave. My current project involves both an ILI9341 and a RC522. The MFRC522 library I'm using only accepts the CS and RST pins as parameters for init while the Adafruit ILI9341 library (as I now know thanks to you) offers the flexibility for both hardware and software SPI configurations. Are you saying I can simply connect the MOSI, MISO, SCK for both devices to pins 23, 19, 18 on the typical ESP32 board? I'm using one with the ESP-WROOM-32. Thanks again for all that you do.
KP Smart, if you put the ili9341 display to one side, the Arduino IDE allows the SPI bus to be simulated in software and use pins defined in the code, to use the hardware SPI you must use the pins defined for the board that are in turn connected to the ESP32 hardware SPI pins. So to use a hardware SPI bus yes you must connect all your SPI devices in parallel and then tell the compiler and libraries which pins will be the CS and Reset, etc, this is why all device libraries assume MOSI, MISO and CLK will be as defined for the chip. So you need a CS for the display and CS for the other device, it’s possible you could share the Reset pin with both devices if they don’t mind being reset multiple times, so the first device.begin will reset the display and other device then the next device.begin will reset them both again. If you have the spare pins then use them and have separation. DC can be shared but BUSY will need a separate pin per device. For the ili9341 Vcc-Vcc Gnd-Gnd MOSI-MOSI MISO-no connection CLK-CLK GPIOpin-CS1 GOIOpin-BUSY1 GPIOpin-DC GPIOpin-RESET1 Next device: MOSI-MOSI MISO-MISO if device supplies data CLK-CLK GPIOpin-CS2 GPIOpin-BUSY2 GPIOpin-DC GPIOpin-RESET2 So you need 6 spare GPIO pins for 2 devices common MOSI, MISO, CLK and DC, then individual CS, BUSY and RESET pins.You can double up on RESET and BUSY if there is no library interaction and both devices will never be used at the same time or subject to reset commands other for example your display would be reset during a maybe routine reset of the other device. Hope this helps.
@@G6EJD A thousand thanks David! I needed the display to respond quickly to the card read and it does. You deserve a Nobel Prize of some sort with all the education and assistance you provide for others. The extra attention you give to promoting understanding for your viewers sets you apart. Much thanks again!
There are many so-called fake touch sensors on these screens, some work some don't, it depends on the supplier. There are many forum discussions about this topic see here: blog.squix.org/2017/07/esp8266-weatherstation-update-using-touch-interface.html they may have solved the problem for you.
thanks man... i works now but the upper/lower part of the Screen from the smaller site does not refresh while the test is running lookks like its Glitching do you know why? or is my display rigged? Thanks in advance
@@145. the ili9341 display driver is a widely used chip and I’ve never heard of such an issue, so I can only conclude your display is faulty. There are many that are or were sold that were clearly out of specification and so low cost and very many had no working touch chip or touch panel fitted. Only a reputable supply can ensure success.
Damn bro.. I got it... 2 weeks later just to find out that i used a wrong pin on the esp... Oh men i cant tell how dumb it was👍🏼😂 But now everything works... Anyway thanks a lot and have a nice day/evening@@G6EJD
Hi G6EJD, Thanks for the video! Very helpful as a beginner in electronics. I was wondering if there was any way you would be willing to provide some tips on a project I'm currently working on? Looking forward to hearing from you! Best, Jake
Hey G6EJD, at the end [3:43] you mentioned that LOLIN's esp32 board does not support HSPI. Can you please elaborate on this. I am interested in buying an esp32 and running it with ili9341 screen. It would be helpful to know more about this. Thanks
The ESP32 device has 4 SPI ports, 2 are used internally so-to-speak leaving the ports HSPI and VSPI. What I meant was the HSPI port has not been brought out to pins, so you only have VSPI which will drive the ILI9341 without any problems. The LOLIN32 board is about the best you can get IMO.
They also came up with a Lite version of their board [ wiki.wemos.cc/products:lolin32:lolin32_lite ] . Any opinions on that ? I assume its V1 and the better silicon one.
Yes I have some of those boards (Lite), the UART Is slower (CH340) and power consumption a little less when USB powered, programming speed is limited to 256000buad, non-Lite 962100. Power consumption in sleep is higher than the regular LOLIN32 board, so overall not as good as the standard LOLIN32 IMO. Yes silicon is Rev.1 but then most are now. It makes very little difference, yes the boot process uses less current, but that's all I've ever seen as a difference.
Great video man, everything i was looking for! So I bought 3 of these smaller ESP32 boards about which you said the HSPI pins are not brought out for use. Do you think i could just solder some tiny wires to the package and attach them to a second row of headers? might be a bit fiddly but I have good tools at work! and if i break my board i can still buy a new one :P just seems like a waste not to bring out more than half of the pins. I was thinking of attaching a header to both sides, bringing out GPIO 25, 26, 27, 32, 33, 34 and 35 on one side and GPIO 16, 17, 18, 19, 22 and 23 on the other side! But when looking at your SPI -> GPIO pin assignment overview, I see that HSPI uses GPIO2, 4, 12, 13, 14 and 15.... and the board I have has GPIO 0, 2, 4, 5, 12, 13, 14 and 15 brought out so it should work? Any thoughts on that? :)
This is the board that I have: ae01.alicdn.com/kf/HTB1BC5DQFXXXXaFXVXXq6xXFXXXj/ESP32-Rev1-ESP-32-WiFi-Modules-Bluetooth-Dual-ESP-32-ESP-32S-ESP8266.jpg_640x640.jpg And this is the Datasheet for the ESP32 on that board. www.espressif.com/sites/default/files/documentation/esp-wroom-32_datasheet_en.pdf
I don't know what means hardware SPI and software SPI. ESP32 has 3x hardware SPI available the only thing that matters is the pins you connect to. With native(dedicated) pins it runs blasting fast whether on other pins it is a bit slower but not that much - slower because it needs some delay for proper timings however there is already a work around that fixes that in latest idf.
Agreed, but the compiler will emulate the SPI bus if you choose other GPIO ports that don’t have an SPI device internally connectable via the pins multiplexer do you can do both, hardware internal SPI bus controllers and software via an emulation using nearly any gpio pins.
This is not what the technical reference says and it is not true. If you choose other GPIO pins you still have hardware SPI but with slightly reduced speed - maybe 10% I tested it myself. Maybe Arduino is running some procedure based on manual bit/io manipulation with CPU instructions which is just very bad and slow. That's why you should't use Arduino when it comes to projects that need performance
Hi, nearly all of the TFT displays require a 5v supply (Vcc) but the LED source/Backlight needs to be driven by a 3v3 source and ideally through a 100-120R resistor to limit current. You can PWM an output pin and connect that to the LED pin and then the average current is well within the ESP8266 output sourcing capability. Some displays need level shifters some not, I look for the ones that say 5/3v3 as they have in-built level shifters otherwise they won't work.
Thanks for this. I'm developing a system using the ESP32-Wroom-32. The peripherals of my system are x1 ADC chip (which uses SPI) and x1 microSD card (SPI or SDIO). My understanding is that the board has x3 SPIs I can use (SPI, HSPI, VSPI). However, the HSPI pins (IO12-15) are used for the JTAG debugger, which I need. I will connect my ADC chip to VSPI, that should be fine. Finally, I need to connect the microSD card to either SPI or SDIO. Can I use the SPI port, or is that used internally for flash memory? The datasheet is not very intuitive and I can't figure out if I can use those pins (named: CLK, SDO, SDI, CMD), or if they are already used for on board flash or something? Thanks for your help.
Mark, you connect your SPI devices to the same buss and use different CS pins for each device. Another SPI bus is used for the flash memory. Not all IDE’s enable access to the 3 SPI buses, Arduino does not enable this for example.
BTW the SD card library doesn’t work yet AFAIK due to hardware issues. I last tried it about 2-weeks ago. Loading issues on the bus. Either that or make sure you use a buffered SD card reader-writer, not many around.
It depends on the Compiler and how it’s setup to configure SPI that’s not using the hardwired SPI pins. In the case of the Arduino IDE it may switch to a software SPI emulation. The device itself can accept any pins for the hardware SPI bus via its GPIO multiplexer.
I must be doing something wrong here, software spi works fine but after changing the file definitions to hardware spi: static const uint8_t SS = 15; static const uint8_t MOSI = 13; static const uint8_t MISO = 12; static const uint8_t SCK = 14; and using this code: #define TFT_DC 16 #define TFT_CS 17 #define TFT_RST 5 // Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST); It Doesn' t work at all! What am i missing?
It depends on which board/device your using and I’m assuming your using the Arduino IDE. When you choose to use hardware SPI the pins are defined for you take a look in the Arduino IDE folder there’s a hardware folder (from memory this) and then Espressif, then boards then choose the board your using then open that folder and you will find a pins file that the compiler uses to assign SPI pins, those are the pins you have to use, as your definitions are ignored in the code because the hardware is already assigned to the pins usually 18, 23 and 5 the rest can be assigned. In my video I show how to find the pins assigned by serial.println(MOSI) and the same for MISO and SS and SCK those are the only pins that are fixed.[Edited to remove iPad quaint spelling corrections]
Check out the file in the Arduino IDE folder e.g. : ArduinoIDE\hardware\espresssif\esp32\variants\lolin32 You will see the boards listed if you go up one level from my example above. Serial.println(MOSI), etc is just as easy really to find out the pin numbers. Connect your display accordingly to these pins.
Estoy impactado casi me cago encima entonces puedo hacer 14 veces más fluido mi sistemas tengo que rediseñar todo mi ecosistema, siempre pence que la diferencia era minima
Hobi Kanalı, that display type is a parallel input not SPI so not useable/applicable in this context. There is an Arduino 7781 library and that might give connection details, but you will need lots of spare GPIO pins to get it working.
Jie Lei Have you determined what P.O. S are used for the SPI bus you can try a short programme to find out like this: Serial.println(MOSI); Serial.println(SS); Serial.println(SCK);
Thanks for your video. I just received my ILI9341 SPI display and implemented your suggestions. The ratings are now 10 to 30 times faster. I use a Wemos Lolin32 lite board and that works. Thanks.
Dear G6EJD, you cannot imagine how much you've helped me. I'm kinda new to rapid prototying so... thank you so much! Lookin' forward to your videos.
Jakob, I’m am very pleased that I have been able to help you, that is what I’m trying to do with the videos.
Thanks for posting the video! I've been working on a project that just needs a boost in performance to make a better UI and this has really helped me. 😃
Thanks a lot for this video. What a nice performance improvement ! Greetings from Germany
Thank you. This video helped me to solve the issue of display fast graphics for the ground station controller for HAM satellite QO-100. 73!
very cool, I didn't even know about this and all I did was change my constructor to the hardware spi one and now my screen is so much faster!
fastslash25 m, yes the IDE implements a so-called ‘bit-banged’ SPI bus when no hardware SPI pins are used.
I've been breaking my head trying to get the TFT LCD ST7735 to work on the HSPI.
After watching this video imma just stow away the ST7735 LCD and switch to an ILI9341.
You give hope to get a LCD screen to work on the HSPI.
Much Thanks. ₍˄·͈༝·͈˄₎ฅ
You are a wonder of knowledge thanks for the video
It works. Thank you. Its so much faster. Its the speed i had on the stm32f103 with hSPI. Now its time to switch over to ESP :-)
danke danke danke you helped a lot ! rudi from österreich
Thank you very much. You have done a great service :-). I did two things wrong. 1, I added some extra parameters to the Adafruit_ILI9341 tft = Adafruit_ILI9341(_cs, _dc, _rst);. I added Mosi and Clock and the screen ran white and slow. After I just left your code alone it ran the same fast speed as yours but still white. 2, Somewhere I read to tie the reset pin on the LCD to 5v ?, so changed it to 3v and now all good. :--) :--) . LuaNode Doit esp32 with BangGood 2.4 ili9341 240X320.
Good to hear. The ili9341 is a 3.3v device, so putting 5v on the reset would have likely caused errant behaviours.
Best explanations, thorough work. Thank you
Thanks. This showed exactly what I was looking for.
I've found that the pins for hardware SPI are fixed for most boards, but you (e.g. ESP32 is 5-CLK and 23-MOSI), but if you look at the boards.txt file in the Arduino IDE, then you can change the pins around a little. I find it's easier to have all SPI pins grouped together on a dev-board, so the cabling is easier/neater.
G6EJD thanks, I'll get that straightened out when the time comes.
Thank you for your video!
Thank you for your help
Thanks.... great video !!
Good explanation, this helped me a lot. Thanks!
hi ypu have a video showing how to use the touchscreen with this feature?, thanks
Excellent video!
I was wondering if there was a chance that the SSD1289 could be covered in the same fashion?
I've been struggling with it for a while. I also watched your hardware SPI and other videos, all of which are great!
Keep making videos.
This is an amazing resource.
Well there’s no doubt the majority of SSD1289 displays have an SPI interface and there are drivers around for the Arduino IDE and so it should not be that difficult to get one working, I don’t have a display to try so can’t help at the moment. I self fund all of my videos and devices so I have to work within what I need and have at my disposal. If you need help I’ll gladly provide that. Have you tried connecting the display up as per an SPI bus including DC connections, etc.
Yes if you buy the correct display, some don't have the touch device fitted, but if they do they usually share the SPI bus connections and require one extra connection for Touch-CS (chip select). There is much discussion on the Squix forum (he uses the touch sensor) about the device XPT2046 as some don't work, the question is, are the displays sold cheap because they are faulty or is the chip a fake or is the chip different, no-one is really sure. The one I have works OK. You can get a touch event (someone touched the screen) and then get coordinates of the touch which is then easily matched to some virtual grid to determine what the touch request is - a button press for example. Hope this helps.
I cant get the xpt2046 to work worth a damn. gonna try it full seperate connection before i make any conclusions. when I recived the screen i swapped out the dupont header for jst xh and jummpered the Din Dout over to MOSI and MISO..same with clk. i used like a 4pin but only populated 2 to bring down the alert and cs for the touch. I've been able to see screen pressure readings and last night I was getting reports of possition untill i touched it then it read 0,0 but obviously this is total shit and im geting sick of wasting time.
Fake chip suspected on your board, or at best out of specifications. It’s prevalent, maybe the manufacturer sells boards that don’t pass QC and these are then sold to us by unscrupulous suppliers.
ive got another display where i slipped while soldering on the floor (had 3 work benches 12 months ago... long story) I also have some chipquick low melt (not required but nice) I think ill swap and see if that one does any better before exploring other routes.
I just swapped dead display 1s touch chip on to display 2 and now between some random(will look it up in a bit)library for touch and ada's display library i have both working! good call on bad chip!
Good to hear everything is operating as expected.
I just ran your example files and got very comparable results, except for the "Lines" test (Lines 221590 in stead of ~20000). Do you have any idea why this could be?
ILI9341 Test!
Display Power Mode: 0x0
MADCTL Mode: 0x0
Pixel Format: 0x0
Image Format: 0x0
Self Diagnostic: 0x0
Benchmark Time (microseconds)
Screen fill 195239
Text 23588
Lines 221590
Horiz/Vert Lines 17353
Rectangles (outline) 11309
Rectangles (filled) 405569
Circles (filled) 69598
Circles (outline) 97600
Triangles (outline) 48862
Triangles (filled) 148905
Rounded rects (outline) 36590
Rounded rects (filled) 410276
Done!
If your using the Adafruit driver than they have changed the line drawing function, you could go back a few versions to see what’s different
Thanks for the quick reply. There are indeed changes to the lineDrawing function. I could not pinpoint a version that has the better results though. No Problem.
maarten vermeij, it’s been updated so many times it would take a while to go through the github changes, but it will show the changes. Ideally a change log would be maintained, but alas not.
Hey G6EJD,
I tried your code on my stm32 board (NODE-L476RG), the software spi code seemed to run at a comprable speed to your ESP32 however, the hardware spi code ran much slower (slower than the software SPI). Do you know why this is?
Any reply would be really appreciated.
This will all be a function of the compiler and how it implements the SPI bus. For example if you specify an SPI bus on general purpose GPIO pins none of which have an SPI secondary function then the compiler has to create a software based SPI bus, but if you just happened to have chosen pins that can also support hardware SPI; you need to examine the layout of your board to check what pins are made available, where and for that board the device supports 3 standard and 1 quad SPI buses. Without inspecting the compiler choices made to confirm, the effect your seeing is a function of the compiler and the pins you’ve chosen.
Is it touch compatible ?
Thank you.
Marc.
This is genius! What a difference! How did you figure it out?
Also, if I need to use software implementation on another connected device how to do it? SPI.begin only accepts three parameters, which seems to then conflict with the Adafruit_ILI9341 function.
Thanks again for this, and your many other excellent videos.
All SPI devices with the exception of an individual Chip Select line share the same bus, so wire them all in parallel. The CS separates and control individual devices. Using the software implementation allows any pins to be used but slows down the bus speed as the software has to manage the protocol rather than hardware. But in general you can always use the hardware assignment of pins leaving just the CS to be assigned by SPI.begin.
@@G6EJD Thanks Dave. My current project involves both an ILI9341 and a RC522. The MFRC522 library I'm using only accepts the CS and RST pins as parameters for init while the Adafruit ILI9341 library (as I now know thanks to you) offers the flexibility for both hardware and software SPI configurations. Are you saying I can simply connect the MOSI, MISO, SCK for both devices to pins 23, 19, 18 on the typical ESP32 board? I'm using one with the ESP-WROOM-32. Thanks again for all that you do.
KP Smart, if you put the ili9341 display to one side, the Arduino IDE allows the SPI bus to be simulated in software and use pins defined in the code, to use the hardware SPI you must use the pins defined for the board that are in turn connected to the ESP32 hardware SPI pins. So to use a hardware SPI bus yes you must connect all your SPI devices in parallel and then tell the compiler and libraries which pins will be the CS and Reset, etc, this is why all device libraries assume MOSI, MISO and CLK will be as defined for the chip. So you need a CS for the display and CS for the other device, it’s possible you could share the Reset pin with both devices if they don’t mind being reset multiple times, so the first device.begin will reset the display and other device then the next device.begin will reset them both again. If you have the spare pins then use them and have separation. DC can be shared but BUSY will need a separate pin per device.
For the ili9341
Vcc-Vcc
Gnd-Gnd
MOSI-MOSI
MISO-no connection
CLK-CLK
GPIOpin-CS1
GOIOpin-BUSY1
GPIOpin-DC
GPIOpin-RESET1
Next device:
MOSI-MOSI
MISO-MISO if device supplies data
CLK-CLK
GPIOpin-CS2
GPIOpin-BUSY2
GPIOpin-DC
GPIOpin-RESET2
So you need 6 spare GPIO pins for 2 devices common MOSI, MISO, CLK and DC, then individual CS, BUSY and RESET pins.You can double up on RESET and BUSY if there is no library interaction and both devices will never be used at the same time or subject to reset commands other for example your display would be reset during a maybe routine reset of the other device. Hope this helps.
@@G6EJD A thousand thanks David! I needed the display to respond quickly to the card read and it does. You deserve a Nobel Prize of some sort with all the education and assistance you provide for others. The extra attention you give to promoting understanding for your viewers sets you apart. Much thanks again!
Great guide! Any chance you can do a new video on how to get the touch to work? thanks!
There are many so-called fake touch sensors on these screens, some work some don't, it depends on the supplier. There are many forum discussions about this topic see here: blog.squix.org/2017/07/esp8266-weatherstation-update-using-touch-interface.html they may have solved the problem for you.
Is this kind of SPI port is available in the STM32 as well.?
Yes
thanks man... i works now but the upper/lower part of the Screen from the smaller site does not refresh while the test is running
lookks like its Glitching
do you know why? or is my display rigged? Thanks in advance
@@145. the ili9341 display driver is a widely used chip and I’ve never heard of such an issue, so I can only conclude your display is faulty. There are many that are or were sold that were clearly out of specification and so low cost and very many had no working touch chip or touch panel fitted. Only a reputable supply can ensure success.
Okay Thanks a lot.. maybe i just have some bad lucky on these... i will try anything to get them running but i dont want waste ALL my time 🫤@@G6EJD
Damn bro.. I got it... 2 weeks later just to find out that i used a wrong pin on the esp... Oh men i cant tell how dumb it was👍🏼😂 But now everything works... Anyway thanks a lot and have a nice day/evening@@G6EJD
Hi G6EJD,
Thanks for the video! Very helpful as a beginner in electronics. I was wondering if there was any way you would be willing to provide some tips on a project I'm currently working on?
Looking forward to hearing from you!
Best,
Jake
Hi Jake, yes of course I’d be glad to help, let me know what your project is and what things your aiming to achieve, regards Dave
Awesome! Thanks so much. Would you mind switching to a forum for us to discuss privately such as facebook or email?
Please go to my website and the contact me link and that will establish an email link.
Just submitted the form on your site. Looking forward to chatting more!
@t
@t
ESP32 and LCD module TFT 2.4 inch TFT LCD screen I want to make weather with two cards How do I do this?
Hey G6EJD, at the end [3:43] you mentioned that LOLIN's esp32 board does not support HSPI. Can you please elaborate on this. I am interested in buying an esp32 and running it with ili9341 screen. It would be helpful to know more about this. Thanks
The ESP32 device has 4 SPI ports, 2 are used internally so-to-speak leaving the ports HSPI and VSPI. What I meant was the HSPI port has not been brought out to pins, so you only have VSPI which will drive the ILI9341 without any problems. The LOLIN32 board is about the best you can get IMO.
They also came up with a Lite version of their board [ wiki.wemos.cc/products:lolin32:lolin32_lite ] . Any opinions on that ? I assume its V1 and the better silicon one.
Yes I have some of those boards (Lite), the UART Is slower (CH340) and power consumption a little less when USB powered, programming speed is limited to 256000buad, non-Lite 962100. Power consumption in sleep is higher than the regular LOLIN32 board, so overall not as good as the standard LOLIN32 IMO. Yes silicon is Rev.1 but then most are now. It makes very little difference, yes the boot process uses less current, but that's all I've ever seen as a difference.
Great video man, everything i was looking for! So I bought 3 of these smaller ESP32 boards about which you said the HSPI pins are not brought out for use. Do you think i could just solder some tiny wires to the package and attach them to a second row of headers? might be a bit fiddly but I have good tools at work! and if i break my board i can still buy a new one :P just seems like a waste not to bring out more than half of the pins. I was thinking of attaching a header to both sides, bringing out GPIO 25, 26, 27, 32, 33, 34 and 35 on one side and GPIO 16, 17, 18, 19, 22 and 23 on the other side! But when looking at your SPI -> GPIO pin assignment overview, I see that HSPI uses GPIO2, 4, 12, 13, 14 and 15.... and the board I have has GPIO 0, 2, 4, 5, 12, 13, 14 and 15 brought out so it should work? Any thoughts on that? :)
This is the board that I have:
ae01.alicdn.com/kf/HTB1BC5DQFXXXXaFXVXXq6xXFXXXj/ESP32-Rev1-ESP-32-WiFi-Modules-Bluetooth-Dual-ESP-32-ESP-32S-ESP8266.jpg_640x640.jpg
And this is the Datasheet for the ESP32 on that board.
www.espressif.com/sites/default/files/documentation/esp-wroom-32_datasheet_en.pdf
I don't know what means hardware SPI and software SPI. ESP32 has 3x hardware SPI available the only thing that matters is the pins you connect to.
With native(dedicated) pins it runs blasting fast whether on other pins it is a bit slower but not that much - slower because it needs some delay for proper timings however there is already a work around that fixes that in latest idf.
Agreed, but the compiler will emulate the SPI bus if you choose other GPIO ports that don’t have an SPI device internally connectable via the pins multiplexer do you can do both, hardware internal SPI bus controllers and software via an emulation using nearly any gpio pins.
This is not what the technical reference says and it is not true. If you choose other GPIO pins you still have hardware SPI but with slightly reduced speed - maybe 10%
I tested it myself. Maybe Arduino is running some procedure based on manual bit/io manipulation with CPU instructions which is just very bad and slow.
That's why you should't use Arduino when it comes to projects that need performance
Should TFT VCC be connected to 3.3V and not 5V ? Is it safe to run TFT with 5V signal together with ESP32 that is using 3.3V ?
Hi, nearly all of the TFT displays require a 5v supply (Vcc) but the LED source/Backlight needs to be driven by a 3v3 source and ideally through a 100-120R resistor to limit current. You can PWM an output pin and connect that to the LED pin and then the average current is well within the ESP8266 output sourcing capability. Some displays need level shifters some not, I look for the ones that say 5/3v3 as they have in-built level shifters otherwise they won't work.
Thanks for this.
I'm developing a system using the ESP32-Wroom-32.
The peripherals of my system are x1 ADC chip (which uses SPI) and x1 microSD card (SPI or SDIO).
My understanding is that the board has x3 SPIs I can use (SPI, HSPI, VSPI).
However, the HSPI pins (IO12-15) are used for the JTAG debugger, which I need.
I will connect my ADC chip to VSPI, that should be fine.
Finally, I need to connect the microSD card to either SPI or SDIO.
Can I use the SPI port, or is that used internally for flash memory?
The datasheet is not very intuitive and I can't figure out if I can use those pins (named: CLK, SDO, SDI, CMD), or if they are already used for on board flash or something?
Thanks for your help.
Mark, you connect your SPI devices to the same buss and use different CS pins for each device. Another SPI bus is used for the flash memory. Not all IDE’s enable access to the 3 SPI buses, Arduino does not enable this for example.
BTW the SD card library doesn’t work yet AFAIK due to hardware issues. I last tried it about 2-weeks ago. Loading issues on the bus. Either that or make sure you use a buffered SD card reader-writer, not many around.
Thanks man.
thank you
I'm using ESP32-WROVER. Do I have to use GPIO18 for SCLK and GPIO23 for MOSI?
No you can reassign them to any pin numbered less than 32 see SPI.begin( statement
@@G6EJD Is that for hardware SPI?
It depends on the Compiler and how it’s setup to configure SPI that’s not using the hardwired SPI pins. In the case of the Arduino IDE it may switch to a software SPI emulation. The device itself can accept any pins for the hardware SPI bus via its GPIO multiplexer.
nice
I must be doing something wrong here, software spi works fine but after changing the file definitions to hardware spi:
static const uint8_t SS = 15;
static const uint8_t MOSI = 13;
static const uint8_t MISO = 12;
static const uint8_t SCK = 14;
and using this code:
#define TFT_DC 16
#define TFT_CS 17
#define TFT_RST 5
// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
It Doesn' t work at all! What am i missing?
It depends on which board/device your using and I’m assuming your using the Arduino IDE. When you choose to use hardware SPI the pins are defined for you take a look in the Arduino IDE folder there’s a hardware folder (from memory this) and then Espressif, then boards then choose the board your using then open that folder and you will find a pins file that the compiler uses to assign SPI pins, those are the pins you have to use, as your definitions are ignored in the code because the hardware is already assigned to the pins usually 18, 23 and 5 the rest can be assigned. In my video I show how to find the pins assigned by serial.println(MOSI) and the same for MISO and SS and SCK those are the only pins that are fixed.[Edited to remove iPad quaint spelling corrections]
Check out the file in the Arduino IDE folder e.g. : ArduinoIDE\hardware\espresssif\esp32\variants\lolin32
You will see the boards listed if you go up one level from my example above. Serial.println(MOSI), etc is just as easy really to find out the pin numbers. Connect your display accordingly to these pins.
Tech Note 064 might help too.
OK thanks so much its working now
Have drawing pictures by spi on this display?
Yes there is a library function that will draw bmp images
thanks,
how do i know if its ILI9341?
tradecycles, you have to rely solely on the sellers description as the boards are not usually marked with the display driver type.
I'm running my TFT at 80mhz. Confirmed with a 200mhz scope.
Estoy impactado casi me cago encima entonces puedo hacer 14 veces más fluido mi sistemas tengo que rediseñar todo mi ecosistema, siempre pence que la diferencia era minima
esp32 & st7781 2.4 inc tft lcd What are pin equivalents?
Hobi Kanalı, that display type is a parallel input not SPI so not useable/applicable in this context. There is an Arduino 7781 library and that might give connection details, but you will need lots of spare GPIO pins to get it working.
@@G6EJD I would like to make weather if you tell me how to do
You can’t with that sort of display, it’s too complicated, you need an ili9341 type. Then most examples will work.
@@G6EJD prnt.sc/nx2357
prnt.sc/nx232u
@@G6EJD thank you then got it in vain
The software SPI on ESP32 is so speed as HW SPI on Arduino... :-)
Daniel Gago, yes the advantage of a much faster CPU combined with dedicated SPI hardware
it seems that nodemcu 32s also does not support hardware SPI I guess. It dosent work on my chip. Anyone who has the same issue?
Jie Lei Have you determined what P.O. S are used for the SPI bus you can try a short programme to find out like this:
Serial.println(MOSI);
Serial.println(SS);
Serial.println(SCK);
docs.zerynth.com/latest/official/board.zerynth.nodemcu_esp32/docs/index.html
It definitely supports hardware SPI you just need to find the pins or look in the ide to find the hardware pins file I did a video on this.