Adafruit GFX in spi software mode

Hi,
I'm trying to use the GFX library + ST7789 library with a 240x240 st7789 TFT screen.
with the hardware SPI it works fine .
I want to use the bitbang solution
I configure the pin like this to configure the emulated SPI

#define TFT_CS 10 // define chip select pin
#define TFT_DC 9 // define data/command pin
#define TFT_RST 8 // define reset pin, or set to -1 and connect to Arduino RESET pin
#define TFT_MOSI 7
#define TFT_SCLK 6
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

but the screen still black.
Is there something more to do ?

Thanks

This is the French section of the forum, you are supposed to ask your question in French.

Topic moved...

Two things, post the code and a schematic as you have it wired, not a frizzy picture. Your defines look great but no clue as to what does what with them.

Deux choses, postez le code et un schéma tel que vous l'avez câblé, pas une image frisée. Vos définitions sont superbes, mais aucune idée de ce qui fait quoi avec elles.

Hi,
With the Hardware SPI it works fine
The schematic for the software SPI is quite simple
UNO ST7789 screen
6-------------->SCK
7-------------->MOSI (SDA)
8-------------->RES
9-------------->DC
and the code come from

I only add the software SPI init
#define TFT_MOSI 7 // Data out
#define TFT_SCLK 6 // Clock out
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
sketch_mar14a.ino (8.6 KB)

Thanks for your Help

Does your display need SPI mode3? That hung me up on my display.

Hi,
Sorry don't know what it is ?
Where do you find this parameters , I don't have it in my code

It's in the example you'e running:


// if the display has CS pin try with SPI_MODE0
tft.init(240, 240, SPI_MODE2);    // Init ST7789 display 240x240 pixel

My panel needed SPI_MODE3.

If your panel worked with the hardware SPI, then the mode is probably right. It's something try changing though. I'm new to Arduino. I have no experience with SoftSPI.

With the hardware mode I change to mode3 and it works like mode 2

Hey you're right! My display works in mode 2 or 3, not mode 0 or 1.
There's a description of how the different spi modes work somewhere. I don't about them.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.