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

Thread: ra8875/GSL1680 .teensy 4.0 ..touch panel functional but an issue

  1. #1
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116

    ra8875/GSL1680 .teensy 4.0 ..touch panel functional but an issue

    Okay I have the GSL1680 up and running from the github example ..there were array bounds issues which I corrected in clear_Reg(0 and reset() ..and the code compiles fine

    The touch function works but y axis is not functioning correctly .. my display is 800 x 480 and the x axis is fine but the y axis position and screen function is way out ...and only 1/4 of the screen is touch functional so only about 1/4 of the screen is working with touch ..

    has anybody else experienced this behaviour ..?

    getting frustrated could use a few pointers other then "buy another screen" but darn I think I may have to do that ..

    I've tried at least 3 library variants .. all have the same bounds array issue ...

    open to thoughts ...

    Thanks
    Last edited by Keith_M; 09-25-2020 at 04:53 AM. Reason: typo

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,900
    Which display do you have? Which library are you using, which example?

  3. #3
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116
    I'm using the ra8875 5" display from buydisplay ..with i2c ..on a teensy 4.0.. I have tried the libraries from Wolfman, the Scallwar release and the ESTBLC release ...all of them have the same boundry array limitation issue in the cpp file the clear_reg() and reset() ...I pulled all of these off guthub ..and used them one at a time to avoid conflicts ..the touch is working , the display is 800 x 480 ..but it identifies the "y" position 2/3rds of the way down the screen ..the touch works from that position to the bottom of the screen ..Touch does not function in the top 2/3 of tge screen ..Im running the stock GSL1680 sketch ..

    Has me really puzzled ..I received a second display identical to the first one and its shows the same behaviour ..I could see anything in the sketch that would cause this behaviour ..and the corrections I made in the cpp file should not effect it I would think ...Open to suggestions .Thanks for getting back to me KurtE appreciate your time ...

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,900
    I probably have one of these although it came with a small ribbon cable and small adapter part which I never tried and probably lost... I have a 5" with their resistive.
    I also have a couple of their 4.3" capacitive touch display, but it uses a different touch controller chip and support for that other chip is built into our RA8875 library which is an update of the Sumotoy version.

    Not sure what to suggest. I installed the Arduino library for you controller, But it looks like a bunch of gunk where it maybe reprograms the whole controller? Not sure why or what are the configuration information associated with it.

    Is it only seeing the touch, that it translates into only 1/4 of the display or does the touching in the other areas still generate the touch response, but is mapped wrong?

    Again probably can not help much here, but maybe one of the other owners of these displays has more experience with this controller.

    Good Luck

  5. #5
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116
    Well ..what has happened is there are 2 versions of the touch controller gsl1680E and fsl 1680F ..."E" has been discontinued .."F" is the current which means that there is new firmware ..which is available in an .h file ..anyhow trying to sort it out..

  6. #6
    Senior Member
    Join Date
    Nov 2015
    Location
    Cold hollow VT
    Posts
    186
    @Keith I too have been having problems with this display, ER-TFTM050A2-3 from BuyDisplay.com.

    I find that in the Wolfman (based on Skallwar) release that the Reset and clear reg routines are written incorrectly giving error 3 or 4 in the I2C stuff. Change them to this:

    Code:
        for (i = 0; i < 2; ++i) {
            Wire.write(REG[i]);
            Wire.write(DATA[i]);
            r = Wire.endTransmission();             // move to inside the loop before the delay(x)
            delay(TIMER[i]);
        }
    There is some other stuff in there that needs attention too.

    Now I still have yet to get this to work as intended, but, I have been able to take the arduino download package from the BuyDisplay website and change things in the DUE code to use the SumoToy release of the RA8875 driver that comes with TeensyDuino. So at least I can see I have not fried my display. NOTE the different settings for SPI & I2C stuff.

    ER-TFTM050A2-3-Teensy.ino

  7. #7
    Senior Member
    Join Date
    Nov 2015
    Location
    Cold hollow VT
    Posts
    186
    Oh, there is one more thing, the data sheet for this (may still) shows conflicting information to the interfacing sheet.

    https://www.buydisplay.com/download/...nterfacing.pdf

    Note the I2C pins WAKE is actually on display pin #32 and INT is on pin #33. When I first started with this display I noticed there was no WAKE pin and RESET was on pin #36. This error seems to have been fixed recently though.

  8. #8
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116
    Thanks for posting that up ...I got as far as getting the display up and running fine with the exception I could only get 1/3 of the touchscreen to work ..Initially thought the display was faulty but had a secind brand new display , same model and type and it exhibited the same issues ..The best zi can figure is the firmware that initially gets loaded is different from the model revision from the rev "E" to the rev "F"..have you managed to push up the firmware load from buydisplay up to the card ?

  9. #9
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116
    ive not had much time to , get back to it yet ...I was hoping the there would be a patch available or a library update on github ..regrettably , Ive not had "time" to really work through it ...

  10. #10
    Senior Member
    Join Date
    Nov 2015
    Location
    Cold hollow VT
    Posts
    186
    Quote Originally Posted by Keith_M View Post
    Thanks for posting that up ...I got as far as getting the display up and running fine with the exception I could only get 1/3 of the touchscreen to work ..Initially thought the display was faulty but had a secind brand new display , same model and type and it exhibited the same issues ..The best zi can figure is the firmware that initially gets loaded is different from the model revision from the rev "E" to the rev "F"..have you managed to push up the firmware load from buydisplay up to the card ?
    As stated in #6 above I have modified the BuyDisplay code example given fro the Arduino DUE. My mod uses the SumoToy RA8875 driver contained in Teensyduino along with different pin assignments. I attached it to post #6. Change the pin defines at the top to reflect the pins that you use for SPI and I2C (to connect the display) and in >void setup< for the I2C and SPI startup definitions. This worked for me and I now get at least 5 finger touch points across the whole screen. I'm doing this on a Teensy 3.5

    This is not currently a driver as we know it, but it does give me a starting point to figure out how to fix up the wolfmanjm or skallwar driver packages. I've had my display about 1-year and it does work with this demo code I posted here.

  11. #11
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116
    Quote Originally Posted by grease_lighting View Post
    As stated in #6 above I have modified the BuyDisplay code example given fro the Arduino DUE. My mod uses the SumoToy RA8875 driver contained in Teensyduino along with different pin assignments. I attached it to post #6. Change the pin defines at the top to reflect the pins that you use for SPI and I2C (to connect the display) and in >void setup< for the I2C and SPI startup definitions. This worked for me and I now get at least 5 finger touch points across the whole screen. I'm doing this on a Teensy 3.5

    This is not currently a driver as we know it, but it does give me a starting point to figure out how to fix up the wolfmanjm or skallwar driver packages. I've had my display about 1-year and it does work with this demo code I posted here.

    I'll run up your sketch this weekend and see how it goes..will post back ..

    Thank-you for all the hard work and sleuthing to get it going ...!!

    cheers

  12. #12
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116
    A big thank-you to Greased Lightning ..Ive been struggling with the gsl1680 touch code , and he managed to get me up and running...Ive been on another project and only found today to give it a good go ! Again thankyou very much !
    I do find it bizarre that you need to load all those lines of code to support the firmware to use the touch ..but its running.? So my 2 5" screens will no longer be collecting dust ..

  13. #13
    Senior Member
    Join Date
    May 2017
    Location
    Netherlands
    Posts
    138
    The RA8875 5" with GSL1680 controller is quite simple, build many projects with this RA8875 display.
    Best regards,
    Johan


    Code:
    #include <SPI.h>
    #include <RA8875.h>
    #include <GSL1680.h>
    #define TC_INT   8
    
    // install : ILI9341_fonts-master
    
    #include "font_LiberationMono.h"
    #include "font_DroidSansMono.h"
    #include "font_AwesomeF000.h"
    #include "font_AwesomeF200.h"
    #include "font_AwesomeF180.h"
    #include "font_AwesomeF100.h"
    #include "font_AwesomeF080.h"
    uint16_t buttons_time =100;
    #define WAKE 255
    GSL1680 TS = GSL1680();
    uint16_t TouchY;
    uint16_t TouchX;
    bool     TouchZ = false;
    
    
    #define RA8875_RESET 255    //Not used
    #define RA8875_CS 10
    RA8875 tft = RA8875(RA8875_CS, RA8875_RESET, 11, 13, 12);   // 11=MOSI   13=SCLK   12=MISO  10=CS
    
    void setup() {
      tft.begin(RA8875_800x480);
      tft.setRotation(0);   
      tft.setCursor(200,350);
      tft.setFont(DroidSansMono_16);
      tft.print("Touch test wait for I2C bus");
      delay(3500); // time for I2C bus
      TS.begin(-1, TC_INT);
      tft.clearScreen();
     }
    
    void loop() {
        
        tft.setCursor(200,250);
        tft.print(TouchX);
        tft.setCursor(200,350);
        tft.print(TouchY);
     
     if (digitalRead(TC_INT) == HIGH) {
        int NBFinger = TS.dataread();
    
        for (int i = 0; i < NBFinger; i++) {
          TouchX  = (TS.readFingerX(i));
          TouchY  = (TS.readFingerY(i));
          
        }
      }
      TouchZ = TS.dataread();
    
     
    }

  14. #14
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116
    Quote Originally Posted by pd0lew View Post
    The RA8875 5" with GSL1680 controller is quite simple, build many projects with this RA8875 display.
    Best regards,
    Johan


    Code:
    #include <SPI.h>
    #include <RA8875.h>
    #include <GSL1680.h>
    #define TC_INT   8
    
    // install : ILI9341_fonts-master
    
    #include "font_LiberationMono.h"
    #include "font_DroidSansMono.h"
    #include "font_AwesomeF000.h"
    #include "font_AwesomeF200.h"
    #include "font_AwesomeF180.h"
    #include "font_AwesomeF100.h"
    #include "font_AwesomeF080.h"
    uint16_t buttons_time =100;
    #define WAKE 255
    GSL1680 TS = GSL1680();
    uint16_t TouchY;
    uint16_t TouchX;
    bool     TouchZ = false;
    
    
    #define RA8875_RESET 255    //Not used
    #define RA8875_CS 10
    RA8875 tft = RA8875(RA8875_CS, RA8875_RESET, 11, 13, 12);   // 11=MOSI   13=SCLK   12=MISO  10=CS
    
    void setup() {
      tft.begin(RA8875_800x480);
      tft.setRotation(0);   
      tft.setCursor(200,350);
      tft.setFont(DroidSansMono_16);
      tft.print("Touch test wait for I2C bus");
      delay(3500); // time for I2C bus
      TS.begin(-1, TC_INT);
      tft.clearScreen();
     }
    
    void loop() {
        
        tft.setCursor(200,250);
        tft.print(TouchX);
        tft.setCursor(200,350);
        tft.print(TouchY);
     
     if (digitalRead(TC_INT) == HIGH) {
        int NBFinger = TS.dataread();
    
        for (int i = 0; i < NBFinger; i++) {
          TouchX  = (TS.readFingerX(i));
          TouchY  = (TS.readFingerY(i));
          
        }
      }
      TouchZ = TS.dataread();
    
     
    }

    I did manage to get the touch panel to work .. but the problem being only 800 X 200 pixels of the panel were supporting touch .. half of the screen would not respond . I could get the panel to work ..and the touch working but I could not get the touch to work over the full 800 X 480 pixel display .. Only half of it

  15. #15
    Senior Member
    Join Date
    May 2017
    Location
    Netherlands
    Posts
    138
    Hi Keith, do you have a 800x480 display? please look at the backside if it shows E257834 than you are good!

    Best,
    Johan

  16. #16
    Senior Member
    Join Date
    Apr 2020
    Location
    Guelph Ontario Canada
    Posts
    116
    I'm going to take another shot at the gsl1680 ... and try the code you have posted ... I was able to get touch to work but only half the screen was responding.. Thankyou for posting up ..

    Where did you get the font libraries in your code?

  17. #17
    Senior Member
    Join Date
    Nov 2015
    Location
    Cold hollow VT
    Posts
    186
    @Keith_M Would you please clarify the <half of screen. . . . > Is that like top/bottom half or every other one, (even/odd lines only)? I'm doing a Teensy 3.5 project and will look at that.

  18. #18
    Senior Member
    Join Date
    May 2017
    Location
    Netherlands
    Posts
    138
    Keith, please confirm if you have a E257834 display, because there are also 480x272 displays from Buydisplay.
    The font library is ILI9341_fonts-master and have the font Awesome.
    Best,
    Johan

  19. #19
    Senior Member
    Join Date
    May 2017
    Location
    Netherlands
    Posts
    138
    Two screens, a 5" with GSL1680 controller and a 7" with FT5206 controller both displays are awesome.

    JohanClick image for larger version. 

Name:	it's achoice .jpg 
Views:	10 
Size:	101.0 KB 
ID:	24493

Posting Permissions

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