Gents,
I'm having a problem getting the STMPE610 touch controller of the ADAFRUIT 3.5" TFT Feather wing to work with the Teensy 3.6. The TFT HX8357 display is working properly.
The sketch uploads with no error messages. With the program running the serial monitor reports the STMPE610 on-line, however a touch is never sensed and reported (x, y and z data). I've looked at all SPI signals, TFT CS, TFT DC and STMPE CS with my o'scope. All signals change state and voltage levels seem appropriate for 3v logic.
Any ideas would be appreciated.
Rick
Here are the particulars:
Arduino IDE 1.8.8 / Teensyduino 1.45
iMac running Mojave, 10.14.2
Code
PINOUT
TEENSY TFT COMMENT
GND GND GROUND
3.3V 3.3V 3.3VDC
11 MOSI MOSI SPI Interface
12 MISO MISO SPI Interface
13 SCK SCK SPI Interface
15 CS TFT Chip Select
14 DC TFT Data/ Command
16 RT STMPE610 Touch Screen controller
****************************************************/
Pics of the Teensy/TFT wiring refer below
The pinout for the ADAFRUIT TFT Feather wing is a bit tricky, the link refers https://www.adafruit.com/product/3651
Basically in this application only the MISO, MOSI, SCK, GND, 3v, RT, CS, DC, USB are utilized. The below pic refers.
I'm having a problem getting the STMPE610 touch controller of the ADAFRUIT 3.5" TFT Feather wing to work with the Teensy 3.6. The TFT HX8357 display is working properly.
The sketch uploads with no error messages. With the program running the serial monitor reports the STMPE610 on-line, however a touch is never sensed and reported (x, y and z data). I've looked at all SPI signals, TFT CS, TFT DC and STMPE CS with my o'scope. All signals change state and voltage levels seem appropriate for 3v logic.
Any ideas would be appreciated.
Rick
Here are the particulars:
Arduino IDE 1.8.8 / Teensyduino 1.45
iMac running Mojave, 10.14.2
Code
PINOUT
TEENSY TFT COMMENT
GND GND GROUND
3.3V 3.3V 3.3VDC
11 MOSI MOSI SPI Interface
12 MISO MISO SPI Interface
13 SCK SCK SPI Interface
15 CS TFT Chip Select
14 DC TFT Data/ Command
16 RT STMPE610 Touch Screen controller
****************************************************/
Code:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_HX8357.h>
#include <Adafruit_GFX.h>
#include <Adafruit_STMPE610.h>
#define TFT_DC 14 //TFT Data/Command
#define TFT_CS 15 //TFT chip select
#define STMPE_CS 16 //Touch screen chip select
#define TFT_RST -1 //TFT reset
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC);
Adafruit_STMPE610 ts = Adafruit_STMPE610(STMPE_CS);
// This is calibration data for the raw touch data to the screen coordinates
#define TS_MINX 3800
#define TS_MAXX 100
#define TS_MINY 100
#define TS_MAXY 3750
void setup() {
Serial.begin(9600);
Serial.println("STMPE610 Test");
tft.begin();
tft.fillScreen(HX8357_BLACK);
tft.setTextColor(HX8357_YELLOW);
tft.setTextSize(3);
tft.setRotation(3);
tft.setCursor(5, 5);
tft.print("HX8357 Display Test");
if (!ts.begin()) {
Serial.println("STMPE610 not found!");
while (1);
}
Serial.println("STMPE610 On-line. Touch the screen....");
}
void loop() {
uint16_t x, y;
uint8_t z;
if (ts.touched()) {
// read x & y & z;
while (!ts.bufferEmpty()) {
Serial.print(ts.bufferSize());
ts.readData(&x, &y, &z);
Serial.print("->(");
Serial.print(x); Serial.print(", ");
Serial.print(y); Serial.print(", ");
Serial.print(z);
Serial.println(")");
}
ts.writeRegister8(STMPE_INT_STA, 0xFF); // reset all ints
}
delay(10);
}
Pics of the Teensy/TFT wiring refer below
The pinout for the ADAFRUIT TFT Feather wing is a bit tricky, the link refers https://www.adafruit.com/product/3651
Basically in this application only the MISO, MOSI, SCK, GND, 3v, RT, CS, DC, USB are utilized. The below pic refers.
Last edited by a moderator: