Recommendations for 10" TFT Display with touchscreen for Teensy 4.1

Compiled code and got errors for COLOR16M. The compiler graciously made some suggestions to change to COLOR65K and now the compiler is happy.
I wondered about the colors. I have a different sketch that was using those colors, but did not find them in the header files... But
when I clicked on it and asked to show me in sources it showed the same names... At the spot now in header file with 65K...
Guessing @wwatson changed the names, but was still in Arduino cache...

Note: I am still hacking on the touch code. I am going to experiment some with speeding it up. That is I currently read
in enough data from the device for both possible touch, even though I only use one... in this case, so will setup configuration
where I can choose to just read in one.

Also each time I do a read, I tell it to start at register 0... Not sure if I need to do this every time or if will go back to 0 on the next read.
...

I see in your code you have Wire and wire2. I am assuming it it using wire2 because it is a T41 so I changed to pin 8 "#define CTP_INT_PIN 8". I don't see how to set pins for SDA2 and SCL2 or how to git it an address if the touch screen has one. Can you point me in the correct direction
Yes on T4.1 I am using Wire2. As the pins for Wire and Wire1 are used by the FlexIO object that is used for the actual display:
1726922334744.png


If you look at the Teensy card, you will see that Wire2 are on pins 25 and 24.
Wire is on 18 and 19 and Wire1 is on 17 and 16. These are the default pins for the
different Wire objects. Wire1 has a few alternative pins you can see on the back of the
card, but none of those are convenient (On SDCard Adapter and memory pin)

Currently in my code you can optionally pass in which Wire object to use on the begin method:
Code:
if (!ctp.begin(&TOUCH_WIRE)) {
Where earlier I set which one I was using:
Code:
#ifdef ARDUINO_TEENSY41
#define TOUCH_WIRE Wire2
#define CTP_INT_PIN 26
#else
#define TOUCH_WIRE Wire
#define CTP_INT_PIN 22 // 0xff if pin is not connected
#endif

Note: there is really nothing special about my library versus the others. It is mostly just reading data in using I2C.
The only thing mine does that some don't is if you specify an IO pin for the Interrupt, the touched() method will check to
see if it had received an interrupt. If not returns false...
 
I wondered about the colors. I have a different sketch that was using those colors, but did not find them in the header files... But
when I clicked on it and asked to show me in sources it showed the same names... At the spot now in header file with 65K...
Guessing @wwatson changed the names, but was still in Arduino cache...
@wwatson and all... I figured it out... I have both your normal versions of the libraries as well as your 24 bit version of the libraries and
it choose your 24 bit version as they both have the same names for header files and since neither of them are the names of the directory it
is in, not sure if it is just potluck on which one is chosen.

So I removed the junctions (links) to the 24 bit versions...

Code:
Multiple libraries were found for "RA8876_Config_8080.h"
  Used: D:\github\TeensyRA8876-24-Bit-8080
  Not used: D:\github\TeensyRA8876-8080

Edit: Updated sketch...
 

Attachments

  • RA8876_CapTouchPaint-240921a.zip
    6 KB · Views: 21
Last edited:
@wwatson and all... I figured it out... I have both your normal versions of the libraries as well as your 24 bit version of the libraries and
it choose your 24 bit version as they both have the same names for header files and since neither of them are the names of the directory it
is in, not sure if it is just potluck on which one is chosen.

Code:
Multiple libraries were found for "RA8876_Config_8080.h"
  Used: D:\github\TeensyRA8876-24-Bit-8080
  Not used: D:\github\TeensyRA8876-8080

Edit: Updated sketch...
Good to here. Was hoping that there was no cross contamination on my part:D
 
@DJETH - I ran it at 4, 20, 40, 60 and 120mhz for the bus speed. 4 mhz was slower but 20 - 120 mhz I did not notice any time difference... the speeds were the same.
The buss speed is limited to how fast the RA8876 processes internal operations. This function:
Code:
//**************************************************************//
/*[Status Register] bit3   Core task is busy
Following task is running:
BTE, Geometry engine, Serial flash IRQ, Text write or Graphic write
0: task is done or idle.   1: task is busy
A typical task like drawing a rectangle might take 30-150 microseconds,
    depending on size
A large filled rectangle might take 3300 microseconds
*****************************************************************/
void RA8876_common::check2dBusy(void) {
    ru32 i;
    for (i = 0; i < 100000; i++) { // Please according to your usage to modify i value.
        delayMicroseconds(1);
        if ((lcdStatusRead() & 0x08) == 0x00) {
            return;
        }
    }
    Serial.println("2D ready failed...");
}
is used throughout the driver. So 20MHz appears to be the fastest effective buss speed...
 
wwatson,
Thanks for the clarification on the buss speed... Plenty fast enough for me... your library works great and has saved me a ton of time.

KurtE and wwatson,
downloaded the latest code (thanks KurtE) and am just starting to looking to see why my I2C is not working. I noticed that there is a regular pulse on the interrupt pin (pin 33 display - pin 8 on my T41). Maybe it is just on my set up but the pulse was there before I changed the interrupt pin to pin 8 in the sketch. And after. The pulse looks like it comes from the display itself. My question is... every time the 225us pulse occurs does it interrupt the program? or does it look for the wider 800us pulse when the screen is touched? The 225us pulse occurs every 41ms.
Green is the interrupt pin.
Screenshot 2024-09-21 132052.png


Screenshot 2024-09-21 132426.png

Screenshot 2024-09-21 132846.png
 
Quick update...
I did get the display to respond using the "GT9271_teensy_Touch" sketch in the "Arduino-goodix-GT9271-main" library.
Learned some things...
when the touchscreen is turned on it uses the interrupt and reset pins to set the display chip I2C address. I connected the T41 pin 9 to the I2C reset pin 36 of the display. I also set that pin 9 in the sketch
Code:
#define RST_PIN 9 // 255 means do not use reset pin else reset using pin number.
I could not make the display work with the addresses 0x5D or 0X14. using the reset pin changes the way the address in the GT9271 is set and it causes problems. I set the code back to
Code:
#define RST_PIN 255 // 255 means do not use reset pin else reset using pin number.
and address 0x5d works. The frustrating part is the GT9271 manual has 4 possibilities for addresses (see code below) but they are 8 bit addresses and this I2C uses 7 bit addresses. Luckily for me wwatson made a note about this in the .cpp file saving me the loss of hair.
Code:
  /* HIGH: 0x28/0x29 (0x14 7bit), LOW: 0xBA/0xBB (0x5D 7bit) */
  digitalWrite(intPin, i2cAddr == GOODIX_I2C_ADDR_BA);

after the CTP started communicating with the T41 the constant 41ms pulses (as seen in previous post) on the interrupt stopped. in the scope picture below when the green trace pulses low i an rubbing my finger on the CTP.
The blue trace is the clock - Red is data - Green is Interrupt and Yellow is/was the reset.
There is a loop function that does something in the I2C data steam every 100ms that is why Clock and Data keep cycling.

Screenshot 2024-09-21 210000.png


Screenshot 2024-09-21 210211.png
 
Sorry, it looks like my 7” and your 10” BuyDisplay RA8876 displays use different touch controllers…
I should have guessed once you mentioned the name of the library you were trying.
 
Back
Top