Forum Rule: Always post complete source code & details to reproduce any issue!
Page 24 of 24 FirstFirst ... 14 22 23 24
Results 576 to 587 of 587

Thread: ILI9488_t3 - Support for the ILI9488 on T3.x and beyond...

  1. #576
    Junior Member
    Join Date
    Oct 2019
    Posts
    7
    @mjs513 @KurtE

    I think there was a little bit of confusion on what I had did the other day.

    I used the below code and attached library to operate the adafruit display with the t3.6 but still had the touchscreen from the ili9488 connected to the t3.6 instead of the one on the adafruit display. I did not have any rotation or mirror problems. I used the same jumper wires with the adafruit display as I did with the ili9488 which would lead me to believe that the problem is in the display library and that the touchscreen and the touchscreen library are fine. Unfortunately I'm not experienced enough to understand everything that is going on in the library. I might be better off trying to incorporate a touch screen controller.

    Code:
    #include "SPI.h"
    #include "HX8357_t3.h"
    #include "TouchScreen.h"
    
    #define TFT_DC 9
    #define TFT_CS 10
    HX8357_t3 tft = HX8357_t3(TFT_CS, TFT_DC);
    
    #define YP A18
    #define XM A19
    #define YM 5
    #define XP 6
    
    #define TS_MINX 120
    #define TS_MINY 50
    #define TS_MAXX 920
    #define TS_MAXY 940
    
    TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
    
    #define MINPRESSURE 10
    #define MAXPRESSURE 1000
    
    void setup(){
      tft.begin(HX8357D);
      tft.setRotation(3);
      tft.fillScreen(HX8357_BLACK);
      tft.setTextColor(HX8357_GREEN, HX8357_BLACK); tft.setTextSize(3);
    }
    
    void loop(){
      touchscreen();
    }
    
    
    void touchscreen(){
      TSPoint p = ts.getPoint();
      pinMode(XM, OUTPUT);
      pinMode(YP, OUTPUT);
      tft.setCursor(0,25);
      tft.print("Z=");
      tft.print(p.z);
      tft.print("  ");    
      if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
        tft.setCursor(0,0);
        tft.print("X=");
        tft.print(p.x);
        tft.print("  ");
        tft.setCursor(200,0);
        tft.print("Y=");
        tft.print(p.y);
        tft.print("  ");
      }
    }

    I did try this with ili9488 but I still ended up with the rotation and mirror problem.
    Code:
    #include "SPI.h"
    #include "ILI9488_t3.h"
    #include "TouchScreen.h"
    
    #define TFT_RST 8
    #define TFT_DC 9
    #define TFT_CS 10
    ILI9488_t3 tft = ILI9488_t3(&SPI, TFT_CS, TFT_DC, TFT_RST);
    
    unsigned long time = 0;
    unsigned long ptouchtime = 0;
    
    #define YP A18
    #define XM A19
    #define YM 5
    #define XP 6
    
    #define TS_MINX 120
    #define TS_MINY 50
    #define TS_MAXX 920
    #define TS_MAXY 940
    
    TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
    
    #define MINPRESSURE 10
    #define MAXPRESSURE 1000
    
    int screenx = 0;
    int screeny = 0;
    int screenz = 0;
    
    void setup(){
      tft.begin();
      tft.setRotation(3);
      tft.fillScreen(ILI9488_BLACK);
      tft.setTextColor(ILI9488_GREEN, ILI9488_BLACK); tft.setTextSize(3);
    }
    
    void loop(){
      tftdisplay();
      touchscreen();
    }
    
    void tftdisplay(){
      tft.setCursor(0,0);
      tft.print("X=");
      tft.print(screenx);
      tft.print("  ");
      tft.setCursor(200,0);
      tft.print("Y=");
      tft.print(screeny);
      tft.print("  ");
      tft.setCursor(0,25);
      tft.print("Z=");
      tft.print(screenz);
      tft.print("  "); 
    }
    void touchscreen(){
      time = millis();
      unsigned long touchtime = time;
      if(touchtime - ptouchtime >= 1000){
        TSPoint p = ts.getPoint();
        pinMode(XM, OUTPUT);
        pinMode(YP, OUTPUT);
        screenz = p.z;
        if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {
          screenx = p.x;
          screeny = p.y;
        }
        else{
          screenx = 0;
          screeny = 0;
        }
      ptouchtime = touchtime;
      }
    }
    Attached Files Attached Files

  2. #577
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,221
    @Slapstick

    Think I mentioned this before but the ILI9488 driver was designed for the ILI9488 controller not the HX8357 controller. There are differences at the controller level that may be causing an issue. There may be enough in common that the HX8357 will work with the 9488 library but there is no guarantee that it will work right or 100%. Your best course of action is to use the display library designed for the HX8357 controller not try and use the ILI9488 library.

    In addition the touchscreen drivers are not part of the ILI9488 library but are separate libraries to support the different touch controllers on the different displays - resistive or capacitive.

    Think from what you said the HX8357 library worked - no screen rotation.

    Unfortunately I don't have a HX8357 to test maybe somebody else does.

  3. #578
    Junior Member
    Join Date
    Oct 2019
    Posts
    7
    @mjs513

    Using the HX8357 display is not what I'm trying to do. I'm trying to use a display with a ili9488 chip. I have another display which is the adafruit with a HX8357D driver.

    I understand that the touchscreen drivers are not part of the ili9488 library but for some reason there is something in the ili9488 library that doesn't like the touchscreen library. I had the display running by itself without any problems for about a day when I was making sure everything was working. As soon as I added the touchscreen library to the sketch is when I started having problems. It's the same touchscreen library I have used with the HX8457D display so I know it works.

    If I used the HX8357D display and the proper HX8357 library but wired the ili9488 touchscreen to the t3.6 instead of the touchscreen from the HX8357. I could operate the touchscreen that is fixed to the ili9488 display and display the touch points on HX8357 without rotation and mirroring problems. In doing so verified that the touchscreen on the ili9488 is not the problem as well as the touchscreen library. Both displays that I have are using resistive touchscreens.

    Do you think there is any way that I will be able to get the touchscreen library to work properly with the ili9488?

  4. #579
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,971
    Maybe not related - not sure I have a clear pic of using "T_3.6 instead" portion... or the rest of what is at hand ...

    Some tested ili9488's were not set up with tri-stated SPI lines - the display worked alone with no touch connect/use - but when display's MISO was connected the output from active touch sensor was conflicted with the Touch MISO.

    Solution was to not connect the Display MISO to the Teensy disabling display read - but allowing valid read of the Touch MISO output.

  5. #580
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,597
    I could be wrong, but my understanding is that you have the BuyDisplay ILI9488 display: https://www.buydisplay.com/default/s...screen-ili9488
    Which has the ILI9488 and a raw resistive touch controller. That is there is a ribbon connector with 50 connections on it. Of which there are 4 pins (44-47) which are setup to read this be using analogRead... So there is no conflict on SPI.

    Personally I don't have the patience to try to solder up all of those IO pins.

    My guess is there is something marginal on one or more of the connections, or maybe your not 100% setup to their specifications.

    Example it shows pins 40-42 saying provide with 2.8V.
    There are also at least ground pins shown. Are all of them hooked up to GND?
    Are all of the pins that your not using that say fix to DGND hooked up to some form of GND?
    Likewise those that say connect to IOCV?

    Also with many of these displays not all are created equal. That is some may work great to 30mhz and another one may not... So again hard to know. exactly what is going on.

    Sorry not much help here.

  6. #581
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,221
    @Slapstick

    Ok confused here are 2 questions that should clarify the situation:
    1) HX8357 works with both Adafruit touchscreen.h and their HX8357 driver? From your description you said it was still hooked up to the ILI9488 touchscreen????

    2) ILI9488: Without touch pins attached to the display (just the 9488 SPI wires) does it work at 30Mhz? Think you said at the beginning the just the display driver works. But the problem is when you attach the touch pins. Just confirming this.

    As @KurtE stated the touchscreen lib is only doing analogreads but there is some port manipulation in there as well. But on the T3.6 that should not be a issue to conflict with SPI that the 9488 library uses.

    Right now you I would say try using pins A2 and A3 as opposed to A18 and A19. Also just double check your wiring connections in addition to wht @KurtE stated in his post.

    Again... not sure what else I can do to help since I don't have one of these displays.

    Not sure

  7. #582
    Junior Member
    Join Date
    Jul 2019
    Posts
    10
    I'm getting the following errors when I try to compile this for Teensy 3.2:

    C:\....\libraries\ILI9488_t3-master\ILI9488_t3.cpp:185:33: error: variable or field 'setFrameBuffer' declared void

    void ILI9488_t3::setFrameBuffer(RAFB *frame_buffer)

    ^

    C:\....\libraries\ILI9488_t3-master\ILI9488_t3.cpp:185:33: error: 'RAFB' was not declared in this scope

    C:\....\libraries\ILI9488_t3-master\ILI9488_t3.cpp:185:39: error: 'frame_buffer' was not declared in this scope

    void ILI9488_t3::setFrameBuffer(RAFB *frame_buffer)

    ^

    Is there any configuration which needs to be done with this? I understand the frame buffer function is not available in T3.2

  8. #583
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,597
    Looks like there is probably an issue with some that should have been removed by #if type statements.

    However if whatever program your are trying to compile actually tries to use frame buffer... That will for sure fail...

    But I extracted a real simple one and sure enough it does not compile...

    @mjs513 - should I take a quick look? Or do you want to?

  9. #584
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,221
    @KurtE

    I'll take a look and let you know.

    Mike

  10. #585
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,597
    Fixed: Did PR: https://github.com/mjs513/ILI9488_t3/pull/14
    Simply added #else case to define RAFB for boards which don't support frame buffers, so that the other API won't compile error

  11. #586
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,221
    Ok you beat me to it - just did the merge!

  12. #587
    Junior Member
    Join Date
    Jul 2019
    Posts
    10
    Many thanks for the quick response, it does indeed compile now

Posting Permissions

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