I have made a new PCB board for a project that I am working on that uses both the Audio shield and the touchscreen sold by PJRC.

In this newest version, I have used a 4.0 instead of a 4.1 while keeping the same pin routing as with the 4.0. The code for that routing can be found below.

The screen works great but the touch is set on maximum pressure at one of the corners (top left if you are orienting the screen as seen in the font examples on this page. (https://www.pjrc.com/store/display_ili9341_touch.html). This corner remains the "touched" corner regardless of screen and touchscreen orientation. It is always that corner. I have tried swapping out screens and 2 screens get the same result.

I have tried Examples->XPT2046->TouchTest or ILI9341Test and gotten the same result.

I have examined my board over and over and checked the pin routing. If anyone has any suggestions about were I should look for errors, I would be very grateful. I read a similar issue having to do with Chip Select choices but as far as I can tell, I can use any pin for chip select with these two libraries ( <ILI9341_t3.h> and <XPT2046_Touchscreen.h>)

Thank you in advance for any clues you might be able to offer.


#include <ILI9341_t3.h>
#include <font_Arial.h> // from ILI9341_t3
#include <XPT2046_Touchscreen.h>
#include <SPI.h>

//added libraries
#include <SerialFlash.h>
#include <Audio.h>
#include <SD.h>

#define TFT_DC 3
#define TFT_CS 0
#define TFT_RST 255 // 255 = unused, connect to 3.3V
#define TFT_MOSI 11
#define TFT_SCLK 13
#define TFT_MISO 12

#define CS_PIN 9
XPT2046_Touchscreen ts(CS_PIN);