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):
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
Full (simple) example code that runs on the wired prototype, but fails to run on the PCB:
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
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
}