DFR0664 (Fermion: 2.0" 320x240 IPS TFT LCD) not working with DFR0975 (FireBeetle 2 Board ESP32 S3)
coloboxp 2024-10-31 15:36:38 1510 Views2 Replies Hi all,
I've been trying to use the DFRobot GDL library with the 2.0”LCD display ST7789V and I do not why the samples on that link do NOT work, nothing is shown on the display. I do not know what I am doing wrong, seems only the backlight works.
I am using the DFR0975 FireBeetle 2 Board ESP32 S3 and according to the table here, I've defined the PINs as follows:
#define TFT_DC 3 // LCD_DC pin
#define TFT_CS 18 // LCD_CS pin
#define TFT_RST 38 // LCD_RST pin
#define TFT_BL 21 // LCD_BL (Backlight) pin
DFRobot_ST7789_240x320_HW_SPI screen(/*dc=*/TFT_DC, /*cs=*/TFT_CS, /*rst=*/TFT_RST);
Then the test code doesn't show anything (the one that is supposed to draw lines and figures from the advanced tutorial here)
Is there something missing on the DFRobot_GDL library?, last update was 2 years ago, or am I missing something?, if so, please kindly advise what to do :)
I did, however, try directly with the Adafruit ST7735 and ST7789 Library@^1.10.4 and guess what?, their samples work… I just had to add the MOSI and SCLK pins to the constructor:
#define TFT_DC 3 // LCD_DC pin
#define TFT_CS 18 // LCD_CS pin
#define TFT_RST 38 // LCD_RST pin
#define TFT_BL 21 // LCD_BL (Backlight) pin
#define TFT_MOSI 15 // LCD_MOSI pin
#define TFT_SCLK 17 // LCD_SCLK pin
Adafruit_ST7789 screen = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
Please advice me how to continue with the DFRobot_GDL lib instead
Your wiring is right — the constructor is the problem.`DFRobot_ST7789_240x320_HW_SPI` only takes dc, cs, rst and (optionally) bl; it has no MOSI/SCLK arguments and just uses the default SPI bus. On ESP32-S3 that default bus is GPIO11/12/13, while the GDI connector brings the display up on GPIO17 (SCK), GPIO15 (MOSI) and GPIO16 (MISO). So the library is clocking data out on pins that aren't connected — backlight on, nothing on screen. That's also exactly why the Adafruit library worked: you passed it 15 and 17 explicitly. https://wiki.dfrobot.com/dfr0975/docs/23110
The library ships a remap example for precisely this case. Pass your own bus init function to`begin()` :
#include "DFRobot_GDL.h"
#define TFT_DC 3
#define TFT_CS 18
#define TFT_RST 38
#define TFT_BL 21
DFRobot_ST7789_240x320_HW_SPI screen(/*dc=*/TFT_DC, /*cs=*/TFT_CS, /*rst=*/TFT_RST, /*bl=*/TFT_BL);
void *interfaceInit() {
SPI.begin(17, 16, 15, 18); // SCK, MISO, MOSI, SS — GDI pins
return &SPI;
}
void setup() {
Serial.begin(115200);
screen.begin(interfaceInit);
}
https://github.com/DFRobot/DFRobot_GDL/blob/master/examples/interface/remap/remap.ino
Note the argument order —`SPI.begin(sck, miso, mosi, ss)` — SCK first and MOSI third, which trips people up. The BL pin is optional in the constructor; if you want`screen.setBacklight()` to work, pass 21 as the fourth argument, otherwise drive GPIO21 yourself.
The two-year-old commit isn't the issue here. GDL is a thin wrapper over Adafruit_GFX and it does work on S3 boards once the bus is on the right pins. If you're chasing maximum refresh rate later, the`..._DMA_SPI` variants use the same interface function, so the same`interfaceInit` applies.
If it still stays black after this, tell me what the serial monitor shows — a wrong GDI FPC orientation looks identical from the outside and is the other common cause.
Jason.Miao Good Morning
I have a problem to get any output on the LCD. It is always black. I checked DC and CS signal with Oscillator, signal is available.
I will just use Display, no MicroSD.
I checked with second Display also, same result.
What's wrong? pls HELP
useing : 2.0" 320x240 IPS LCD(V1.0)
Thanks in advance..Henri
HENRI.HUBER 

