Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Adafruit ItsyBitsy nRF52840 Express not working with ST7789
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit ItsyBitsy nRF52840 Express not working with ST7789

by kylearduino99 on Tue Jun 02, 2020 6:21 am

Hi,

https://www.adafruit.com/product/4481

I'm having trouble hooking up an ItsyBitsy nRF52840 Express connected to ST7789 display 240*240.

I used the grapphicstest.ino (provided example for st7789) and after debugging found programm was crashing on tft.fillScreen(ST77XX_BLACK). After this I commented the fillscreen line and kept code to bare minimum code ( as shown below). But i do not see anything updating on screen it is blank.

I can see the LED_BUILTIN flashing and serial print on monitor.

Please can you help me to find what is wrong here:

Connections:
Vin = Battery 5v
Gnd = Battery Gnd
SCK = PIN_SPI_SCK
MOSI = PIN_SPI_MOSI
DC = D9 (pin 7 as per variant.cpp file)
CS = D7 (pin 40 as per variant.cpp file)
RST = -1

Code:
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
#include <SPI.h>

#define TFT_CS 40//D7
#define TFT_RST -1//
#define TFT_DC 7//D9

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

void setup(void) {
Serial.begin(115200);
Serial.print(F("Hello! ST77xx TFT Test"));
pinMode(LED_BUILTIN, OUTPUT);
tft.init(240, 240); // Init ST7789 240x240

// programm was crashing here
// tft.fillScreen(ST77XX_BLACK);
}

void loop() {
delay(500);
digitalToggle(LED_BUILTIN);
tft.drawLine(0, 0, 200, 100, ST77XX_BLACK);
delay(500);
tft.drawLine(0, 0, 200, 100, ST77XX_YELLOW);
Serial.println("done");
}

I also tried with:

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

But this also does not work.

kylearduino99
 
Posts: 4
Joined: Fri May 29, 2020 3:21 pm

Re: Adafruit ItsyBitsy nRF52840 Express not working with ST7

by dastels on Tue Jun 02, 2020 10:40 am

The first thing to verify is that all board packages and libraries are up to data, and that the correct board is selected in the Tools menu.

Dave

dastels
 
Posts: 2838
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit ItsyBitsy nRF52840 Express not working with ST7

by kylearduino99 on Wed Jun 03, 2020 4:25 am

I have double checked the board is correctlty selected and the libraries are installed as well.

But i am not sure about the pins, i can find any instructions to use a display with nRF52840. Please can you see if the pics are right?
Attachments
Adafruit Libraries.png
Adafruit Libraries.png (28.65 KiB) Viewed 42 times
Arduino board selected.png
Arduino board selected.png (18.62 KiB) Viewed 42 times

kylearduino99
 
Posts: 4
Joined: Fri May 29, 2020 3:21 pm

Re: Adafruit ItsyBitsy nRF52840 Express not working with ST7

by dastels on Wed Jun 03, 2020 9:10 am

Hmm... did you try using 7 & 9 for the pins? You're using Arduino, so referencing the digital pins as usual should work. That's all I've ever had to do.

Dave

dastels
 
Posts: 2838
Joined: Tue Oct 20, 2015 3:22 pm

Re: Adafruit ItsyBitsy nRF52840 Express not working with ST7

by kylearduino99 on Thu Jun 04, 2020 2:15 pm

Yes i am using 7 and 9 but it D7 and D9 it does not work compile , so had to put pin numbers as shown below:

#define TFT_CS 40 //D7
#define TFT_RST -1 //
#define TFT_DC 7 //D9

I think this may be the issue D7 may not equal to 40 pin. I am bit stuck on this there is no pin maps for this board on Adafruit website.

kylearduino99
 
Posts: 4
Joined: Fri May 29, 2020 3:21 pm

Please be positive and constructive with your questions and comments.