RA8875 Comms quit randomly

maxdog

Member
I have a T4.0 connected to a 800x480 display from buy-display.com (ER-TFTM070-5). The display is configured for 5 volt supply, and I am powering it from the 5 volt pin on the T4, which is plugged in to USB. My SPI wires from the T4 to the display header are about an inch long. The troubleshooting code is simple, I have a red circle flashing every second on the display.
My issue is somewhere between immediately, and an hour, the display will stop responding. I have an LED connected to an output, and it continues to blink, so I know its not the T4 locking up. Sometimes the display will start working again on its own, but usually not. Sometimes it takes a couple of power cycles to get it to function again. I've tested for loose connections, cold solder joints, etc.

I don't have a second display to test, and before I purchase one, I was curious if anybody had any other ideas, or know of any odd timing issues that might disrupt the communications?

The only clue, if it is even a clue, is the behavior of the built in LED on pin 13, which is used for SPI SCK. When everything is working, when the display updates, you see that led blip for just a few milliseconds. When the display stops functioning, that LED still blips once a second, but for slightly more time, perhaps 50 to 100 milliseconds (estimate).

I'm stumped.


Code:
#include <Adafruit_GFX.h>
#include <SPI.h>
#include <RA8875.h>

#define RA8875_CS 10
#define RA8875_RST 14
RA8875 tft = RA8875(RA8875_CS, RA8875_RST);

unsigned long oldTick;
bool tick;


void setup() {

  tft.begin(RA8875_800x480);
  tft.fillWindow(RA8875_BLACK);

  pinMode(20, OUTPUT);//LED heartbeat pin
}

void loop() {
  if (millis() > oldTick + 1000) {
    oldTick = millis();
    tick = !tick;
    if (tick) tft.fillCircle(400, 240, 100, RA8875_BLACK);
    if (!tick) tft.fillCircle(400, 240, 100, RA8875_RED);
    digitalWrite(20, tick);
  }
}
 
@maxdog: There are a couple of older threads, such as <this> one, which indicate putting a 100-220 ohm resistor in series with each of the SCLK & MOSI signals can help to reduce/eliminate ringing on those particular signals. You might try that & see if it makes any positive improvement for your setup.

Mark J Culross
KD5RXT
 
Thank you.
Ringing makes sense based on the randomness of it. I will try that tomorrow.
I did do a search on the forum, but must have used bad search terms.
 
Another thing to consider is that display takes quite a bit of power and your setup may be drawing more current than the USB can safely supply. USB 3,.0 can handle more than USB 2.0 so if using USB 2.0 port, try a USB 3.0 port or try powering the LCD from a separate 5V supply to see if that solves the issue.
 
Back
Top