-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardware SPI don't work with ILI9341 - 3 bugs and 3 solutions here #65
Comments
spi mode 3 fixed my hardware spi issues, thankyou so much for this. |
I also have a hardware SPI bug. Maybe this is bug 4. It works when I try the default SPI port using the following:
But if I then add in the SPI Class it fails to work - I just get a dimmer white screen with very faint flicker (this is the same result if I use &SPI1):
|
I discovered my issue. The library has DC and CS pins swapped, when using Adafruit_ILI9341(SPIClass *spiClass, int8_t dc, int8_t cs = -1, int8_t rst = -1); |
Hello, I'm currently working in software mode. |
Isn't there anyone here who could help me? |
Hi,
I'm use the Adafruit_ILI9341 and the GFX library to drive a ILI9341 TFT SPI touch screen on a Arduino UNO with an Ethernet Shield 2 (for the touch pad I use URTouch.h)
I've found some bugs and also solutions :
1st :
If you use
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST)
you've got an error "call of overloaded 'Adafruit_ILI9341(int, int, int)' is ambiguous"
So you have to edit Adafruit_ILI9341.h and Adafruit_ILI9341.cpp to comment Adafruit_ILI9341() fonctions for ESP8266
I think you have to change function names to avoid this.
2nd :
ILI9341 use SPI MODE 3 and cannot work with the default SPI MODE the library uses with hardware SPI
Curiously, the software SPI use the good mode.
Thus, you have to edit Adafruit_ILI9341.cpp and replace
initSPI(freq);
by
initSPI(freq, SPI_MODE3);
3rd
When you have quite long wires (eg. 20cm dupont wire) and slow 5V/3.3V level converter (or just 10K resistors !) from the Arduino UNO and the TFT you've got a speed limitation.
Remember that in electronics :
Indeed, in the sketch, you have to use
tft.begin(3000000);
instead of
tft.begin();
You can also use a fast SPI speed with short wires and a hi-speed level converter.
I found that a lot of people don't know these problems and use
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
with the hardware SPI pins...
that's very very bad...
that's very slow...
and it doesn't work with other SPI devices...
I wonder that the constructor have explicit names as "tftHardwareSPI" and "tftSoftwareSPI"
Please, can you update your library and also your documentation and sample codes ?
Bests regards.
The text was updated successfully, but these errors were encountered: