Recommendations for 10" TFT Display with touchscreen for Teensy 4.1

I will setup my logic analyzer with a T4.1 and retest. I have tested this before and it was sending and receiving 16Bits.
I did go into the RA8876_t41_p.cpp file and on lines 87 I changed
#define BUS_WIDTH 8 to
#define BUS_WIDTH 16 - No change
There is no need to change the buss width in RA8876_t41_p.cpp. That is part of the initialization process. It is overridden by "setBusWidth(16)". Also, I noticed that bit 10 is held high while the other 7 upper bits are low. Try running "RA8876_pictureEmbed.ino" with "RA8876_8080_BUS_WIDTH" set to 16 in "RA8876_Config_8080.h". Something to remember is all RA8876 register reads and writes are always 8 bit. Only RA8876 frame buffer memory can be 8 or 16 bit read/write.

I have errands to run this morning but will test this issue when I get back...
 
Serial.begin(115200);
while (!Serial && millis() < 1000) {} //wait for Serial Monitor
delay(5000);
// Set 8/16bit bus mode. Default is 8bit bus mode.
tft.setBusWidth(16); // RA8876_8080_BUS_WIDTH is defined in
// src/RA8876_Config_8080.h.
tft.begin(20); // RA8876_8080_BUS_WIDTH is defined in
// src/RA8876_Config_8080.h. Default is 20MHz.
delay(5000);
I have not played as much with the currently updated code. Been hacking on some other drivers...

But plugged in my RA8876 into DevBrd5... and synced up and built for 16 bits and I am getting image in picture viewer sketch...

Note: the code in this sketch looks like:
Code:
    // Set 16bit mode
    tft.setBusWidth(16);
    // DB5.0 WR pin, RD pin, D0 pin.
    tft.setFlexIOPins(RA8876_WR, RA8876_RD, RA8876_D0);
    tft.begin(busSpeed);  // 20 is working in 8bit and 16bit mode on T41
    delay(100);
So I have it set the display to 16 bit mode.
I then tell it to compute the FlexIO data pins... Not sure if your default pins have all 16 configured into it?
But this call ( tft.setFlexIOPins(RA8876_WR, RA8876_RD, RA8876_D0); )
Will set the RD and Write and D0 to the ones specified and then compute D1-D15 (or D7 in 8 bit mode)

And then I tell the display to begin.
 
@DJETH - Verified that 16Bit buss in 8Bit or 16Bit mode is working. I only have an 8Bit LA so I hooked it up to the upper 7 data lines and used the 8th line on the LA for the "/CS" pin for triggering:
16bit_buss_testing.jpg

Here is the test sketch I used that you can also use to test with:

Code:
// testing.ino

#include "RA8876_Config_8080.h"
#include <RA8876_t41_p.h>

// RA8876_8080_DC, RA8876_8080_CS and RA8876_8080_RESET are defined in
// src/RA8876_Config_8080.h.
RA8876_t41_p tft = RA8876_t41_p(RA8876_8080_DC,RA8876_8080_CS,RA8876_8080_RESET);

void setup() {
  while (!Serial && millis() < 3000) {} //wait for Serial Monitor
  Serial.printf("%c RA8876 parallel 8080 mode testing (8/16Bit/DMA)\n\n",12);

 
  // Set 8/16bit bus mode. Default is 8bit bus mode.
  tft.setBusWidth(RA8876_8080_BUS_WIDTH); // RA8876_8080_BUS_WIDTH is defined in
                                          // src/RA8876_Config_8080.h.
  tft.begin(BUS_SPEED); // RA8876_8080_BUS_WIDTH is defined in
                        // src/RA8876_Config_8080.h. Default is 20MHz.

  Serial.print("Bus speed: ");
  Serial.print(BUS_SPEED,DEC);
  Serial.println(" MHZ");
  Serial.print("Bus Width: ");
  Serial.print(tft.getBusWidth(),DEC);
  Serial.println("-bits");
}

void loop() {
  waitforInput(); // Wait for input from serial console.
  tft.lcdDataWrite16(0xffff,true); // Write 16bit value to 16bit data buss.
}

void waitforInput()
{
  Serial.println("Press anykey to continue");
  while (Serial.read() == -1) ;
  while (Serial.read() != -1) ;
}
It does a single 16Bit write of 0xffff to the FlexIO bus.
In 8Bit mode:
Data9-15_8Bit_Buss_Data8_CS.png

And in 16Bit buss mode:
Data9--15_16Bit_buss_Data8_CS.png

Try running the above sketch on your setup to see if you get the same results. It does a direct 16Bit write to the FlexIO buss using "tft.lcdDataWrite16(0xffff,true);" Just change:
Code:
// Select 8 or 16 for your bus width.
#define RA8876_8080_BUS_WIDTH 8
To:
Code:
// Select 8 or 16 for your bus width.
#define RA8876_8080_BUS_WIDTH 16
in the "src/RA8876_Config_8080.h" file to switch to 16Bit buss.

Hopefully this works for you as well :) And if it does not I would double check your wiring...
 
Thank you both for your fast response and the detailed help. I will test everything this evening and post my results.
 
KurteE and WWatson - Thanks for the code and your help. After my tests I learned a lot which brings on more questions...

I ran your test setup program and I do get 16 bits in 16 bit mode... 8 bits in 8 bit mode... great test to have.
In the RA8876_PictureEmbed.ino I did get 8 bits in the setup and first part of the program and then 16 bits.

I did add some delays in the first part in the loop and I get a green screen with "Rotation 0" in the middle of the screen. The data logger is telling me that everything to this point is 8 bit. after the "drawImage(240, 320, (uint16_t *)teensy40_pinout1, RED, false);" goes to 16 bit I loose my screen and I get a flicker. I have either too much noise, some wires crossed, or wires/soldier joints touching. I am going to use your test program and change the hex value to pulse the pins in different sequences to make sure they are correct, then chase the noise.

Something to remember is all RA8876 register reads and writes are always 8 bit. Only RA8876 frame buffer memory can be 8 or 16 bit read/write.
This is exactly what was happening and why I did not gate 16 bits in the other programs I ran.

Screenshot 2024-09-15 171004.png


Scope set up 8 bit record - Blue D0 - Red D1 - Green D8 - Yellow D12 ------ Just showing you the noise
Screenshot 2024-09-15 174242A.png


FYI... I was getting an error "Compilation error: font_ComicSansMS.h: No such file or directory" for line 10 in the picture embed program. I changed: font_ComicSansMS.h to _font_ComicSansMS.h and it compiled

If you all start selling the dev boards put me down for a couple. Also if you have a shield that connects directly to the display for sale let me know...

When I was running the pictureEmbed program in 8 bit and 16 bit modes I noticed there is not much difference in time when
drawImage(240, 320, (uint16_t *)teensy40_pinout1, RED, false);
is run. 16 bit is about 10% faster

I commented out most of the loop so the program would just run a test section so I would see the same data repeated.
void loop(void) {
uint16_t *rotated_image = nullptr;
Serial.printf("Set Rotation(%d)\n", rotation);
tft.setRotation(rotation);
tft.setFont(ComicSansMS_24);
tft.fillScreen(RED);
tft.setCursor(tft.width() / 2, tft.height() / 2, true);
tft.setTextColor(GREEN);
tft.printf("Rotation: %d", rotation);
delay(5000);

if (DelayOrStep()) return;
rotation = (rotation + 1) & 0x3;
Serial.print("Display Front of card ");
drawImage(240, 320, (uint16_t *)teensy40_pinout1, RED, false);
if (DelayOrStep()) return;
delay(5000);
////////////////////////////////////////////////////////////////////// Commented out below
/*
Serial.print("Display Back of card ");
drawImage(240, 320, (uint16_t *)teensy40_pinout2, GREEN, false);
if (DelayOrStep()) return;
#if defined(__IMXRT1062__)
Serial.print("Display T4.1 Extended card ");
drawImage(575, 424, (uint16_t *)teensy41_Cardlike, BLUE, false);
if (DelayOrStep()) return;
#elif defined(ARDUINO_TEENSY36)
Serial.print("Display Talldog T4 card ");
drawImage(400, 272, (uint16_t *)td_t4_top, BLUE, false);
if (DelayOrStep()) return;
#endif
#if defined(__IMXRT1062__) || defined(ARDUINO_TEENSY36)
Serial.print("Display front of chip ");
drawImage(240, 320, (uint16_t *)teensy40_front, BLUE, false);
if (DelayOrStep()) return;
#endif
// lets try to pre rotate image and see if it speeds up
#if defined(__IMXRT1062__)
Serial.print("Display rotated T4.1 Extended card ");
rotated_image = tft.rotateImageRect(575, 424, (uint16_t *)teensy41_Cardlike);
drawImage(575, 424, (uint16_t *)rotated_image, DARKGREEN, true);
#elif defined(ARDUINO_TEENSY36)
Serial.print("Display TallDog T4 pre rotated Card ");
rotated_image = tft.rotateImageRect(400, 272, (uint16_t *)td_t4_top);
drawImage(400, 272, (uint16_t *)rotated_image, DARKGREEN, true);
#elif defined(ARDUINO_TEENSY35)
Serial.print("Display TallDog T4 pre rotated Card ");
rotated_image = tft.rotateImageRect(240, 320, (uint16_t *)teensy40_pinout1);
drawImage(240, 320, (uint16_t *)rotated_image, DARKGREEN, true);
#endif
if (rotated_image) free(rotated_image);
if (DelayOrStep()) return;
*////////////////////////////////////////////////////////////////////
} // End of Void Loop
8 bit mode - Drawimage data ONLY - Note: I have may scope connected to the two channels that have noise - there is NO display connected - T4.1 on breadboard only - similar times were noted with the other T4.1 with my display board connected to the display.
Screenshot 2024-09-15 183049A.png


16 bit
Screenshot 2024-09-15 181648A.png



If what I see is true and there is not much difference between 16 bit and 8 bit and most of the communication would be 8 bit I am thinking 8 bit is the way to go. I not sure I have the skill to get 16 data lines + 4 for WR RD CS ... quiet enough to be reliable. I think I have half a shot at 8bit + 4.
Please let me know if I am reading the data correct I figured 16 bit would be almost half the speed if not faster.

Now I understand the draw to go SPI... not as may lines to have to fight the noise on...

Thanks again for your help,
DJETH
 
@DJETH - Long conductors can cause noise on the signals. Typically my leads are 3.5" to 4" max. I noticed on your setup there is quite a bit of length between the T41 and RA8876 display. SPI comms are also affected by noise with long leads...
 
If you want a slightly lower-tech solution, I would recommend a:

NEXTION INTELLIGENT HMI DISPLAY

They use a TTL serial interface to pass metadata back and forth based on the user's actions. Micro programs run in the display to handle all screen and form elements except for some data input parsing. The panels are programmed with a GUI Windows Utility and run separately from your microcontroller. Essentially, it is the same stuff used in industrial machinery. The price point is about $150 ea with free software and runtime. I'm pretty sure there are already documents for using a Nextion in an Arduino IDE. They are manufactured out of China by Seeed Studios. Make sure you buy a FOCA MAX to set up a panel. Otherwise, it can be a mess due to the high amperage requirements for the backlight. TTL interfaces can be more forgiving on wiring since you typically keep the speeds closer to 115kbps.
 
I use the Nextion display on a number of my projects.
I find them excellent, you can even offload simple routines to the display whilst the Teensy get's on with more complex stuff.
I have written a skeletal driver, now up to version 2, for them which can be seen here.

I did a write up on this forum some time ago, look here.
 
If you all start selling the dev boards put me down for a couple. Also if you have a shield that connects directly to the display for sale let me know...
I hear you... When I started playing the the RA8875 and later the RA8876, I was always having problems with my wiring... And that was
SPI...

So I have my own board I plug into back of it…

@DJETH - Long conductors can cause noise on the signals. Typically my leads are 3.5" to 4" max. I noticed on your setup there is quite a bit of length between the T41 and RA8876 display. SPI comms are also affected by noise with long leads...

IMG_0703.jpeg

nothing fancy but allows me too play.

with the parallel and devboard5 I put a connector on shield. Also @mjs513 hacked up an adapter for T4.1 that plugged into simple board that @PaulStoffregen made with 3 or 4 or 5 rows of teensy pins that make it easy to experiment… not sure if they are up on oshpark or not…

IMG_0704.jpeg

shows both ways although bottom one is using different adapter for ili9488 or in this cas nt35510

Edit: should mention again, I only do this for the fun of it... So boards usually have problems (I am a
retired software guy and not an EE).

So I don't sell anything, but usually keep most of these boards up on github, including gerber files that can be sent to OSHPark or PCBWay or...
 
WWatson,

I forgot to mention... You stated
Also, I noticed that bit 10 is held high while the other 7 upper bits are low.
Good catch... Not your first rodeo... I mistakenly had the LA lead on the 3.3volt supply and not pin 25. Thank you for pointing that out.

Whitebengal and BriComp,
Thanks for the info on the Nextion displays... I looked and the 10.1" and your version 2 driver. If I can't get the one I have to work then I will give it a try.

KurtE,
I circled a couple of things on your display board. What do those do? Can you send me the link to the board?

So I don't sell anything, but usually keep most of these boards up on github, including gerber files that can be sent to OSHPark or PCBWay or...

IMG_0703A.jpeg
 
KurtE,
I circled a couple of things on your display board. What do those do? Can you send me the link to the board?



View attachment 35790
I am looking through some of the files I have on my computer... Not 100% sure if I uploaded this version or not...
Some of the versions of the boards are up at:

Just made sure they were uploaded. The zip files are in the file: T4 RA8875-6 Touch Shield simple V02_gerber.zip

I am pretty sure it is this version: Just loaded up in Diptrace... Never fleshed out the 3D components on this one, but
...


1726502211226.png

Now to your questions:
The part you circled on the left hand side, are my set of jumpers. On this board, I wanted to be able to
experiment with different pins, like maybe different SPI port. So then used a set of shunts to jumper the defaults.

A few of them were different depending on which RA8875 you could jumper a couple different ways as differences
in touch screens.

The part on the right, was the ability to plug something else in, like an Audio board. In this case, at one point we
were doing a lot of different experiments with different flash chips and LittleFS and the like. That little board
was setup with 4 different Flash chips, and the pins that had rectangles around them were the pins that
actually used. I believe this one is one that Paul did back then. I also have some that I did, with larger chips, that my
older eyes and hands could more easily solder:
1726502798925.png


EDIT: but use at your own risk... That is I don't remember how much of the other things on the board I tested. Like I never on this one soldered
the QWIIC connectors, don't remember if I did not do it because they were screwed up, or simply I did not get arount to it.
 
@DJETH - I decided to test the difference in transfer speeds between 8Bit buss and 16Bit buss displaying this image:
16-bit_DMAgood_12_good.jpg


Using this sketch:
Code:
// testing.ino

#include "RA8876_Config_8080.h"
#include <RA8876_t41_p.h>
#include "Teensy41_Cardlike.h"

// RA8876_8080_DC, RA8876_8080_CS and RA8876_8080_RESET are defined in
// src/RA8876_Config_8080.h.
RA8876_t41_p tft = RA8876_t41_p(RA8876_8080_DC,RA8876_8080_CS,RA8876_8080_RESET);

void setup() {
  Serial.begin(115200);
  while (!Serial && millis() < 1000) {} //wait for Serial Monitor

  // Set 8/16bit bus mode. Default is 8bit bus mode.
  tft.setBusWidth(RA8876_8080_BUS_WIDTH); // RA8876_8080_BUS_WIDTH is defined in
                                          // src/RA8876_Config_8080.h.
  tft.begin(BUS_SPEED); // RA8876_8080_BUS_WIDTH is defined in
                        // src/RA8876_Config_8080.h. Default is 20MHz.

  tft.fillScreen(BLACK);
  Serial.println("Test transfer speed difference between 8Bit bus and 16Bit bus\n");

  Serial.print("Bus width is ");
  Serial.println(RA8876_8080_BUS_WIDTH);
  Serial.print("Bus speed is ");
  Serial.println(BUS_SPEED);

  elapsedMillis em = 0;
  tft.writeRect(10, 10 , 575, 424, teensy41_Cardlike);
  Serial.print("Rendering 487600 bytes took ");
  Serial.print(em,DEC);
  Serial.println("ms");
}

void loop() {

}

8Bit buss:
Code:
Test transfer speed difference between 8Bit bus and 16Bit bus

Bus width is 8
Bus speed is 20
Rendering 487600 bytes took 66ms
16Bit buss:
Code:
Test transfer speed difference between 8Bit bus and 16Bit bus

Bus width is 16                                                                                               
Bus speed is 20                                                                                               
Rendering 487600 bytes took 36ms

So it looks like 16Bit transfers are ~30 milliseconds faster than 8Bit which is more than 10% faster...
 
KurtE... interesting shield... Thanks for sharing the link. I tried to press on it to download and it is not working... I will try it again later to see if it works
Just made sure they were uploaded. The zip files are in the file: T4 RA8875-6 Touch Shield simple V02_gerber.zip
Understood...
but use at your own risk...

wwatson... well again I have more questions....
I ran your sketch and I agree 16 bit is quite a bit faster than 8 bit. I must have done something wrong before. I did finally get the display to show the picture from your sketch in 8 bit mode. That's the first picture I have been able to get to come up. Interesting thing is my speeds were way faster than yours... are you using a different Teensy than the 4.1? Or did I change something somewhere that I should not have. when the serial monitor showed the results it always show 8 bit even if it is 16 bit so maybe the bus speed is not 20 but 40. I will have to do some checking. I ran it several times in 8 bit and 16 bit

Based off of these results I going to keep working on the 16 bit display board... wwatson thanks for keeping me straight.

Code:
Rendering 487600 bytes took 38ms
Test transfer speed difference between 8Bit bus and 16Bit bus

Bus width is 8
Bus speed is 20
Rendering 487600 bytes took 38ms
Test transfer speed difference between 8Bit bus and 16Bit bus

Bus width is 8
Bus speed is 20
Rendering 487600 bytes took 22ms
Test transfer speed difference between 8Bit bus and 16Bit bus

Bus width is 8
Bus speed is 20
Rendering 487600 bytes took 38ms
Test transfer speed difference between 8Bit bus and 16Bit bus

Bus width is 8
Bus speed is 20
Rendering 487600 bytes took 22ms
Test transfer speed difference between 8Bit bus and 16Bit bus

Screenshot 2024-09-16 181025.png

Screenshot 2024-09-16 175207.png

Screenshot 2024-09-16 181328.png


Reminder the Trigger is 5.5ms after 0
 
In "src/RA8876_Config_8080.h" were you changing:
Code:
// Select 8 or 16 for your bus width.
#define RA8876_8080_BUS_WIDTH 8
to:
Code:
// Select 8 or 16 for your bus width.
#define RA8876_8080_BUS_WIDTH 16
Using my sketch? This has to happen before you call "tft.begin(BUS_SPEED)" and if changed you need to recompile the sketch. you cannot change it on the fly in the sketch...
 
Last edited:
I was using your sketch and I set the tft.setbuswidth(8 or 16) in the sketch not the "src/RA8876_Config_8080.h" file. Look above at the picture in my last post with the Arduino IDE in it. I am running your sketch at 16 bit and the serial window shows:

Code:
Test transfer speed difference between 8Bit bus and 16Bit bus



Bus width is 8

Bus speed is 20

Rendering 487600 bytes took 22ms

shows 8 bits But it is running 16 bits and set for 16. The 37ms ones are the 8 bit. I just thought it was interesting that my rendering speeds were faster. The rendered picture did display but only in 8 bit. 16 bit it gave me a blank screen. But still pretty happy that it displayed.

1000006242B.jpg


from my src/RA8876_Config_8080.h file.

Code:
/* RA8876_Config.h
 A file to place user defines and configs.
*/

#ifndef RA8876_CONFIG_H
#define RA8876_CONFIG_H

// Select 8 or 16 for your bus width.
#define RA8876_8080_BUS_WIDTH 8

// Set the bus speed in megahertz.
#define BUS_SPEED 20 //Available settings 2,4,8,12,20,24,30,40,60,120

//External backlight control connected to this Arduino pin
// Otherwise 3.3v
//#define BACKLITE 5 or change to your pin choice

in your sketch I added my backlight (pin33) and added the picture I was testing with when I got my erroneous results
below is your sketch with my additions. I put both pictures into the same folder as the .ino for your sketch. the "teensy40_pinout1.h" renders at the same speed as the cardlike.h but I only get garbage on the display even on 8 bit. I am starting to work on version 2 of my display board.

Code:
// testing.ino

#include "RA8876_Config_8080.h"
#include <RA8876_t41_p.h>
#include "Teensy41_Cardlike.h"
#include "teensy40_pinout1.h"
int TFT_Backlight_Pin = 33;
// RA8876_8080_DC, RA8876_8080_CS and RA8876_8080_RESET are defined in
// src/RA8876_Config_8080.h.
RA8876_t41_p tft = RA8876_t41_p(RA8876_8080_DC,RA8876_8080_CS,RA8876_8080_RESET);

void setup() {
    digitalWrite(TFT_Backlight_Pin, HIGH);
  Serial.begin(115200);
  while (!Serial && millis() < 1000) {} //wait for Serial Monitor

  // Set 8/16bit bus mode. Default is 8bit bus mode.
  tft.setBusWidth(8); // RA8876_8080_BUS_WIDTH is defined in
                                          // src/RA8876_Config_8080.h.
  tft.begin(BUS_SPEED); // RA8876_8080_BUS_WIDTH is defined in
                        // src/RA8876_Config_8080.h. Default is 20MHz.

  tft.fillScreen(BLACK);
  Serial.println("Test transfer speed difference between 8Bit bus and 16Bit bus\n");

  Serial.print("Bus width is ");
  Serial.println(RA8876_8080_BUS_WIDTH);
  Serial.print("Bus speed is ");
  Serial.println(BUS_SPEED);

  elapsedMillis em = 0;
  tft.writeRect(10, 10 , 575, 424, teensy41_Cardlike);
   //tft.writeRect(10, 10 , 575, 424, teensy40_pinout1);
  Serial.print("Rendering 487600 bytes took ");
  Serial.print(em,DEC);
  Serial.println("ms");
}

void loop() {

}
 
@DJETH - If you look at the sketch where it prints out the buss width you see this:
Code:
  Serial.print("Bus width is ");
  Serial.println(RA8876_8080_BUS_WIDTH); <<-------------- RA8876_8080_BUS_WIDTH
So if it is not changed to 16 in "src/RA8876_Config_8080.h" file it will always show a buss speed of 8. You are setting it manually in the sketch with:
Code:
tft.setBusWidth(8);
and:
Code:
tft.setBusWidth(16);
so it is actually changing the the buss width but it is not changing what is printed for Serial.print("Bus width is");. The "RA8876_8080_BUS_WIDTH" define is only used in sketches at this time. That is why you were actually seeing a difference in transfer speed between 8 and 16 bit buss.
If you use:
Code:
tft.setBusWidth(8);
or:
Code:
tft.setBusWidth(16);
you need to also change what the buss speed is with:
Code:
 Serial.println(8);
or:
Code:
 Serial.println(16);

Forgot to mention that I am using the Dev Board version 5. Hopefully this clears up the confusion :D
 
KurtE and wwatson,

Just an update... Again I would like to thank you both for taking the time to help me get started learning about TFT displays. You have shortened my learning curve tremendously. I took everyone's advice and made a ver2 of the display board without the ribbon and shortened the leads. The display now runs at 8 or16 bit without any issues and the scope waveforms have way less noise.
Next step is the Capacitive touch screen. I will start by using the goodix library that wwatson modified. If you have any advice it would be appreciated.
1000006243A.jpg
 
Looks like you have made great progress! I have found "bread boarding" a prototype, whilst quick, can cause lots of inconsistant phantom issues which you can waste hours trying to solve.

How long does the screen take to render the above picture? (which I guess is not the complete screen resolution)
 
KurtE and wwatson,

Just an update... Again I would like to thank you both for taking the time to help me get started learning about TFT displays. You have shortened my learning curve tremendously. I took everyone's advice and made a ver2 of the display board without the ribbon and shortened the leads. The display now runs at 8 or16 bit without any issues and the scope waveforms have way less noise.
Next step is the Capacitive touch screen. I will start by using the goodix library that wwatson modified. If you have any advice it would be appreciated.
I hacked up my own library which I am trying on ili9486 and here on NT35510
IMG_0706.jpeg

soon will try on ra8876
 
Turby,
The above picture is actually 3 pictures stacked on top of each other so I made another that uses full screen that takes 51ms.
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.
1000006399a.jpg



KurtE,

let me know how it goes... and if you want to share.... I was looking at the Arduino-goodix-GT9271-main library that wwatson has late last night and it appears I will need to combine it with the RA8876 library to display where the display is touched. I'll look it over later this weekend and see what I can break.
 
The code is up in our (@mjs513 and my) libraries:
Right now it is in that library, could be moved...

Showing the usage of it are the two paint programs that are in our two libraries derived from the main class of that github project.

The sketch that did the above paint program...

It can be cleaned up. I started first with the Adafruit library which failed in the begin... Easy to fix that by commenting out the tests.
But then decided to do it as a cross between this one and the one that Sumotoy did earlier... and Not have it return a structure.
instead I pass references to X and Y return values... But then hacked those into struct...
 
Here is a quick hacked up version of the finger painting sketch, where I put the touch library files as tabs in the sketch.

IMG_0708.jpeg
 

Attachments

  • RA8876_CapTouchPaint-240920a.zip
    5.9 KB · Views: 29
KurtE,
well that was fast... Thanks for helping.
alright here is what I have so far...
Compiled code and got errors for COLOR16M. The compiler graciously made some suggestions to change to COLOR65K and now the compiler is happy.

I have not used I2C yet but I can learn.
The pins I have physically connected to the display:
Display-------------->T41
- CPT INT 33 __________> 08 - Interrupt for touchscreen
- CPT SDA 34 __________> 25 - I2C SDA2
- CPT SCL 35 __________> 24 - I2C SCL2
- CPT RST 36 __________> 09 - I2C Reset
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

Ran the code and I have a red almost orange screen
From the serial monitor:
Cap Touch Paint!

Teensy4.1 - 24

Pin 27, 1

Before tft.begin

Before displayInfo



*** Start Touch controller ***

Couldn't start FT6236 touchscreen controller
 
Back
Top