Adafruit-ST7735-Library icon indicating copy to clipboard operation
Adafruit-ST7735-Library copied to clipboard

Arduino Nano Hardware SPI support broken

Open username7291 opened this issue 2 years ago • 7 comments

Arduino Nano 16MHZ, 5V 1.8" TFT Display 7735 128x160 with onboard Levelshifter and 3V3 Regulator. SPI HW support is broken with this library. Only slow mode can be used. I found with google people have similar problems but no solution. Cause this lib is very big and passes functions around i cant fix it myself.

#define TFT_CS -1 // its to ground only 1 device #define TFT_RST 1 // Connecting to Arduino RST dont work #define TFT_DC 12 // RS Data/Command #define TFT_MOSI 11 // Data out #define TFT_SCLK 13 // Clock

Works but slow without Hardware SPI, SPI Settings has no affect Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

Dont work, display stays white(too with TFT_MOSI/SCLK define removed): Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

username7291 avatar May 17 '22 08:05 username7291

what if you use TFT_CS?

ladyada avatar May 17 '22 18:05 ladyada

In the sourcecode of the library i read -1 is supported. I set it to 14 or 53 dont work too. I think in a test i had original Pin numbers including CS connected and had the same problem. All Digital and Analog Pins are in use even 0/1.

username7291 avatar May 17 '22 21:05 username7291

are you using any hardware purchased from adafruit?

ladyada avatar May 18 '22 01:05 ladyada

Yes. With original Pin numbers i mean the default numbers in the source. Cause i need all possible Arduino pins i grounded cs later. Cause of space requirements SD port is removed.

username7291 avatar May 19 '22 07:05 username7291

we know 32u4 works, so not sure what to say, maybe you have bad hardware

ladyada avatar May 21 '22 15:05 ladyada

2 Displays and 2 Arduinos? Maybe its cause there is something on SPI SS/MOSI Pin, dont know. I optimized the library its now about 4 times fast with software SPI. Cant compare to Hardware SPI, a bit slower than 2.4" parallel display on Arduino Pro Mini 8 MHZ.

username7291 avatar May 23 '22 15:05 username7291

Hi guys, I just faced the same issue.

Default SPI not works

#define TFT_CS 10
#define TFT_RST 9
#define TFT_DC 8

Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);

But this works

#define TFT_CS 10
#define TFT_RST 9
#define TFT_DC 8

#define TFT_MOSI 11 // Data out
#define TFT_SCLK 13 // Clock out

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

I'm not sure about the speed, but it seem an issue.

ngoan98tv avatar Aug 06 '23 04:08 ngoan98tv