TFT 1947 I2C Touchscreen

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
dx160
 
Posts: 17
Joined: Fri Mar 30, 2012 11:36 pm

TFT 1947 I2C Touchscreen

Post by dx160 »

TFT 1947 I2C Touchscreen (Capactive)
I have one of these TFTs. It works fine when mounted on a UNO.
When it lead it out (4-in. 'jumpers') the display still works but the touchscreen does not.
I have swapped and changed out 'jumpers' to no avail.

I have 9, 10, 11, 12, 13, A4, A5, 5V, and 2 GNDs connected.
Again, when wired in this off-the-board manner, the display works but the touchscreen does not.
Is the I2C touchy?
I've had the oscilloscope on it. I see what I presume to be the INIT poll from the UNO (SCL SDA), but that is all.
Touching the screen doesn't result any activity on the I2C lines.

Using the Adafruit GFX and FT6206 library.
how it is
how it is
1947wiring.jpeg (65.86 KiB) Viewed 303 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: TFT 1947 I2C Touchscreen

Post by dastels »

Try connecting to the SDA/SCL pins, not A4/A5. By default A4/A5 are not connected to SDA/SCL.

Dave

User avatar
dx160
 
Posts: 17
Joined: Fri Mar 30, 2012 11:36 pm

Re: TFT 1947 I2C Touchscreen

Post by dx160 »

Thanks for your Reply.
When I do that, the display dims (a lot) with SDA connected.

It works as a module plugged into the UNO.
Running out some wires should be simple enough, but this is where it craters.
I'm using 11, 12, 13 (as opposed to the ICSP).
I have tried with A4/A5 to A4/A5, A4/A5 to SDA/SCL, SCL/SDA to A4/A5, and SDA/SCL to SDA/SCL.
No combination works (it either dims or doesn't boot (white raster)).
I do not understand.
What more do I need than 9-13 (Uno) to 9-13 (TFT), 5V & GND (Uno) to 5V &GND (TFT)?
I need the I2C, too and that's the bugger here.

Is there a diagram that clearly indicates the wiring between the two and which pads to cut or blob?
I have even tried with every UNO pin connected to every TFT pin - and it just does not happen.
Attachments
1947_cuts_blobs.jpg
1947_cuts_blobs.jpg (877.29 KiB) Viewed 287 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: TFT 1947 I2C Touchscreen

Post by dastels »

I2C with the shield should work with SDA<->SDA and SCL<->SCL.

Why do you need it not mounted to the UNO?

Dave

User avatar
dx160
 
Posts: 17
Joined: Fri Mar 30, 2012 11:36 pm

Re: TFT 1947 I2C Touchscreen

Post by dx160 »

Needs to be Remote for my purpose/s.

OK, here it is (The Solution) --

It needs connectivity from SDA/SCL on the long header (the pins north of 13) and RESET.

A) If I have UNO A4, A5, SDA, SCL, 9-13 jumpered over to the TFT points it tanks.
B) With 'SDA', 'SCL', 9 - 13, and Reset going to their corresponding TFT points -- All's Well.
C) There's A4, A5, 'SDA', 'SCL' connectivity with the TFT parked on the UNO, but no "conflict", that doesn't scupper the deal. [Note A]

Don't ask me why.
Attachments
IMG_20220801_091058114.jpg
IMG_20220801_091058114.jpg (92.08 KiB) Viewed 284 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: TFT 1947 I2C Touchscreen

Post by dastels »

Good that you got it going!

Dave

User avatar
dx160
 
Posts: 17
Joined: Fri Mar 30, 2012 11:36 pm

Re: TFT 1947 I2C Touchscreen

Post by dx160 »

Any known issues using the FT6206 library with ESP32?
With SDA/SCL disconnected, the display part of my sketch runs the way I intend.
With SDA/SCL connected it's just a white raster.
Touching inside my "defined area" is supposed to Erase the display (all black), which it attempts to do.

I'm not using the Adafruit GFX because I couldn't figure out how to implement that (specifically via 'VSPI').
I don't see that as the issue, but anyway.

I have 5V/3V level shifters between the ESP32 and the 1947.

Code: Select all

#include <Wire.h>                  // SCL, 22; SDA, 21
#include <Arduino_GFX_Library.h>   // includes in this order
#include "MAX31855.h"              // or disply will not work
#include <Adafruit_FT6206.h>
// The FT6206 uses hardware I2C (SCL/SDA)
Adafruit_FT6206 Touch = Adafruit_FT6206();   // Touch. associated with TouchSensor pad

// Using VSPI for TFT
#define TFT_SCK    18
#define TFT_MOSI   23
#define TFT_MISO   19  // optional (there is no data out of tftDisp)
#define TFT_CS     32
#define TFT_DC     33
#define TFT_RESET  17  // optional, P-UP

#define tcCS1  25      // tcbd1  CS
#define tcCS2  26      // tcbd2  CS

Arduino_ESP32SPI bus = Arduino_ESP32SPI(TFT_DC, TFT_CS, TFT_SCK, TFT_MOSI, TFT_MISO);
Arduino_ILI9341 tftDisp = Arduino_ILI9341(&bus, TFT_RESET);

MAX31855 tcbd1;
MAX31855 tcbd2;

float tRemote_1;
float tRemote_2;

bool RecordOn;
bool yelStat = false;

int xx;
int yy;

int Xpoint = 5;
float cdeg[2];
int cC[2];  // float cdeg[], X 100, and remaining DECimal trunc'd
int lowLimit = 1800;    // This could be a User setting, Y-axis, map()
int highLimit = 3800;   // This could be a User setting, Y-axis, map()

const unsigned long Lockout = 750;
unsigned long debounceMark;

bool yelActive = false;
// ------------------

void setup()
{
  Serial.begin(19200);
  tftDisp.begin();
  delay(3000);
  Serial.println("wait for it");
  
  if (!Touch.begin(40)) // # is sensitivity threshold (40)
  { 
    Serial.println("Touchscreen NAK !");
    //while(1);
  } 
  else 
  { 
    Serial.println("\r\n\r\nTouchscreen started."); 
  }

  tftDisp.fillScreen(BLACK);
  // origin = left,top landscape (USB left upper)
  tftDisp.setRotation(1); 
  //greenBtn();
  
  yelBox();  // defined area, touch-zone

  Serial.print("RecOn ");
  Serial.println(RecordOn);  

  // ---------------
  // HSPI for thermocouple boards
  tcbd1.selectHSPI();
  tcbd1.begin(tcCS1);
  tcbd1.setSPIspeed(500000);

  tcbd2.selectHSPI();
  tcbd2.begin(tcCS2);
  tcbd2.setSPIspeed(500000);

  delay(3000);
  
  Yscale();
}

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: TFT 1947 I2C Touchscreen

Post by dastels »

What level shifters are you using?

Dave

User avatar
dx160
 
Posts: 17
Joined: Fri Mar 30, 2012 11:36 pm

Re: TFT 1947 I2C Touchscreen

Post by dx160 »

The MOSFET type, the bidirectional Phillips-I2C recommended ckt. type.
(Not needing the bi-dir part, but anyway.)
Attachments
3V5VLS.jpg
3V5VLS.jpg (38.78 KiB) Viewed 263 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: TFT 1947 I2C Touchscreen

Post by dastels »

You actually do need the bidirectional part.

How is it wired?

Dave

User avatar
dx160
 
Posts: 17
Joined: Fri Mar 30, 2012 11:36 pm

Re: TFT 1947 I2C Touchscreen

Post by dx160 »

You're right, of course - the I2C is bi-dir.
How is it wired?
The LV# pads get the ESP32 and the corresponding HV# pads go to the appropriate 1947 pin/s.
(The 'HV' gets 5V and 'LV' gets 3V3 from the ESP32.)

This is what I'm doing with --
Attachments
ESP32_1947_bb_01.jpeg
ESP32_1947_bb_01.jpeg (224.16 KiB) Viewed 249 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: TFT 1947 I2C Touchscreen

Post by dastels »

Grounds of the two boards connected and to both grounds of the level shifter?

Dave

User avatar
dx160
 
Posts: 17
Joined: Fri Mar 30, 2012 11:36 pm

Re: TFT 1947 I2C Touchscreen

Post by dx160 »

Oh yes, definitely

User avatar
dx160
 
Posts: 17
Joined: Fri Mar 30, 2012 11:36 pm

Re: TFT 1947 I2C Touchscreen

Post by dx160 »

Dave (dastels) --
Here is a DWG of my circuitry / wiring.
Attachments
ESP32_1947_DWG.png
ESP32_1947_DWG.png (241.54 KiB) Viewed 225 times

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: TFT 1947 I2C Touchscreen

Post by dastels »

Let's recap:
- tft shield directly on UNO works
- tft shield wired top UNO works
- tft shield wired to ESP32 (using 3.3v->5v shifters): SPI (display) works but I2c (touch) doesn't

Right?

What you're doing looks reasonable, but I'm wondering if the 3.3v -> 5v -> 3.3v level shifters (the latter are on the shield) are messing up the I2C signals.

You might want to look for a tft+touch that is 3.3v compatible.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”