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

Thread: Teensy 3.2 -> 4.0 ILI9341 touchscreen issues

  1. #1
    Junior Member
    Join Date
    Jun 2017
    Location
    Phoenix
    Posts
    15

    Teensy 3.2 -> 4.0 ILI9341 touchscreen issues

    Hi all,

    With the Teensy 3.2 shortage I am trying to make a Teensy 4.0 work on a small HMI (Human Machine Interface) we make. I got the ILI9341 LCD to work correctly but the touchscreen is a problem.

    With the 3.2 board when a "button" is touched on the screen I get a press code and when you stop touching the button you get a release code.

    With the 4.0 board I get press-release-press-release-..... over and over until the button is no longer touched.

    The only changes I have made to my code is updating the ILI9341_t3 and Touchscreen libraries.

    The Teensy 3.2 code was compiled with Arduino 1.8.2 and whatever version of Teensyduino that was released with that version (that is what is installed on my computer at work).

    The Teensy 4.0 code was compiled with Arduino 1.8.13 and Teensyduino 1.53 (that is what is installed on my computer at home).

    The HMI uses RawHID to send the touch information back to my host and receives protocol commands from the host to draw the GUI (buttons, etc). on the screen.

    Could my problems with the touchscreen be related to the _much_ fast processor speed on the 4.0 vs. the 3.2 board?

    Does anyone have any ideas?

    Thanks,
    Hartley

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,539
    Might help if we knew some additional information, preferably with hook-up diagram and sample code.
    In particular things like, which ILI9341 display?

    For examples like the ones sold by PJRC? Which uses an XPT2046 touch controller,
    Or maybe like the ones that Adafruit sells, with have different touch controllers.

    If it were me, I would try your code at home with more recent releases, like Arduino 1.8.19 and TD 1.56 or current beta 1.57B3

    And again more details about for example you mentioned button, are you using the button object or something else?

  3. #3
    Junior Member
    Join Date
    Jun 2017
    Location
    Phoenix
    Posts
    15
    The ILI9431 display I am using is like the Adafruit 1774 display. I have my own carrier board for the Teensy that the display module connects to.

    The display itself is connected as:

    Code:
    #define TFT_CS			10
    #define TFT_DC			9
    #define TFT_RST			23
    #define TFT_LITE		22
    ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC, TFT_RST);
    The touchscreen part is connected as:

    Code:
    #define YP			A6	// must be an analog pin, use "An" notation!
    #define XM			A3	// must be an analog pin, use "An" notation!
    #define YM			16	// can be a digital pin
    #define XP			21	// can be a digital pin
    TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
    I just retested the original Teensy 3.2 code using the 1.8.13 compiler on my home system. It works perfectly.

    I then tried changing the board type to Teensy 4.0 but the code does not compile correctly. I'm getting some odd errors which lead me down the path of updating the ILI9341_t3 and Touchscreen libraries before:

    Code:
    Arduino: 1.8.13 (Linux), TD: 1.53, Board: "Teensy 4.0, Raw HID, 600 MHz, Faster, US English"
    
    /tmp/arduino_build_782512/sketch/TouchScreen.cpp: In constructor 'TouchScreen::TouchScreen(uint8_t, uint8_t, uint8_t, uint8_t, uint16_t)':
    TouchScreen.cpp:42: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'RwReg* {aka volatile unsigned char*}' in assignment
      xp_port =  portOutputRegister(digitalPinToPort(_xp));
              ^
    TouchScreen.cpp:43: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'RwReg* {aka volatile unsigned char*}' in assignment
      yp_port =  portOutputRegister(digitalPinToPort(_yp));
              ^
    TouchScreen.cpp:44: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'RwReg* {aka volatile unsigned char*}' in assignment
      xm_port =  portOutputRegister(digitalPinToPort(_xm));
              ^
    TouchScreen.cpp:45: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'RwReg* {aka volatile unsigned char*}' in assignment
      ym_port =  portOutputRegister(digitalPinToPort(_ym));
              ^
    In file included from /home/bigguiness/Arduino/test/test.ino:12:0:
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoNotFull()':
    ILI9341_t3.h:345: error: 'KINETISK_SPI0' was not declared in this scope
        sr = KINETISK_SPI0.SR;
             ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoEmpty()':
    ILI9341_t3.h:354: error: 'KINETISK_SPI0' was not declared in this scope
        sr = KINETISK_SPI0.SR;
             ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::waitTransmitComplete()':
    ILI9341_t3.h:362: error: 'KINETISK_SPI0' was not declared in this scope
       while (!(KINETISK_SPI0.SR & SPI_SR_TCF)) ; // wait until final output done
                ^
    ILI9341_t3.h:362: error: 'SPI_SR_TCF' was not declared in this scope
       while (!(KINETISK_SPI0.SR & SPI_SR_TCF)) ; // wait until final output done
                                   ^
    ILI9341_t3.h:363: error: 'KINETISK_SPI0' was not declared in this scope
       tmp = KINETISK_SPI0.POPR; // drain the final RX FIFO word
             ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::waitTransmitComplete(uint32_t)':
    ILI9341_t3.h:370: error: 'KINETISK_SPI0' was not declared in this scope
        uint32_t sr = KINETISK_SPI0.SR;
                      ^
    ILI9341_t3.h:371: error: 'SPI_SR_EOQF' was not declared in this scope
        if (sr & SPI_SR_EOQF) break; // wait for last transmit
                 ^
    ILI9341_t3.h:374: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.SR = SPI_SR_EOQF;
       ^
    ILI9341_t3.h:374: error: 'SPI_SR_EOQF' was not declared in this scope
       KINETISK_SPI0.SR = SPI_SR_EOQF;
                          ^
    ILI9341_t3.h:375: error: 'SPI0_MCR' was not declared in this scope
       SPI0_MCR = mcr;
       ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writecommand_cont(uint8_t)':
    ILI9341_t3.h:382: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
       ^
    ILI9341_t3.h:382: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                        ^
    ILI9341_t3.h:382: error: 'SPI_PUSHR_CONT' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                            ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writecommand_last(uint8_t)':
    ILI9341_t3.h:388: error: 'SPI0_MCR' was not declared in this scope
       uint32_t mcr = SPI0_MCR;
                      ^
    ILI9341_t3.h:389: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
       ^
    ILI9341_t3.h:389: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
                                                                        ^
    ILI9341_t3.h:389: error: 'SPI_PUSHR_EOQ' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
                                                                            ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata8_cont(uint8_t)':
    ILI9341_t3.h:395: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
       ^
    ILI9341_t3.h:395: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                     ^
    ILI9341_t3.h:395: error: 'SPI_PUSHR_CONT' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                         ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata8_last(uint8_t)':
    ILI9341_t3.h:401: error: 'SPI0_MCR' was not declared in this scope
       uint32_t mcr = SPI0_MCR;
                      ^
    ILI9341_t3.h:402: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
       ^
    ILI9341_t3.h:402: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
                                                                     ^
    ILI9341_t3.h:402: error: 'SPI_PUSHR_EOQ' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
                                                                         ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata16_cont(uint16_t)':
    ILI9341_t3.h:408: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
       ^
    ILI9341_t3.h:408: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
                                                                     ^
    ILI9341_t3.h:408: error: 'SPI_PUSHR_CONT' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
                                                                         ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata16_last(uint16_t)':
    ILI9341_t3.h:414: error: 'SPI0_MCR' was not declared in this scope
       uint32_t mcr = SPI0_MCR;
                      ^
    ILI9341_t3.h:415: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_EOQ;
       ^
    ILI9341_t3.h:415: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_EOQ;
                                                                     ^
    ILI9341_t3.h:415: error: 'SPI_PUSHR_EOQ' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_EOQ;
                                                                         ^
    In file included from /tmp/arduino_build_782512/sketch/ILI9341_t3.cpp:84:0:
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoNotFull()':
    ILI9341_t3.h:345: error: 'KINETISK_SPI0' was not declared in this scope
        sr = KINETISK_SPI0.SR;
             ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::waitFifoEmpty()':
    ILI9341_t3.h:354: error: 'KINETISK_SPI0' was not declared in this scope
        sr = KINETISK_SPI0.SR;
             ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::waitTransmitComplete()':
    ILI9341_t3.h:362: error: 'KINETISK_SPI0' was not declared in this scope
       while (!(KINETISK_SPI0.SR & SPI_SR_TCF)) ; // wait until final output done
                ^
    ILI9341_t3.h:362: error: 'SPI_SR_TCF' was not declared in this scope
       while (!(KINETISK_SPI0.SR & SPI_SR_TCF)) ; // wait until final output done
                                   ^
    ILI9341_t3.h:363: error: 'KINETISK_SPI0' was not declared in this scope
       tmp = KINETISK_SPI0.POPR; // drain the final RX FIFO word
             ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::waitTransmitComplete(uint32_t)':
    ILI9341_t3.h:370: error: 'KINETISK_SPI0' was not declared in this scope
        uint32_t sr = KINETISK_SPI0.SR;
                      ^
    ILI9341_t3.h:371: error: 'SPI_SR_EOQF' was not declared in this scope
        if (sr & SPI_SR_EOQF) break; // wait for last transmit
                 ^
    ILI9341_t3.h:374: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.SR = SPI_SR_EOQF;
       ^
    ILI9341_t3.h:374: error: 'SPI_SR_EOQF' was not declared in this scope
       KINETISK_SPI0.SR = SPI_SR_EOQF;
                          ^
    ILI9341_t3.h:375: error: 'SPI0_MCR' was not declared in this scope
       SPI0_MCR = mcr;
       ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writecommand_cont(uint8_t)':
    ILI9341_t3.h:382: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
       ^
    ILI9341_t3.h:382: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                        ^
    ILI9341_t3.h:382: error: 'SPI_PUSHR_CONT' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                            ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writecommand_last(uint8_t)':
    ILI9341_t3.h:388: error: 'SPI0_MCR' was not declared in this scope
       uint32_t mcr = SPI0_MCR;
                      ^
    ILI9341_t3.h:389: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
       ^
    ILI9341_t3.h:389: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
                                                                        ^
    ILI9341_t3.h:389: error: 'SPI_PUSHR_EOQ' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
                                                                            ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata8_cont(uint8_t)':
    ILI9341_t3.h:395: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
       ^
    ILI9341_t3.h:395: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                     ^
    ILI9341_t3.h:395: error: 'SPI_PUSHR_CONT' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                         ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata8_last(uint8_t)':
    ILI9341_t3.h:401: error: 'SPI0_MCR' was not declared in this scope
       uint32_t mcr = SPI0_MCR;
                      ^
    ILI9341_t3.h:402: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
       ^
    ILI9341_t3.h:402: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
                                                                     ^
    ILI9341_t3.h:402: error: 'SPI_PUSHR_EOQ' was not declared in this scope
       KINETISK_SPI0.PUSHR = c | (_pcs_data << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_EOQ;
                                                                         ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata16_cont(uint16_t)':
    ILI9341_t3.h:408: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
       ^
    ILI9341_t3.h:408: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
                                                                     ^
    ILI9341_t3.h:408: error: 'SPI_PUSHR_CONT' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_CONT;
                                                                         ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.h: In member function 'void ILI9341_t3::writedata16_last(uint16_t)':
    ILI9341_t3.h:414: error: 'SPI0_MCR' was not declared in this scope
       uint32_t mcr = SPI0_MCR;
                      ^
    ILI9341_t3.h:415: error: 'KINETISK_SPI0' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_EOQ;
       ^
    ILI9341_t3.h:415: error: 'SPI_PUSHR_CTAS' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_EOQ;
                                                                     ^
    ILI9341_t3.h:415: error: 'SPI_PUSHR_EOQ' was not declared in this scope
       KINETISK_SPI0.PUSHR = d | (_pcs_data << 16) | SPI_PUSHR_CTAS(1) | SPI_PUSHR_EOQ;
                                                                         ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.cpp: In member function 'uint8_t ILI9341_t3::readcommand8(uint8_t, uint8_t)':
    ILI9341_t3.cpp:1358: error: 'KINETISK_SPI0' was not declared in this scope
      while (((KINETISK_SPI0.SR) & (15 << 12)) && (--wTimeout)) ; // wait until empty
               ^
    ILI9341_t3.cpp:1361: error: 'KINETISK_SPI0' was not declared in this scope
      KINETISK_SPI0.SR = SPI_SR_TCF;   // dlear it out;
      ^
    ILI9341_t3.cpp:1361: error: 'SPI_SR_TCF' was not declared in this scope
      KINETISK_SPI0.SR = SPI_SR_TCF;   // dlear it out;
                         ^
    ILI9341_t3.cpp:1372: error: 'SPI_PUSHR_CTAS' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0xD9 | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                          ^
    ILI9341_t3.cpp:1372: error: 'SPI_PUSHR_CONT' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0xD9 | (_pcs_command << 16) | SPI_PUSHR_CTAS(0) | SPI_PUSHR_CONT;
                                                                              ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.cpp: In member function 'uint16_t ILI9341_t3::readPixel(int16_t, int16_t)':
    ILI9341_t3.cpp:1418: error: 'KINETISK_SPI0' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0 | (_pcs_data << 16) | SPI_PUSHR_CTAS(0)| SPI_PUSHR_CONT;
      ^
    ILI9341_t3.cpp:1418: error: 'SPI_PUSHR_CTAS' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0 | (_pcs_data << 16) | SPI_PUSHR_CTAS(0)| SPI_PUSHR_CONT;
                                                                    ^
    ILI9341_t3.cpp:1418: error: 'SPI_PUSHR_CONT' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0 | (_pcs_data << 16) | SPI_PUSHR_CTAS(0)| SPI_PUSHR_CONT;
                                                                       ^
    ILI9341_t3.cpp:1423: error: 'SPI_PUSHR_EOQ' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0 | (_pcs_data << 16) | SPI_PUSHR_CTAS(0)| SPI_PUSHR_EOQ;
                                                                       ^
    ILI9341_t3.cpp:1426: error: 'SPI_SR_EOQF' was not declared in this scope
      while ((KINETISK_SPI0.SR & SPI_SR_EOQF) == 0) ;
                                 ^
    ILI9341_t3.cpp:1427: error: 'SPI_SR_EOQF' was not declared in this scope
      KINETISK_SPI0.SR = SPI_SR_EOQF;  // make sure it is clear
                         ^
    /tmp/arduino_build_782512/sketch/ILI9341_t3.cpp: In member function 'void ILI9341_t3::readRect(int16_t, int16_t, int16_t, int16_t, uint16_t*)':
    ILI9341_t3.cpp:1451: error: 'KINETISK_SPI0' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0 | (_pcs_data << 16) | SPI_PUSHR_CTAS(0)| SPI_PUSHR_CONT | SPI_PUSHR_EOQ;
      ^
    ILI9341_t3.cpp:1451: error: 'SPI_PUSHR_CTAS' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0 | (_pcs_data << 16) | SPI_PUSHR_CTAS(0)| SPI_PUSHR_CONT | SPI_PUSHR_EOQ;
                                                                    ^
    ILI9341_t3.cpp:1451: error: 'SPI_PUSHR_CONT' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0 | (_pcs_data << 16) | SPI_PUSHR_CTAS(0)| SPI_PUSHR_CONT | SPI_PUSHR_EOQ;
                                                                       ^
    ILI9341_t3.cpp:1451: error: 'SPI_PUSHR_EOQ' was not declared in this scope
      KINETISK_SPI0.PUSHR = 0 | (_pcs_data << 16) | SPI_PUSHR_CTAS(0)| SPI_PUSHR_CONT | SPI_PUSHR_EOQ;
                                                                                        ^
    ILI9341_t3.cpp:1452: error: 'SPI_SR_EOQF' was not declared in this scope
      while ((KINETISK_SPI0.SR & SPI_SR_EOQF) == 0) ;
                                 ^
    ILI9341_t3.cpp:1453: error: 'SPI_SR_EOQF' was not declared in this scope
      KINETISK_SPI0.SR = SPI_SR_EOQF;  // make sure it is clear
                         ^
    cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'RwReg* {aka volatile unsigned char*}' in assignment
    
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    But the updated libraries are giving my the multiple press/release codes.

    Any ideas?

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,539
    Yes too old of a version of the library ILI9341_t3... for one.
    That was a version of the library before I added T4.x support...

    Options: Update to current release of Teensyduino and my changes should be in place.

    Or update your library to use the version up on github. Or use my ILI9341_t3n up on github.

    As for touchscreen support, not sure, I have mostly use the PJRC one with one touch controller or an early Adafruit version with different touch controller.
    I am not sure which version is included within the Teensy build and how it compares the one up on Adafruit github...

    You might try using their version which I see that Paul's version TouchScreen is a fork of the Adafruit_TouchScreen... not sure what the differences are now...
    Might you try the Adafruit one and see if it works the same...

  5. #5
    I don't think that touch lib works with a 4.0. I could never get it working. Is you display's touch SPI based (had for me to guess with the pins stated above)? If it is SPI based, this lib is very good

    https://github.com/PaulStoffregen/XPT2046_Touchscreen

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    10,539
    Have you tried the Adafruit one? https://github.com/adafruit/Adafruit_TouchScreen
    Which you can also install using the Library Manager.
    Looks like a PR went in Last October: https://github.com/adafruit/Adafruit...24a9fca4677174
    Which said add support for T4.1, although should work on T4 as well as it looks like they were looking at IMXRT...

  7. #7
    Junior Member
    Join Date
    Jun 2017
    Location
    Phoenix
    Posts
    15
    I went back to my original code and local libraries. I then updated my local libraries based on the differences in /opt/arduino-1.8.13/hardware/teensy/avr/libraries.

    Both the Teensy 3.2 and Teensy 4.0 board are working now. Not sure what I missed the first time...

    BTW, the TouchScreen libraries work fine with the Teensy 4.0 board.

  8. #8
    Quote Originally Posted by hsweeten View Post
    I went back to my original code and local libraries. I then updated my local libraries based on the differences in /opt/arduino-1.8.13/hardware/teensy/avr/libraries.

    Both the Teensy 3.2 and Teensy 4.0 board are working now. Not sure what I missed the first time...

    BTW, the TouchScreen libraries work fine with the Teensy 4.0 board.
    It would be interesting to see a small sample program that uses this display and works with Teensy 4.0.

  9. #9
    Junior Member
    Join Date
    Jun 2017
    Location
    Phoenix
    Posts
    15
    The examples in the default libraries in Arduino 1.8.13/Teensyduino 1.53 actually work fine with both the Teensy 3.2 and Teensy 4.0.

    For my purpose I have modified both libraries a bit so just updating to the default libraries wasn't an option. I had to go down the rabbit hole and actually figure out what was added to make them work with the Teensy 4.0.

Posting Permissions

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