kd5rxt-mark
Well-known member
I'm working on an enhancement to my TeensyMIDIPolySynth which now uses the RA8875 TFT (ER-TFTM070-5) for the all-digital (no more pots / switches / buttons / LEDs !!) user interface. I am having very good luck with the conversion - this is a VERY NICE display !!.
In my program, I have defined a "splash" screen which shows the version of my code & pauses for three seconds before moving on to painting the first operational menu/screen. Just by accident, I happened to notice that the first character of the first line of the printed version information was missing.
This is very easy to reproduce using the included short program below to demonstrate this anomaly. This simple program prints the same string to the display three times . . . only the first print is missing the first character !! Changing which string gets printed (or changing the string's content) does not seem to change that the first character of the first print is always dropped (& not printed);
I'm interested in whether anyone else using an RA8875 display has seen this same behavior and/or can reproduce this same behavior . . .
Thanks !!
Mark J Culross
KD5RXT
In my program, I have defined a "splash" screen which shows the version of my code & pauses for three seconds before moving on to painting the first operational menu/screen. Just by accident, I happened to notice that the first character of the first line of the printed version information was missing.
This is very easy to reproduce using the included short program below to demonstrate this anomaly. This simple program prints the same string to the display three times . . . only the first print is missing the first character !! Changing which string gets printed (or changing the string's content) does not seem to change that the first character of the first print is always dropped (& not printed);
I'm interested in whether anyone else using an RA8875 display has seen this same behavior and/or can reproduce this same behavior . . .
Code:
//
// small test program to demonstrate the problem where the first character written to the RA8875 after start-up is dropped
//
//
// Arduino IDE Configuration:
// Tools/Board: "Teensy 4.1"
// Tools/USB Type: "Serial"
// Tools/CPU Speed: "600MHz"
// Tools/Optimize: "Faster"
// Tools/Keyboard Layout: "US English"
// Tools/Port: "COMx Serial (Teensy 4.1)"
//
const String VERSION0 = "1-2-3-4-5-6-7-8-9-0";
const String VERSION1 = ">> Testing, Testing, Testing <<";
const String VERSION2 = "version 1.0 dated 03/13/2021 @1500";
#include <SPI.h> // this must appear in the list of includes *before* RA8875, else compile errors are reported
#include <RA8875.h>
// 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
const int RA8875_MAX_TOUCH_LIMIT = 1;
RA8875 tft = RA8875(RA8875_CHIP_SELECT, RA8875_RESET, RA8875_MOSI, RA8875_SCLK, RA8875_MISO);
// The following pins are used in this project:
//
// PIN D2 = RA8875 Capacitive Touchscreen INT
// PIN D3 = RA8875 Capacitive Touchscreen RESET
// PIN A12 = RA8875 Capacitive Touchscreen MOSI (MOSI1)
// PIN A13 = RA8875 Capacitive Touchscreen SCLK (SCK1)
// PIN A14 = RA8875 Capacitive Touchscreen CS (CS1)
// PIN A15 = RA8875 Capacitive Touchscreen MISO (MISO1)
// onboard LED on pin 13
#define LED_PIN 13
// function headers
void loop();
FLASHMEM void setup();
// main loop
void loop()
{
} // loop()
// one-time setup
FLASHMEM void setup()
{
tft.begin(RA8875_800x480);
tft.DMA_enable();
tft.setRotation(2);
tft.clearScreen();
delay(100);
tft.useCapINT(RA8875_TS_INT); // use the capacitive chip interrupt
tft.setTouchLimit(RA8875_MAX_TOUCH_LIMIT);
tft.enableCapISR(true); // capacitive touch screen interrupt it's armed
tft.writeTo(L1);//write to layer 1
tft.layerEffect(OR);//apply AND effect between layer 1 and 2
Serial.begin(57600);
while (!Serial && (millis() <= 3000));
Serial.println("=============================================");
Serial.print(" "); Serial.println(VERSION0);
Serial.print(" "); Serial.println(VERSION0);
Serial.print(" "); Serial.println(VERSION0);
Serial.println("=============================================");
Serial.println("");
Serial.println("");
delay(500);
tft.setCursor(tft.width() / 2 - 76, tft.height() / 2 - 150);
tft.setTextColor(RA8875_GREEN, RA8875_BLACK);
tft.print(VERSION0);
tft.setCursor(tft.width() / 2 - 76, tft.height() / 2 - 100);
tft.setTextColor(RA8875_GREEN, RA8875_BLACK);
tft.print(VERSION0);
tft.setCursor(tft.width() / 2 - 76, tft.height() / 2 - 50);
tft.setTextColor(RA8875_GREEN, RA8875_BLACK);
tft.print(VERSION0);
} // setup()
// EOF placeholder
Thanks !!
Mark J Culross
KD5RXT