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

Thread: ILI9341 Touchscreen doesn't work with Teensy 4.0

  1. #1

    ILI9341 Touchscreen doesn't work with Teensy 4.0

    I am using Teensy 4.0 and library ILI9341_T4 which is written especially for this display and this microcontroller. The display itself works, it displays image properly. However, I haven't succeed in implementing touch feedback to my program. I connected the display this way:
    #define PIN_SCK 13
    #define PIN_MISO 12
    #define PIN_MOSI 11
    #define PIN_DC 10
    #define PIN_CS 9
    #define PIN_RESET 6
    #define PIN_BACKLIGHT 255
    #define PIN_TOUCH_IRQ 1
    #define PIN_TOUCH_CS 2
    Click image for larger version. 

Name:	IMAGE 2021-09-27 21:51:09.jpg 
Views:	28 
Size:	143.5 KB 
ID:	25993Click image for larger version. 

Name:	IMAGE 2021-09-27 21:50:57.jpg 
Views:	42 
Size:	83.2 KB 
ID:	25994
    When I try to debug x, y, z values in the Serial Monitor I see random values.
    I connected T_CLK to the same pin as SCK; T_DIN to MOSI (SDI); T_DO to MISO (SDO). Probably that's why it does not detect touch properly.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    In all cases like this it helps if for example you say which display it is... One direct from PJRC? I assume not Adafruit version...
    Product page:
    Shows proper wiring, plus points you to which Touch library (XPT2046)

    Also would help if you showed the code that is not working. For example which library are you using?
    That is some of the original examples were setup for Adafruit library with Adafruit displays which use a different touch library.

    And for example the touchpaint example sketch for the ili9341_t3 library is still setup this way.
    using the library.: #include <Adafruit_STMPE610.h>

    I had/have a version of this that was converted to the PJRC display, that I issued a PR for it awhile ago (2017), but closed it out a year or so ago as not sure what state it was in after a few years...
    Note: It was probably pretty close to the one I have in my ili9341_t3n library:

  3. #3
    Join Date
    Oct 2016

    The ILI9341_T4 library borrows code from Paul's XPT2046 library to drive.the.touchscren. I did not test it fully but it did work for the touch screens I have.

    Did you specify that you are using the touchscreen in the TFT.begin() method (by specifying the pin for TOUCH_CS) ? Can you try the "touchscreen_calibration" example bundled with the library to see if it works ?

    You can also try setting TOUCH_IRQ to 255 (to disable it) and see if this helps.

  4. #4
    That type of ILI9341 screen does not have a touch panel. Photo of the back of your TFT or link to the site where you purchased it

Posting Permissions

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