Giter Club home page Giter Club logo

Comments (17)

G6EJD avatar G6EJD commented on June 14, 2024 1

When I get time I’ll test out a display with an SD card to see if I can replicate the problem. I am aware that the squix colour weather station has been ported to an ESP32 so that suggests all is OK.

It could be you have found a generic issue with the ESP32 core, so why not raise this as an issue against that because you have tried many things to resolve it.

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024 1

I should be able to try this combination out tomorrow and will let you know the outcome.

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024 1

Found a solution switching to hardware SPI solves the problem:

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
SD_CS = 4

So using
23 - MOSI
19 - MISO
18 - CLK
5 - CS/SS
4 - SD_CS

So no library issues - if the hardware SPI is used!

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024

Are you using the software or hardware implementation of the SPI bus? There is no specific switch to change over but by defining the display object accordingly.

Have you tried dynamically changing the spi bus speed when your using the SD card? You can slow it down then speed it up again, if that function works.

What’s confusing me is the ESP32 bus speed is AFAIK set to 10Mbit as a compromise for a range os spi devices, so which IDE are you using.

If you believe there is a code issue it’s with the ESP core for the Arduino IDE.

from esp32-and-how-to-use-ili9341-tft-display.

RetroDISTORT avatar RetroDISTORT commented on June 14, 2024

I attempted both software and hardware SPI
I'm using Arduino IDE 1.8.5 (windows store 1.8.10.0)

The only reason I switched the speeds was because in another thread some suggested that changing SPI speeds after initialization of the display might cause the display to stop working.

Both display library and SD library work fine my themselves. When trying to use both, the display turns white, like a reset. ( rst is connected directly to 3.3v)

I also tried giving independent Miso and Mosi pins. SD card use pins 19, 18 and 22. ili9341 use pins 20, 18 and 21. (Same clock line '18') As before, everything worked fine until any SD function was called after initialization of the display.

I have not tried dynamic change on the SPI speed. Could you please provide a code so I can try it.

I'm pulling my hair out at this point 😥

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024

I would set the SPI bus speed to about 10Mb then check if the SD card reader will function and assume the display will be OK at that speed, they tend to work faster, then they should both be working. But, are you running long cables to the display and SD, if so don't underestimate the effect of propagation errors due to a lack of screening and reflections. You may need pull-up resistors for example.

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024

Other things to consider are that the SPI bus is synchronous and so connected devices cannot detect that the bus speed has changed, data is clocked (by the CLK) on rising or falling edges depending on the mode selected. I also observe there are few if any applications that require the maximum of display refresh that running at 40MBit would enable, so does your bus really need to be going that fast? Life and electronic design is a compromise as not all SPI devices can go quick.

from esp32-and-how-to-use-ili9341-tft-display.

RetroDISTORT avatar RetroDISTORT commented on June 14, 2024

I'm running everything with default values on their respective libraries.
I tried adding pull up and then pull down resistors to the wires... did not work
I'll just try to use SDfat or an alternate SD card library :(
I'll report my results.
Thanks for your fast replies!

from esp32-and-how-to-use-ili9341-tft-display.

RetroDISTORT avatar RetroDISTORT commented on June 14, 2024

I found something very interesting!!!
So after I executed the SD card, I reset the device. Oddly, the display did not reset immediately. for a few milliseconds I could see the message that was supposed to be shown after the SD card execution!
This begs the question, Is there any refresh screen function?
If so, I could probably refresh the screen after using the SD card!

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024

Which display driver are you using?

The SQUIX driver is unusual as it exhibits no display flicker, I'm not sure how he's doing that, perhaps writing directly to the display RAM. The Adafruit variant sends commands and data to the display driver IC.

from esp32-and-how-to-use-ili9341-tft-display.

RetroDISTORT avatar RetroDISTORT commented on June 14, 2024

It's pretty weird... I'm not sure how this library works specifically....
The spi chip on the display (XPT2046 - for touch feedback) works perfectly while the display stays blank... And the SD card keeps running.
One thing I noticed, when I added Haptic feedback (vibration motor) the display would turn blank too!
Probably the excessive amount of current consumed by the motor may have caused the screen to blank. (Exactly as when using the SD card)
I then used a different power supply (lipo 2500 mAH battery). I did the test again and it worked! I could now use a haptic motor and the display. Afterwards I supposed that I could probably be able to use the SD card. Sadly it failed again.
The library of the display just doesn't work with the default ESP32 SD card library.
Everything else works fine with the SD card library (Resistive touch over spi chip, motors and i2c bus)
but the display itself (ili9341 chip).
I'll try to use an alternative display library and return with my results. Thanks again for your support!

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024

Interesting results, so power supply regulation is an issue, if your driving the backlight from the board then I would add a series resistor or own a pin as it’s drive so that power consumption is reduced, or make a direct backlight to supply connection again via nominal resistance vale say 100R maybe more but I’ve never measured the current level to work out a suitable value. Also if you have some capacitors add some to provide reserves of power during g transient demands. 10uF or ideally 100uF. It could be this is all supply impedance related being too high to cope with demand peaks. I can’t think what interaction there could be between the display and SD card, they are both on the SPI bus unless they are loading the bus when not being addressed.

from esp32-and-how-to-use-ili9341-tft-display.

RetroDISTORT avatar RetroDISTORT commented on June 14, 2024

Same error with Library TFT_eSPI as expected, it's also based on adafruits library
Note: If you attempt to use this library with the SD card library, there is an error with macros.
In any case, just replace min with _min

from esp32-and-how-to-use-ili9341-tft-display.

RetroDISTORT avatar RetroDISTORT commented on June 14, 2024

Dumbest of mistakes!!!!!!!!!!!!!!!!!
Ok the problem was always a shortage of current!!!
so the way I wired the display was by setting a transistor to choose when to power vcc of the display.
I wired the display directly to 3.3v and it worked...
[ISSUE SOLVED]
Conclusion: Never use 100 ohm resistor on the base of a transistor, use a higher value, like 1k -_-

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024

OK, well I just connected an ILI9341 2.4" display with an SD-Card reader and ran the ESP32 SD-CardInfo function, by itself that works OK. Then the display_test (Adafruit_ILI9341) and that works OK. Combine the two and the card reading works, but the display stays white! So I've confirmed where you were to begin with, that the SD and ILI9341 drivers do-not coexist out-of-the-box. Yes Min and Max were missing / #undef by one of the libraries so I added those back in, but that's not the issue here. Can you upload you programme?

from esp32-and-how-to-use-ili9341-tft-display.

G6EJD avatar G6EJD commented on June 14, 2024

YEs a 100R resister from an I/O pin would have pulled it low as the base current would be too much to source (3.3-0.6)/100=27mA, I think max. source current is 12mA.

from esp32-and-how-to-use-ili9341-tft-display.

peppeg85 avatar peppeg85 commented on June 14, 2024

Thanks for the last post!

from esp32-and-how-to-use-ili9341-tft-display.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.