XIAO on ST7735 TFT or ST7789

Hi to all seeeduino users.
I try display something using XIAO and ST7735TFT or ST7789 for 4 days now, and luck at all. Can anyone help with it ?

Hi @MichalC,

Could you share the hardware connection diagram, software libraries, and the demo code you used?

Best Regards,
Lakshantha

I have it working with displays from adafruit (240x320 and 240x240, both ST7789, also WavGat display 240x240IPS (has no /CS pin but still works with SPI mode3).
I use Adafruit_GFX + Adafruit_ST7789.

Hi @lakshan @rbehm Thank you for your replay.

I connected as follow:
Xiao ----- ST7789
3.3V ------VCC
GND ------GND
D8 ---------SCK
D10--------SDA
D1---------RST
D2---------DC

Blockquote
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <SPI.h>

//#define TFT_CS 0
#define TFT_DC 2
#define TFT_RST 1
#define TFT_MOSI 10
#define TFT_SCLK 8

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

void setup() {
// put your setup code here, to run once:

tft.init(240, 240);
tft.setRotation(2);
tft.fillScreen(ST77XX_BLACK);
tftPrintTest();
delay(4000);

}

void loop() {
// put your main code here, to run repeatedly:

}

void tftPrintTest() {
tft.setTextWrap(false);
tft.fillScreen(ST77XX_BLACK);
tft.setCursor(0, 30);
tft.setTextColor(ST77XX_RED);
tft.setTextSize(1);
tft.println(“Hello World!”);
tft.setTextColor(ST77XX_YELLOW);
tft.setTextSize(2);
tft.println(“Hello World!”);
}

Can you share way how you set it up ?

#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>
#include “Linein.h”
#include “inhandler.h”
#include “ValDisplay.h”

static const int TFT_CS = A3; // Or set to -1 for display w/o CS pin
static const int TFT_RST = A2;
static const int TFT_DC = A1;
static const int BL = A0;

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
void setup(void)
{
delay(1000);
pinMode(BL, OUTPUT);
Serial.begin(115200);
// while (! Serial) {}
digitalWrite(BL, true);
Serial.print(F(“Hello! ST7789 TFT Test”));
tft.init(240, 240, SPI_MODE3); // or tft.init(320, 240, SPI_MODE3);
// MODE3 is for the display without /CS line
tft.setRotation(1);
tft.setSPISpeed(40000000);

Serial.println(F("Initialized"));

uint16_t time = millis();
tft.fillScreen(ST77XX_BLUE);
time = millis() - time;

tft.setTextSize(2);

}

2 Likes

@rbehm

tft.init(240,240,SPI_MODE3) - this was my problem :wink: I did’t init SPI. Thank you very much !!

1 Like