0

Issue with ST7789
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Issue with ST7789

by travbum on Wed Jan 02, 2019 10:21 pm

I've tried following the sample code file graphicstest to connect this to both a Feather Huzzah and Arduino Uno with no luck. All I get is a backlit black screen. The code uploads and I see messages sent back via Serial.

For the Arduino, I connected the pins like so:

Vi -> 5V
3V -> Not Connected
G -> Ground
CL -> Pin 13
SO -> Not Connected
SI -> Pin 11
TC -> Pin 10
RT -> Pin 9
DC -> Pin 8
CC -> Not Connected
BL -> Not Connected

What am I doing wrong? Or do I have a defective product?

travbum
 
Posts: 9
Joined: Wed Jan 02, 2019 9:17 pm

Re: Issue with ST7789

by adafruit_support_bill on Thu Jan 03, 2019 7:10 am

Please post some photos showing your soldering and connections.

adafruit_support_bill
 
Posts: 71802
Joined: Sat Feb 07, 2009 10:11 am

Re: Issue with ST7789

by travbum on Thu Jan 03, 2019 10:19 am


travbum
 
Posts: 9
Joined: Wed Jan 02, 2019 9:17 pm

Re: Issue with ST7789

by adafruit_support_bill on Thu Jan 03, 2019 10:31 am

The soldering looks fine. We also need to see where all the wires go to double-check the connections.

adafruit_support_bill
 
Posts: 71802
Joined: Sat Feb 07, 2009 10:11 am

Re: Issue with ST7789

by travbum on Thu Jan 03, 2019 10:41 am

If you scroll down the second photo has that.

travbum
 
Posts: 9
Joined: Wed Jan 02, 2019 9:17 pm

Re: Issue with ST7789

by adafruit_support_bill on Thu Jan 03, 2019 11:09 am

What messages do you see printed to the serial monitor when running GraphicsTest?

adafruit_support_bill
 
Posts: 71802
Joined: Sat Feb 07, 2009 10:11 am

Re: Issue with ST7789

by travbum on Thu Jan 03, 2019 11:56 am

Hello! ST77xx TFT Test
Initialized
188
done

travbum
 
Posts: 9
Joined: Wed Jan 02, 2019 9:17 pm

Re: Issue with ST7789

by adafruit_support_bill on Thu Jan 03, 2019 12:12 pm

Sounds like it thinks it is talking to the display. Unfortunately the display controller is a 'write-only' device and there is no positive confirmation.

Try re-wiring the data lines with a different bunch of jumpers. We do occasionally see problems caused by a defective jumper.

adafruit_support_bill
 
Posts: 71802
Joined: Sat Feb 07, 2009 10:11 am

Re: Issue with ST7789

by travbum on Thu Jan 03, 2019 12:23 pm

adafruit_support_bill wrote:Sounds like it thinks it is talking to the display. Unfortunately the display controller is a 'write-only' device and there is no positive confirmation.

Try re-wiring the data lines with a different bunch of jumpers. We do occasionally see problems caused by a defective jumper.



I tried doing this on two different boards, ESP8266 and an Arduino, with two completely different sets of wires, on two different breadboards.

travbum
 
Posts: 9
Joined: Wed Jan 02, 2019 9:17 pm

Re: Issue with ST7789

by adafruit_support_bill on Thu Jan 03, 2019 12:32 pm

OK. Please contact support@adafruit.com with a link to this thread and we can replace the display.

adafruit_support_bill
 
Posts: 71802
Joined: Sat Feb 07, 2009 10:11 am

Re: Issue with ST7789

by travbum on Thu Jan 03, 2019 12:45 pm

Thanks for your help!

Bit of a frustration but I learned a lot about those displays.

travbum
 
Posts: 9
Joined: Wed Jan 02, 2019 9:17 pm

Re: Issue with ST7789

by travbum on Mon Jan 07, 2019 8:04 pm

Hi, So I just got my replacement part and I'm having the exact same issue.

Was there a bad batch of boards or something? Are there bugs with the library perhaps?

travbum
 
Posts: 9
Joined: Wed Jan 02, 2019 9:17 pm

Re: Issue with ST7789

by adafruit_support_bill on Tue Jan 08, 2019 7:28 am

Each of these boards is tested in production. We have not had many issues with them.

The graphicstest code by default assumes hardware SPI and the wiring you are using is for an Arduino UNO. Different Arduino boards will have different SPI pins. Make sure that you are using the correct pins for your board. You also might try the software SPI option. See the comments in the code for details.

adafruit_support_bill
 
Posts: 71802
Joined: Sat Feb 07, 2009 10:11 am

Re: Issue with ST7789

by guma on Sat Jan 12, 2019 11:21 am

I had exactly the same issue as travbum. The display seems to be initiated correctly but doesn´t show anything than black screen. I found that´s only a problem of library versions 1.2.0 and 1.2.6. For some reasons there ist a mistake in the display init section in the file 'Adafruit_ST77xx.cpp' (both versions 1.2.0 and 1.2.6). The 'startWrite()' and 'endWrite()' commands are outside the while loop instead of inside this structure.

This is the original code (excerpt of Adafruit_ST77xx.cpp) - I have seperated the 'startWrite()' and 'endWrite()' commands for better overview:
Code: Select all | TOGGLE FULL SIZE
void Adafruit_ST77xx::displayInit(const uint8_t *addr) {

  uint8_t  numCommands, numArgs;
  uint16_t ms;

  startWrite();

  numCommands = pgm_read_byte(addr++);   // Number of commands to follow
  while(numCommands--) {                 // For each command...
    writeCommand(pgm_read_byte(addr++)); // Read, issue command
    numArgs  = pgm_read_byte(addr++);    // Number of args to follow
    ms       = numArgs & ST_CMD_DELAY;   // If hibit set, delay follows args
    numArgs &= ~ST_CMD_DELAY;            // Mask out delay bit
    while(numArgs--) {                   // For each argument...
      spiWrite(pgm_read_byte(addr++));   // Read, issue argument
    }
    if(ms) {
      ms = pgm_read_byte(addr++); // Read post-command delay time (ms)
      if(ms == 255) ms = 500;     // If 255, delay for 500 ms
      delay(ms);
    }
  }

  endWrite();

}

This is the corrected code:
Code: Select all | TOGGLE FULL SIZE
void Adafruit_ST77xx::displayInit(const uint8_t *addr) {

  uint8_t  numCommands, numArgs;
  uint16_t ms;

  numCommands = pgm_read_byte(addr++);   // Number of commands to follow
  while(numCommands--) {                 // For each command...

    startWrite();

    writeCommand(pgm_read_byte(addr++)); // Read, issue command
    numArgs  = pgm_read_byte(addr++);    // Number of args to follow
    ms       = numArgs & ST_CMD_DELAY;   // If hibit set, delay follows args
    numArgs &= ~ST_CMD_DELAY;            // Mask out delay bit
    while(numArgs--) {                   // For each argument...
      spiWrite(pgm_read_byte(addr++));   // Read, issue argument
    }

    endWrite();

    if(ms) {
      ms = pgm_read_byte(addr++); // Read post-command delay time (ms)
      if(ms == 255) ms = 500;     // If 255, delay for 500 ms
      delay(ms);
    }
  }
}

Please try it with the descripted modification. As already mentioned above you can also perform a test with software SPI (slow but ok for testing) to check, if your display and the wire connections are ok.

guma
 
Posts: 3
Joined: Wed Nov 09, 2016 4:31 pm

Re: Issue with ST7789

by travbum on Sat Jan 12, 2019 12:12 pm

Hi, sorry I forgot to reply. I found another library elsewhere on the internet that works for it.

travbum
 
Posts: 9
Joined: Wed Jan 02, 2019 9:17 pm

Please be positive and constructive with your questions and comments.