Need help troubleshooting RA8875 which works in a wired prototype, but not in PCB

kd5rxt-mark

Well-known member
Particulars:
Arduino IDE Configuration (last built with Arduino 1.8.13 + Teensyduino 1.54-beta7):
Tools/Board: "Teensy 4.1"
Tools/USB Type: "Serial + MIDI"
Tools/CPU Speed: "600MHz"
Tools/Optimize: "Smallest Code"
Tools/Keyboard Layout: "US English"
Tools/Port: "COMx Serial+MIDI (Teensy 4.1)"
Using the RA8875 library provided by Teensyduino

As indicated in a previous post, I am using the RA8875 (TFTM070-05) 800x480 w/ capacitive touch panel from buydisplay.com. I have everything working perfectly with that display & touchpanel in the prototype that I wired up, & I am extremely happy with the way everything is working. All of the RA8875 example sketches run successfully on the prototype by substituting the following for the pin definitions & initialization (full example attached at the end of this post):

Code:
// when used w/ Audio Adapter, must use an alternate CS pin for the display
const int RA8875_CHIP_SELECT     = A14;       // Teensy 38 -to- RA8875 05
const int RA8875_RESET           =   3;       // Teensy 03 -to -RA8875 11
const int RA8875_MISO            = A15;       // Teensy 39 -to- RA8875 06
const int RA8875_MOSI            = A12;       // Teensy 26 -to- RA8875 07
const int RA8875_SCLK            = A13;       // Teensy 27 -to- RA8875 08
const int RA8875_TS_INT          =   2;       // Teensy 02 -to- RA8875 33

#define RA8875_CS RA8875_CHIP_SELECT

const int RA8875_MAX_TOUCH_LIMIT =   1;

RA8875 tft = RA8875(RA8875_CHIP_SELECT, RA8875_RESET, RA8875_MOSI, RA8875_SCLK, RA8875_MISO);

Now, here's my current problem: I laid out a PCB in KiCAD & had the first three fabricated by OshPark, I am working towards formalizing my updated TeensyMIDIPolySynth (with all of the capabilities configured & controlled from the RA8875 display). All of the MIDI (6N138-based circuitry) functionality & audio (RevD Audio Adapter) functionality works like a champ. However, the display mostly stays dark. Very rarely, the first few lines at the top of the display will show red and/or yellow stripes. The behavior is consistent, regardless of whether I operate from PC supplied USB (2.1 A capable), my 6500mAh LiPo battery + Adafruit PowerBoost 1000C (nominal 1.0 A capable, with up to 2.0 A capable), or a 20000mAh battery brick (2.5A capable).

My question is this: what should I be looking at when troubleshooting the PCB ?? I have buzzed all static connections & have confirmed that they match the layout/schematic (all required traces are present, & there are no unintended connections to any other pins). I tried manually adding heavier +5VDC & GND wires directly from the PowerBoost 1000C to the display, but that made no difference. I tried adding 2.2K pull-ups to CS, MISO, & MOSI, but that also made no difference.

I would really like to finalize the PCB, but I will not be doing so until I can get the display operations on the PCB to fully match the rock-solid performance of the wired prototype !! Any & all recommendations and/or suggestions are appreciated !!

Mark J Culross
KD5RXT

RA8875_touch_test.jpgRA8875_front.jpgRA8875_PCB_back.jpgRA8875_TeensyMIDIPolySynth_flow_graph.jpgRA8875_TeensyMIDIPolySynth_save_restore.jpgRA8875_TeensyMIDIPolySynth_vfoA.jpgRA8875_TeensyMIDIPolySynth_built_in_keyboard.jpg

Full (simple) example code that runs on the wired prototype, but fails to run on the PCB:

Code:
/*
An example of the internal support for the capacitive touch screen
that use FT5206.
Using FT5206 instead resistive RA8875 one give more precision, don't need any calibration
and you have max 5 concurrent touches plus gesture and more...
*/

#include <SPI.h>
#include <RA8875.h>
#include <Wire.h>


//#define RA8875_CS         10 
//#define RA8875_RESET      23                 
//#define RA8875_INT        2

#define MAXTOUCHLIMIT     5//1...5

//RA8875 tft = RA8875(RA8875_CS, RA8875_RESET);


const int RA8875_CHIP_SELECT     = A14;       // Teensy 38 -to- RA8875 05
const int RA8875_RESET           =   3;       // Teensy 03 -to -RA8875 11
const int RA8875_MISO            = A15;       // Teensy 39 -to- RA8875 06
const int RA8875_MOSI            = A12;       // Teensy 26 -to- RA8875 07
const int RA8875_SCLK            = A13;       // Teensy 27 -to- RA8875 08
const int RA8875_TS_INT          =   2;       // Teensy 02 -to- RA8875 33

// Compatibility to match my pin & function definitions
#define RA8875_CS RA8875_CHIP_SELECT
#define RA8875_INT RA8875_TS_INT

RA8875 tft = RA8875(RA8875_CHIP_SELECT, RA8875_RESET, RA8875_MOSI, RA8875_SCLK, RA8875_MISO);

void setup(){
  /*
  Serial.begin(38400);
  long unsigned debug_start = millis ();
  while (!Serial && ((millis () - debug_start) <= 5000)) ;
  */
  //  begin display: Choose from: RA8875_480x272, RA8875_800x480, RA8875_800x480ALT, Adafruit_480x272, Adafruit_800x480
  tft.begin(RA8875_800x480);
  #if defined(USE_FT5206_TOUCH)
  tft.useCapINT(RA8875_INT);//we use the capacitive chip Interrupt out!
  //the following set the max touches (max 5)
  //it can be placed inside loop but BEFORE touched()
  //to limit dinamically the touches (for example to 1)
  tft.setTouchLimit(MAXTOUCHLIMIT);
  //tft.setRotation(0);//this works in any rotation mode!
  tft.enableCapISR(true);//capacitive touch screen interrupt it's armed
  #else
  tft.print("you should open RA8875UserSettings.h file and uncomment USE_FT5206_TOUCH!");
  #endif
  tft.setTextColor(RA8875_WHITE,RA8875_BLACK);
}

void loop(){
  #if defined(USE_FT5206_TOUCH)
  if (tft.touched()){//if touched(true) detach isr
  //at this point we need to fill the FT5206 registers...
    tft.updateTS();//now we have the data inside library
    tft.setCursor(CENTER,CENTER);
    tft.print("                              ");
    tft.setCursor(CENTER,CENTER);
    tft.print("touches:");
    tft.print(tft.getTouches());
    tft.print(" | gesture:");
    tft.print(tft.getGesture(),HEX);
    tft.print(" | state:");
    tft.print(tft.getTouchState(),HEX);
    //you need to get the coordinates? We need a bidimensional array
    uint16_t coordinates[MAXTOUCHLIMIT][2];//to hold coordinates
    tft.getTScoordinates(coordinates);//done
    //now coordinates has the x,y of all touches
    //now draw something....
    uint16_t tempCol;
    for (uint8_t i=1;i<=tft.getTouches();i++){
      if (i == 1)tempCol = RA8875_RED;
      if (i == 2)tempCol = RA8875_GREEN;
      if (i == 3)tempCol = RA8875_MAGENTA;
      if (i == 4)tempCol = RA8875_CYAN;
      if (i == 5)tempCol = RA8875_YELLOW;
      tft.fillCircle(coordinates[i-1][0],coordinates[i-1][1],10,tempCol);
    }
    tft.enableCapISR();//rearm ISR if needed (touched(true))
    //otherwise it doesn't do nothing...
  }
  #endif
}
 
Hopefully someone who uses these a lot will be able to give you a more complete answer.

At one point I played around with my own carrier board, that I could use with the RA8875 and some with the RA8876 boards... It worked OK... I opened up the diptrace layout to see if it gives me any hints as it has probably been a year since I played with it...

screenshot.jpg

And also looking at the schematic, it also reminds me that their display the MISO pin does not play well with others. So for example I have setup an optional buffer to allow it work with other devices.

I am also trying to remember if it was the RA8875 and/or RA8876, if you had to setup the backlight:
Example pin 14 BL_CONTROL - do you have it floating or do you use this to control. Which I believe is controlled on what jumpers you have set.

Again sorry I am real rusty on these displays.
 
Kurt:

Thank you for your reply. When I started this effort to transition from the ILI9341 to a larger display, I read the detailed thread from when the RA8875 library was being optimized for the Teensy with much interest. I tried to understand as much as possible before I committed to buying my first RA8875. As I said before, I am truly very pleased with how well this display works (at least in the prototype !!).

As for the MISO incompatibility, I moved the display to MISO1/MOSI1/SCK1 (with no other devices) to avoid any potential conflicts & this appears to work very well in the wired prototype. In the specific display that I have, the backlight is software controlled (via a function call), which again also adds to the convenience !!

I was really excited to populate the new PCB when I got it, & I initially decided to install only the Teensy & the display. I was quite shocked when it didn't work, since the wiring on the prototype was far messier than the nicely routed traces on the PCB !! I've already started working on the next version of the PCB & it includes wider power & ground traces & pads for decoupling caps (10uf & 0.1uf) for the Teensy & the display. At $150 for the three copies, I'd like to be as confident as I can before I plunk down the cost of the next run of PCBs !!

Thanks again for your suggestions,

Mark J Culross
KD5RXT
 
I assume you are trying it with the same display and the like. If not I would probably try with a different one to make sure it is not a display issue.

Like are they setup to be powered the same? I ordered mine with the 5v version, so they have their own 3.3v VR on the board. Likewise configured for 4 wire SPI.
That it is the same resolution.

Other than that if it were me, I would have Logic Analyzer hooked up to verify I am getting the signals.
I don't typically use the analog Pins names like A15 for specify MISO1, but should work as it is same as 39 (i hope).

Again not sure what to say other than do basic debugging... Like you can run what has been posted several times the HiLow test and try pinging out each of the pins going to the display and make sure the right signals are showing up there. Likewise that it does not report a short...

Good luck
 
Kurt:

Thank you . . . all great suggestions. I am moving the modules (Teensy, Audio Adapter, PowerBoost 100C, & RA8875 display) between the wired prototype & the PCB (both boards are socketed). I have also tried my second display, which also works in the prototype & not in the PCB. The two displays were ordered at the same time & spec'd the same (but I still double-checked all of the options - they did come from China !!). I took everything to work with me last Friday with the intention of looking at the pertinent Teensy-to-display signals on a scope. Unfortunately, one of our scopes is out for calibration, & the other scope seems to have come back from its last calibration cycle *without* its probes (making it about as useful as a brick !!).

I will try the HiLow test as suggested, & when the second scope unit comes back, I still intend to scope the signals & see what that might show (being a software development lab, we don't have a true logic analyzer - we're lucky to have the couple of o-scopes that we do, one analog & one DS).

Thanks again for the suggestions !!

Mark J Culross
KD5RXT
 
Looks like you have tested most of the obvious things. Hopefully once you can ring out the different pins, to verify everything works, the issue will show up. Likewise I would check with a voltmeter what voltage is being sent to the display...

I will try the HiLow test as suggested, & when the second scope unit comes back, I still intend to scope the signals & see what that might show (being a software development lab, we don't have a true logic analyzer - we're lucky to have the couple of o-scopes that we do, one analog & one DS).
I am a retired software developer/lead/manager... And I own more than one Logic Analyzer... But I started off with the first one by Saleae, than wanted to upgrade to 16 signals, then went with their sort of kickstarter... So I am a hoarder (did trade my first one to a friend several years ago)... I use mine all the time, especially for debugging. I often use unused IO pins and add in things like digitalWriteFast or digitalToggleFast into places like interrupt handlers... So I can answer the question, did that interrupt get called...

I also use it for timings and... As for Scopes... I don't have one, unless you count the original Sparkfun lab thingy that plugs into PC...

Again good luck
 
Can you post a photo of the display with the problem ? Also post the kicad file. There could be error in the wiring. What is the wiring mod on the PCB ?
 
Can you post a photo of the display with the problem ? Also post the kicad file. There could be error in the wiring. What is the wiring mod on the PCB ?

The two added wires are +5VDC & GND directly between the PowerBoost 1000C & the display (as indicated in my earlier post, this was an attempt to rule out the very thin traces on the PCB, jut in case they were inducing some kind of a problem).

I'm attaching a PDF which includes screen captures from KiCAD . . . hopefully at sufficient ZOOM level to be able to follow the actual traces. As also indicated in my earlier post, I have buzzed the PCB (each & every one of the display's 40 pins to each & every one of the Teensy's 48 pins. All expected connections are present & no unexpected connections were present).

I appreciate the second look.

Mark J Culross
KD5RXT

P.S. I forgot to mention that both sides of the board have a GND fill/pour, but these ground planes were turned off before executing the screen captures in order to make everything easier to read/follow. Obviously, for the circuit buzzing that I did, the GND fills/pours are actually present & in place :p. MJC
 

Attachments

  • TeensyMIDIPolySynth - RA8875 _prototype from KiCAD_.pdf
    328.4 KB · Views: 80
Last edited:
Had a quick look at pdf.

Here are my comments:
1) On the LCD's data sheet pin 13 and 31 should be connected to GND.

2) Using a DMM measure the supply voltage display, say between pin 2 and 3. What do you get ?

3) On that display what is the status of J8 (solder bridge) ? This should match the supply voltage.

4) Using a scope check the waveform of CLK, MOSI, Chip select. Use the known working board as a reference, you should see similar waveforms. Use a scope rather than a Logic Analyzer as a scope will give you some indication of the quality of the signal.

5) Check the soldering on J5 and on the T41. Make sure there are no shorts.

Post a photo of the board will the display on. Does the display flicker ?
 
Also quick look - On my quick and dirty board, I did have pins 13 and 31 to GND, also I think 39 and 40 - But was trying to get the board to work with three different displays to test out, including:
The older 5" connectors plus the 4.3" one and the 7" RA8876.

On My board I also have the +5v running to pins 37 and 38.

My guess is most of these common pins connect to each other internally on board, but...
 
I know that this thread is very old, but I wanted to post an update to save anyone who stumbles across this thread the frustration of finding the same problem that they are experiencing, but alas, no solution. In my on-going troubleshooting attempts, I have now been thru four versions of my PCB (that'$ lot$ of dollar$ in wa$ted PCB$ !!), However, the great news is that I have now resolved the unreliability.

My initial attempt at a solution on the second PCB version was to add 2.2K ohm pull-up resistors on the SDA & SCL pins. With this mod, I still did not have a working display.

On my third PCB version, I removed the ground plane (it wasn't really a ground plane since the board was only 2-layers. Instead, it was most likely a hodge-podge of poorly terminated signal paths that were something close to ground. Whatever it was, it was not good !!) & luckily, I now had a working display. However, with little to nothing going on (no MIDI in or out activity, no usbMIDI in or out activity, & no usbhostMIDI in or out activity, but with a realtime clock on the display), the system would occasionally go unresponsive. Strangely, when the display was non-responsive, I could still send MIDI into any of the MIDI-capable ports & the sounds would be properly generated for that input.

The "hang-up" was very non-repeatable. Sometimes everything would run just fine for days, & sometimes it would "hang" within a couple of minutes. It was almost impossible to troubleshoot, so I just kept stabbing in the dark. I still wasn't absolutely certain whether it was a software problem, a one-off hardware problem, a generic hardware problem, or some combination of any/all of these. As another test, I went back & loaded my latest firmware onto my wire-wrapped prototype & installed all of the exact hardware (T4.1 display/MIDI controller, T4.0 audio controller, Audio Adapter Rev D, and RA8875 display) onto the prototype, and it ran for almost a week without a single hang throughout that time. Extremely frustrating !!

So, finally, on the fourth PCB version, I put 100-ohm resistors inline with the SDA & SCL signals on the Teensy side of the 2.2K ohm pull-ups (which is reported elsewhere to dampen any high-speed ringing on these signals). This apparently was the magic bullet that cleaned up all of the intermittent hangs. I want to believe that it was the combination of the pull-ups and the inline resistors that really fixed my particular problem.

Now that I have that problem licked, my plan is to publish all of the design info (schematic & PCB layout using KiCAD 7 + integrated Freerouting), as well as all of the sketch sources for others to enjoy & experiment with. The final TeensyMIDIPolySynth (or TMPS) product is a very versatile & powerful electronic synthesizer, with multiple kinds of message routing among & between all of the different MIDI interfaces, as well a a 14-poly engine that includes a detailed combination of modulators (with their own envelopes & filters), envelopes, & filters on each of the 14 sound paths.

I will say yet again that I am extremely pleased with the capabilities that @Paul Stoffregen has created & made available for the rest of our benefit !! Thank-you to Paul & all others who have assisted him in the creation of the powerful hardware library support for the Teensy subsystem !!

Mark J Culross
KD5RXT
 
Hi Mark,
I am using the same TFTM070-5 display with capacitive touch on SPI1 as you. Some of your posts help me get going with my own setup, so thanks for that.

I am wondering if the FT5206_gesture example works OK on your setup. On mine, the 2 finger gestures like zoom in/out work alright. The swipe up/down/left/right just return 0. I am assuming it is probably a library issue, but looking for someone to confirm they are seeing the same issue.

BTW, on the PCB issues you were having, I used 56 ohm series resistors on the SPI1 CLK anad MOSI lines (pins 26, 27) near the Teensy 4.1 to resolve similar sounding intermittent issues should you still be seeing occasional glitches. I do run a full ground plane on my board. The LCD now operates well on the baseboard with about 5" runs as well as on up to at least a 16" extension cable. A 4" extension is shown here, so the resistors really helped.

--- Ken
 

Attachments

  • Project System Stuff.jpg
    Project System Stuff.jpg
    61.6 KB · Views: 16
Ken:

Glad that my stumbling around might be useful to others LOL. WRT the prior intermittent issues, I likewise put 100 ohm resistors inline with CLK & MOSI, & can now use the display reliably & consistently.

Sorry, I am not currently using any of the finger gestures, so I can't provide any useful help there.

Mark J Culross
KD5RXT
 
Back
Top