adafruit / Adafruit_ILI9341

Library for Adafruit ILI9341 displays

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QT Py ESP32-C3 SPi compatibility

koogar opened this issue · comments

  • Arduino board: QT Py ESP32-C3

  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.19

Hi,

Just wondered if the ili9341 library is compatible with the QT Py ESP32-C3, as I have not been able to get an output.

I have been trying the same pins which I have been using on the QT PY ATSAMD21, plus some variations.

//QT Py ESP32-C3

// Libraries
//Espressif 2.0.7 no compile
//Espressif 2.0.6 no compile
//Espressif 2.0.5 compiles

//ili9341 1.5.12 compiles

//----------------------------------------------------------------------------------
#define TFT_CS 5
#define TFT_DC 7
#define TFT_RST 0 // also 9

/* hardware pins */
// TFT_SCLK pin 8
// TFT_MOSI pin 10

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST); // Use hardware SPI
//----------------------------------------------------------------------------------

Many thanks

Rupert

Having the same problem. xiao works perfect (Same footprint & pinout) but same code does nothing on screen with the QT PY ESP32-C3 board. Using hardware SPI
#define TFT_DC 1
#define TFT_CS 3
#define TFT_RST 2

This works on the XIAO ESP32C3 on Espressif v2.0.5 & v2.0.7(latest)

#define TFT_DC D7
#define TFT_CS D5
#define TFT_RST D0 // or D9

Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST); // Use hardware SPI

I used D4 for the backlight

I do not know if you have to declare it as a digital pin "D" on the QT PY C3? I did on the XIAO C3.

Hope this helps

Rupert

Thanks Rupert,

both the adafruit QT PY & Xiao C3 are a little fickle, I have ended up going back to Arduino IDE V1.8 rather that V2 for programming these.

I have tried PIN_D?, but still no change. If i drop in a standard Xiao works straight away

"I have tried PIN_D? "
I was referering to changing 5 to D5 etc, I should have also mentioned I was on arduino v1.8.19 Portable

Using the adafruit ILI9341 example to test rather than my code this is the header

#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.
#define TFT_DC 7
#define TFT_CS 5
#define TFT_RST 0

// 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);

Same settings & code perfect on Xiao (SAMD)

Same settings & code on Xiao ESP32C3, white screen. Very strange

Try this on the XIAO C3. All the latest library versions

#include <Wire.h>
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

/* ESP32C3 SPi Hardware only for speed*/
#define TFT_CS     D5
#define TFT_DC     D7
#define TFT_RST    D9

//#define TFT_CLK    D8
//#define TFT_MOSI   D10
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST); // Use hardware SPI

https://github.com/koogar/Phat-Stats/tree/main/Experimental/XIAO_ESP32C3_ILI9431_GraphicsTest_PCB

Great works. Thanks. Now to find out what's different with my code