Errors using BT817 EVE4 display sample program from arduino to Teensy 4.1

walrus20

Member
Hello. I have this Riverdi 4.3" capacative display. Datasheet link. BT817 chip programming guide.

I have used the Riverdi ardunio uno shield with this riverdi sample app/program to start. This one is similar to the Rudolf library. I also was able to successfully make this sample program into one that works for my uno (adding a temp sensor, an external button, my own display lists of menus/touch options, etc).

I want to use this on my 4.1 so I can add more sensors/do more than how restricted I am using the uno and its add-on shield, but I get errors when I connect this display to my 4.1, and I do not really understand these errors.

I tried to follow this post here, but was unsuccessful in my attempts.

I used this 20pin display cable breakout board to connect it to my teensy.

This is how I connected it to my 4.1
display/breakout4.1
3 SPI_SCLK13
4 MISO12
5 MOSI11
6 CS10
relevant 3.3v logic/5vbacklights/gnds correctly connected to psu

For the 4.1, I cut the power line from the microUSB to usb and power the 4.1 (and any other periphereal) via my PSU.

The main errors I get when I connect this and try to compile this from the arduino IDE (new and old versions):
1. buffer and prog_uchar errors
2. GPIO_CS and GPIO_PD errors

Link to Gpu_Hal.h prog_uchar8_t and buffer error location
Link to the CS/PD error location
Link to the platform.h file (where the board specs are configured)
  • Gpu_Hal.h:309:65: error: 'prog_uchar8_t' has not been declared and Gpu_Hal.h:309:80: error: section attribute not allowed for 'buffer'
    • Code:
      void Gpu_Hal_WrCmdBufFromFlash(Gpu_Hal_Context_t *host, PROGMEM prog_uchar8_t *buffer,uint32_t count);
    • many errors involving the buffer "section attribute" and "prog_uchar8_t"
  • App_Common.cpp:253:9: error: 'prog_uchar8_t' does not name a type; did you mean 'prog_uchar'?
    253 |
    Code:
    PROGMEM prog_uchar8_t logo_graphics[6224] = {
    | ^~~~~~~~~~~~~
    | prog_uchar
    • ****** I don't use this logo/image map in my program. This is a default included one for the sample.
  • Gpu_Hal.cpp:49:11: error: 'GPIO_CS' was not declared in this scope
    49 |
    Code:
    pinMode(GPIO_CS, OUTPUT);
  • Gpu_Hal.cpp:52:11: error: 'GPIO_PD' was not declared in this scope
    52 |
    Code:
    pinMode(GPIO_PD, OUTPUT);

1. My plan is to tinker around with the erorrs and see if I can figure out how to intialize this program for my teensy 4.1; I think it's with the platform.h file.
2. Otherwise, I saw this GDSTx library often in the thread I linked above and will try to use my 4.1 with it.
3. There is another riverdi example for this display just for the esp32 so I can look up how to flash the program w/o relying on the arduino environment.

Thanks for any input in advance. Let me know if you need any more info.
 
Very good TFT you have achieved. Let's see if from a distance we can get it to work with that teensy 4.1.

Please, the first thing is to upload some photos of your TFT-teensy arrangement, to see how you want to connect it.

You must take great care of the flexible cable of that type of TFT. If possible, get a shorter cable, 10 cm, to improve connection speed and minimize communication errors. The cable that comes standard is long, it works, but the ideal is that we can squeeze as much as possible out of the BT817 chip, which is very fast.

Although GDSTx does not provide access to flash memory, it compensates for this limitation by allowing access to the teensy 4.1's ultra-fast microSD reader.

Calm down, we are going to get that TFT to work at full capacity!
 
Hey TFTLCDCyg,
I used your comment from here to set up the connections from my display to my 4.1. Like your pictures, I did a similar setup like you did here. I use the same 20pin cable that goes to a breakout board, which then is soldered onto a breadboard with the connections going to my teensy. My cable isn't more than 15cm.
 
Ok, apparently it must be something in the library. In the congif.h file, what configuration did you use? Did you modify any variables?

For teensy 4.1, this is what the library has when it is downloaded from the repository:

Code:
#ifdef TEENSYDUINO

    #define SizeEVE              74   // NHD: 7-7",  5-5", 43-4.3", 35-3.5", Riverdi: 51-5", 71-7", MO: 38-3.8"FT813, MO: 52-5"BT815, MO: 53-5"FT813, Riverdi: 54-5"  BT817, 0 Riverdi FT801/FT800 4.3", Riverdi: 100-10" BT817
                                     // 431-EVE3x-43 MO   Riverdi: 74-7"  BT817
    
    #define ORIENTACION          0   // 0, 1, 2, 3, FT81X/BT81X   0 normal 
    #define ROTACION             0   // 0,1         FT80x

    #define CS                     10   // general
    #define SetSPISpeed   36000000   // general
    #define NHDTouch              1   // 1 cargar rutinas panel táctil    0 NHD normal aparentemente no lo requiere?¿
    #define GameduinoX           0   // 1 gameduinox shield instalado  0 otros como NHD43 o FT843
        
#endif
 
The timing table on the 4.3" BT817 is different than the 5" BT817. I updated the GDSTx library with the table corresponding to the TFT that you have, it is in the datasheet. Since there are 14 parameters, of which 8 have a maximum, minimum and recommended value, I chose to assign the recommended parameter. These times table values determine that the RGB colors and pixel drawing order are appropriate.

To determine that the colors and shapes drawn on the TFT are correct, you should use this example:

Code:
#include <GDSTx.h>

void setup() {
  GD.begin();
}

void loop()
{
  GD.Clear();
  GD.cmd_testcard();
}

BT817-5.jpg

You should see an image similar to this, these are the correct colors and shapes that should be seen on each drawn widget. It is specific for the BT817 chip, other chips do not have this test such as the FT813 for example.

Do not modify anything in config.h, the constructor for your TFT, the 434 variant (4.3" BT817), is already defined.

Please make sure that the PD pin of the TFT is connected to pin 24 of the teensy 4.1 board, as it is needed for the software reset to clean the GRAM memory of the TFT, during the configuration of the screen registers that does the library.
 
Last edited:
Share some photos to see if the settings work as they should, and to be able to adjust something else in case something goes wrong. For the Riverdi 5" BT817 display. I used this bracket:
BT817 (1).png
BT817 (2).png
BT817 (3).png
 
Hello TFT,
Thanks for checking up.
I had to go away for work for a few weeks, but I am back to working on this. For my 4.1, I tried the riverdi sample linked above (fixed the code I think), the rudolph, and yours, but the screen never showed any power or anything working. The 4.1 is still working when I test it with the sample blink program.

I think I need to follow your example and add resistors to the SPI lines because the UNO shield attached to the UNO board all successfully works and shield's datasheet says each of the display pins that connect to the UNO are " Internally 47k Pull UP" and you also mentioned having to do the same thing with 10k resistors.

I am going to go solder up a breadboard like posted in the other thread and test it out with the 3 libraries.
 
Back
Top