Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: Problem with ER-TFTM101-1

  1. #1
    Junior Member
    Join Date
    Oct 2021
    Posts
    5

    Problem with ER-TFTM101-1

    Hi everyone, I take this first post to introduce myself, my name is Andrea and I come from Italy.

    A few days ago I bought a Teensy 3.6 board and I'm really impressed by her power (better than the Arduino boards I had) but i have a problem with the following display:

    https://www.buydisplay.com/serial-sp...tl-touch-panel

    i have the 4 wire SPI, 3.3V, capacitive version and the screen turns on but nothing is displayed... I use the library:

    https://github.com/wwatson4506/Ra8876LiteTeensy

    The terminal shows me "2D ready failed" continuously with the examples I can compile of the library.

    I connected the display with Teensy board in this way:

    Teensy 3.6 --- ER-TFTM101-1

    CS 10 --- 5
    MOSI 11 --- 7
    MISO 12 --- 6
    SCK 13 --- 8
    RESET 8 --- 11
    BACKLITE 20 --- 14
    CTP_INT 24 --- 33
    SDA 18 --- 34
    SCL 19 --- 35
    RST_3.3 22 --- 36

    i read this: https://forum.pjrc.com/threads/66385...I-connectivity

    I did some test by removing and putting the 3.3V power supply but I can't see anything, only backlight.

    I used the same power supply for 7 inches RA8875 and this latest display works well.

    Has anyone had my own problems? Can you help me? Sorry for my little english..

  2. #2
    Senior Member wwatson's Avatar
    Join Date
    Aug 2017
    Posts
    538
    Quote Originally Posted by andream View Post
    Hi everyone, I take this first post to introduce myself, my name is Andrea and I come from Italy.

    A few days ago I bought a Teensy 3.6 board and I'm really impressed by her power (better than the Arduino boards I had) but i have a problem with the following display:

    https://www.buydisplay.com/serial-sp...tl-touch-panel

    i have the 4 wire SPI, 3.3V, capacitive version and the screen turns on but nothing is displayed... I use the library:

    https://github.com/wwatson4506/Ra8876LiteTeensy

    The terminal shows me "2D ready failed" continuously with the examples I can compile of the library.

    I connected the display with Teensy board in this way:

    Teensy 3.6 --- ER-TFTM101-1

    CS 10 --- 5
    MOSI 11 --- 7
    MISO 12 --- 6
    SCK 13 --- 8
    RESET 8 --- 11
    BACKLITE 20 --- 14
    CTP_INT 24 --- 33
    SDA 18 --- 34
    SCL 19 --- 35
    RST_3.3 22 --- 36

    i read this: https://forum.pjrc.com/threads/66385...I-connectivity

    I did some test by removing and putting the 3.3V power supply but I can't see anything, only backlight.

    I used the same power supply for 7 inches RA8875 and this latest display works well.

    Has anyone had my own problems? Can you help me? Sorry for my little english..
    It has been a long time since I work with it. There are a few things to look out for with this display. I have the same display a you have but with a resistave touch screen.
    First what version of Arduino and what version of Teensyduino are you using?
    Which example are you using?
    Can you provide a picture of your setup?
    The length of the connecting wires can effect the speed of the SPI connection. The best performance with a wired connection is a 3" lead. We were able to run it 47 Mhz.
    In RA8876_t3.h starting at line #121 you will see 'SPIspeed = 3000000;' try to reduce that speed to 2000000.

    Your pin connections look ok as far as the SPI is concerned.

    The best thread to check out is:
    https://forum.pjrc.com/threads/58565...ghlight=RA8876

    This is my original post of my RA8876 driver which has been optimized by several members of this forum.

    EDIT: Also, what grounds are you using?

  3. #3
    Junior Member
    Join Date
    Oct 2021
    Posts
    5
    Hi,

    Thanks for the reply.

    I am using Arduino 1.8.5 with Teensyduino 1.54.

    This is a sketch with which I have problems (but the terminal shows me "2D ready failed" with all sketches I can compile of the library).

    // treedee.ino example
    // Taken from sumotoy's RA8875 library
    // and modified for use with the RA8876.
    #include "Arduino.h"
    //#include "Ra8876_Lite.h"
    #include "RA8876_t3.h"

    //#include "vt100.h"
    #include <math.h>

    #define RA8876_CS 10
    #define RA8876_RESET 8 //21
    #define BACKLITE 20//7 //External backlight control connected to this Arduino pin
    RA8876_t3 tft = RA8876_t3(RA8876_CS, RA8876_RESET); //Using standard SPI pins


    // Array of RA8876 Basic Colors
    PROGMEM uint16_t myColors[] = {
    0x0000,
    0xffff,
    0xf800,
    0xfc10,
    0x8000,
    0x07e0,
    0x87f0,
    0x0400,
    0x001f,
    0x051f,
    0x841f,
    0x0010,
    0xffe0,
    0xfff0,
    0x8400,
    0x07ff,
    0x87ff,
    0x0410,
    0xf81f,
    0xfc1f,
    0x8010,
    0xA145
    };

    float sin_d[] = {
    0,0.17,0.34,0.5,0.64,0.77,0.87,0.94,0.98,1,0.98,0. 94,
    0.87,0.77,0.64,0.5,0.34,0.17,0,-0.17,-0.34,-0.5,-0.64,
    -0.77,-0.87,-0.94,-0.98,-1,-0.98,-0.94,-0.87,-0.77,
    -0.64,-0.5,-0.34,-0.17 };
    float cos_d[] = {
    1,0.98,0.94,0.87,0.77,0.64,0.5,0.34,0.17,0,-0.17,-0.34,
    -0.5,-0.64,-0.77,-0.87,-0.94,-0.98,-1,-0.98,-0.94,-0.87,
    -0.77,-0.64,-0.5,-0.34,-0.17,0,0.17,0.34,0.5,0.64,0.77,
    0.87,0.94,0.98};
    float d = 30;
    float px[] = {
    -d, d, d, -d, -d, d, d, -d };
    float py[] = {
    -d, -d, d, d, -d, -d, d, d };
    float pz[] = {
    -d, -d, -d, -d, d, d, d, d };

    float p2x[] = {
    0,0,0,0,0,0,0,0};
    float p2y[] = {
    0,0,0,0,0,0,0,0};

    int r[] = {
    0,0,0};

    uint8_t ch = 13; // Default line color
    uint16_t ccolor = myColors[ch];

    void setup() {
    //I'm guessing most copies of this display are using external PWM
    //backlight control instead of the internal RA8876 PWM.
    //Connect a Teensy pin to pin 14 on the display.
    //Can use analogWrite() but I suggest you increase the PWM frequency first so it doesn't sing.
    pinMode(BACKLITE, OUTPUT);
    digitalWrite(BACKLITE, HIGH);

    tft.begin();
    //initVT100();
    tft.setCursor(0,0);
    tft.fillScreen(myColors[11]);
    tft.setFontSize(1,false);
    tft.fillStatusLine(myColors[11]);
    tft.printStatusLine(0,myColors[1],myColors[11],"Sumotoy's treedee sketch on the T4.");
    tft.setMargins(0, 0, tft.width(), tft.height()); //so fillscreen doesn't erase the status bar
    }


    //delay between interations
    uint8_t speed = 20; // Change this setting to go from reasonable to rediculous .

    void loop() {
    tft.fillScreen(myColors[11]);
    r[0] = r[0] + 1;
    r[1] = r[1] + 1;
    if (r[0] == 36) r[0] = 0;
    if (r[1] == 36) r[1] = 0;
    if (r[2] == 36) r[2] = 0;
    for (int i = 0; i < 8; i++)
    {
    float px2 = px[i];
    float py2 = cos_d[r[0]] * py[i] - sin_d[r[0]] * pz[i];
    float pz2 = sin_d[r[0]] * py[i] + cos_d[r[0]] * pz[i];

    float px3 = cos_d[r[1]] * px2 + sin_d[r[1]] * pz2;
    float py3 = py2;
    float pz3 = -sin_d[r[1]] * px2 + cos_d[r[1]] * pz2;

    float ax = cos_d[r[2]] * px3 - sin_d[r[2]] * py3;
    float ay = sin_d[r[2]] * px3 + cos_d[r[2]] * py3;
    float az = pz3 - 190;

    p2x[i] = ((tft.width()) / 2) + ax * 500 / az;
    p2y[i] = ((tft.height()) / 2) + ay * 500 / az;
    }
    for (int i = 0; i < 3; i++) {
    tft.drawLine(p2x[i], p2y[i], p2x[i + 1], p2y[i + 1], ccolor);
    tft.drawLine(p2x[i + 4], p2y[i + 4], p2x[i + 5], p2y[i + 5], ccolor);
    tft.drawLine(p2x[i], p2y[i], p2x[i + 4], p2y[i + 4], ccolor);
    }
    tft.drawLine(p2x[3], p2y[3], p2x[0], p2y[0], ccolor);
    tft.drawLine(p2x[7], p2y[7], p2x[4], p2y[4], ccolor);
    tft.drawLine(p2x[3], p2y[3], p2x[7], p2y[7], ccolor);
    delay(speed); // Wanna see how fast this runs a 34MHZ? modify 'speed' above! (Or comment out)
    // Uncomment for random colored frames
    // if (ch >= 22) {
    // ch = 1;
    // ccolor = myColors[ch];
    // ccolor = myColors[random(1, 22)];
    // }
    // else {
    // ch++;
    // }
    }
    I also reduced the frequency of SPI to 2000000 as you said but the problem has not been solved.

    Here is some pictures of my setup:

    Click image for larger version. 

Name:	IMG_20211008_085638_664_2.jpg 
Views:	11 
Size:	65.1 KB 
ID:	26114
    Click image for larger version. 

Name:	IMG_20211008_090850_556_2.jpg 
Views:	15 
Size:	79.5 KB 
ID:	26115

    I connected to ground the pin 39 of the screen.

  4. #4
    Senior Member wwatson's Avatar
    Join Date
    Aug 2017
    Posts
    538
    @andream - The length of those leads are probably to long. The maximum lead length that would work for me was 6" not matter what SPI speed I used. Also I had all of the ground connections to the display connected. I am not sure if the display works with just 1 ground lead. Never tried it. Another question is, do you have anything else connected to the same SPI buss as the display? These displays do not tristate the MISO pin. I would suggest shortening the leads going to the display and connect all of the ground leads of the display to the common ground for the Teensy. Make sure nothing else is connected to the SPI buss except the display.
    "2D ready failed"
    Could be due to the possible issues mentioned. I do notice that led on the Teensy is lit. This could be due to the Teensy still trying to write to the display.
    Hopefully this will show the sketch working.

  5. #5
    Junior Member
    Join Date
    Oct 2021
    Posts
    5
    I shortened the cables and connected all the GNDs but nothing.. Now even the backlight does not turn on.
    Only the display is connected to SPI bus.

    I think the display is broken.

    Thank you.

  6. #6
    I used this display a few years ago with a teensy 3.6. My notes say "move the SPI clock to pin 14 instead of pin 13, as the resistor & LED on pin 13 will mess with the signal".
    I'm using SPI.setSCK(14).

  7. #7
    Junior Member
    Join Date
    Oct 2017
    Location
    Roskilde, Denmark
    Posts
    15
    I use several systems with 7" ra8876 displays, I always use SCK at pin 14, works very well, both with teensy 3.6,.and 4.1.

  8. #8
    Junior Member
    Join Date
    Oct 2021
    Posts
    5
    I set SCK on pin 14 but nothing; the sketch "treedee" still gives me "2D ready failed".

    The SCK on pin 13 maybe damaged the display? Otherwise there is a method to force the SCK on pin 14 in the libraries?

    Thank you.

  9. #9
    First change your wiring so the display's pin 8 is connected to the teensy's pin 14.

    The library you're using allows you to specify the SCK pin on the constructor.
    Code:
    RA8876_t3::RA8876_t3(const uint8_t CSp, const uint8_t RSTp, const uint8_t mosi_pin, const uint8_t sclk_pin, const uint8_t miso_pin)
    Change your code to
    Code:
    RA8876_t3 tft = RA8876_t3(RA8876_CS, RA8886_RESET, 11, 14, 12)

  10. #10
    Junior Member
    Join Date
    Oct 2021
    Posts
    5
    I tried to change the libraries as suggested but nothing.. still not working.

    Always give me:
    "2D ready failed"
    What exactly does this message mean?
    I'm afraid the display is broken, I hope it wasn't SCK connected to pin 13.

  11. #11
    Senior Member BriComp's Avatar
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    416
    I am not familiar with the Library nor LCD but that error message is in RA8876_t3.cpp in the following function:
    Code:
    //**************************************************************//
    /*[Status Register] bit3   Core task is busy
    Following task is running:
    BTE, Geometry engine, Serial flash DMA, 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_t3::check2dBusy(void)  
    {  ru32 i; 
       for(i=0;i<50000;i++)   //Please according to your usage to modify i value.
       { 
       delayMicroseconds(1);
        if( (lcdStatusRead()&0x08)==0x00 )
        {return;}
       }
       Serial.println("2D ready failed");
    }
    and that function (check2dBusy) is called in multiple places in the library.

  12. #12
    The library is checking if the display has completed drawing a primitive (rectangle, circle, line, etc). It checks a status register 50,000 times delaying a microsecond between checks. If the status register doesn't read back as zero after 50,000 checks it prints the "2D ready failed" message.

    SCK connected to pin 13 on the teensy wouldn't damage the display. The extra LED just takes some of the current away from the pin and increases the rise and fall times of the clock signal. If the wires to the display are long the display might not receive a clean enough signal. Moving SCK to pin 14 removes the extra load of the LED, so you'll have a cleaner signal to the display.

    I'd next check the jumpers on the display. From my notes I have:

    * Display Jumpers:
    * 5v power - J29 open
    * 4-wire interface - J2,J4,J6,J7,J8,J9,J10,J21,J22,J23,J24 Short
    * 4-wire interface - J1,J3,J5,J11,J12,J13,J14,J15-J20,J25,J26 Open
    * external backlight - J27 short, J28 Open

    * Display pin-out:
    * GND 1, 2, 13, 31, 39, 40
    * 5V 3, 4, 37, 38
    * DISP CS 5 (low active)
    * DISP SDO 6
    * DISP SDI 7
    * DISP CLK 8
    * DISP RDY 9 (low display is busy)
    * DISP RST 11 (low active)
    * Back Light 14 (High on)
    * CTP INT 33
    * CTP SDA 34
    * CTP SCL 35
    * CTP RST 36

    You say you're running on 3.3v power, so the setting of the J29 jumper will be different for you. I'll have to dig up the documentation on the display, the above settings are from my own notes. I probably used a level-shifter with the Teensy to translate 5v signals to/from the display to the 3.3v levels on the Teensy. I don't have the schematics handy to check.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •