Try as I might, I can’t seem to get this little display working with the BLE. Works great with a Nano. I’m using Arduino IDE (non-MBED). Could it be because these Aliexpress displays don’t have a CS pin? From what I understand, it shouldn’t be needed unless I have other SPI devices. I’ve tried this simple code with different pins for DC and Reset. Any help would be appreciated.
#include <Adafruit_GFX.h> // Core graphics library #include <Adafruit_ST7789.h> // Hardware-specific library for ST7789 #include <SPI.h> #define TFT_CS -1 #define TFT_RST D6 // Or set to -1 and connect to Arduino RESET pin #define TFT_DC D7
Hi there,
can you post a picture how it is connected?
Seems it should work.
I don’t see the init for SPI?
tft.init(240, 240, SPI_MODE3); // or tft.init(320, 240, SPI_MODE3);
Just tried that (BL to HIGH), but didn’t work. So weird that it works perfectly on the Nano. I just ordered another display with an available CS pin to see how that works. Also, might it have something to do with the XIAO pins operating at 3.3v and the nano at 5V? Maybe try level shifting the SPI pins?
Have you tried SPI_MODE0?
The ST7789 operates at 3.3V, not 5V, so that should not be a problem.
Rather, how many volts did you connect to the display when it worked with the nano?
You guys have been great! I so appreciate the feedback and help. Just tried mode0 but still have blank screen. Also, the nano pins output 5V. I hooked up the VCC on the display to both 3.3V and 5V. The only difference I noted was that the BL was a little brighter and washed out the display a little. When I set up voltage dividers on the SPI pins to bring them down to 3.3V, the screen was blank. That’s why I’m thinking about trying level shifters to bring voltage up to 5v from the XIAO. Defies logic since the display should operate on 3.3v. Running out of ideas so just throwing stuff and see what happens
The ST7789 only allows a maximum supply voltage of 4.6V. Also, the 3-pin device you can see the picture in the link is not a 3.3V regulator but a backlight drive transistor, as indicated by the “J3Y” marking.
The conclusion from the picture in the link, and the ST7789 datasheet, is that “the display with 5V applied is most likely damaged”.
Yes, you would think the display would be fried at 5v, but surprisingly, it works. When I switch it from the XIAO breadboard back to the nano, it works. I thought that maybe the pcb had limiting resistors, but the SPI traces are all straight to the pins. I have 10 of these displays and get the same results when switching out to a new one.
It’s a strange story. Is there a difference between the photo in the link and the real thing?
The SPI clock frequency may be different between nano and XIAO. XIAO is 8MHz by default, I don’t know the frequency of nano but it might be slower.
I have an ST7735 display and it works fine at 16MHz with a 3.3V power supply. if I had an ST7789 on hand I could check, but unfortunately I can’t.
Finally figured it out! I added a CS pin. I cut the cs trace that was set to ground and cut the backlight pin trace. Then jumpered the cs trace to the backlight pin. Then just ran the code with the new cs pin connected to pin 2 of the XIAO.
Agreed! the display looks so much better at 3.3v. One interesting side note. If I upload the code, disconnect the usb cable and turn on from a 3.7v battery, I get nothing on the display. If I have the battery turned on, then disconnect the usb, it runs and displays perfectly.