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

Thread: Teensy 3.2 ILI9341 Touch and SD wiring (ILI9341_t examples)

  1. #1
    Junior Member
    Join Date
    Feb 2017
    Posts
    9

    Teensy 3.2 ILI9341 Touch and SD wiring (ILI9341_t examples)

    Hello

    today my ili9341 arrived and i successfully wired the display pins which also can be found on this site: https://www.pjrc.com/store/display_ili9341.html
    There are only 9 pins listed for the display but not the 5 pins for touch and 4 for the sd card. How must i wire them to be able to use the ILI9341_t examples for touchpaint and bitmap example?
    Thanks a lot

  2. #2

  3. #3
    Junior Member
    Join Date
    Feb 2017
    Posts
    9
    Thank you it works with this wiring but seems like the library used in the ILI9341_t examples arent made for this touch, didnt know I have to use a different one than for the ILI9328.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,418
    If you are using the Touch ILI_9341 display above

    It needs another library included to utilize the associated SPI TOUCH pins as noted on that page: The XPT2046 touch controller can be read with this XPT2046_Touchscreen library.

  5. #5
    Junior Member
    Join Date
    Feb 2017
    Posts
    9
    Yeah thanks for linking the library, its already working for me like i want it but it might help future people

    Have a good night!

  6. #6
    Junior Member
    Join Date
    Feb 2017
    Posts
    9
    Sorry for the bump, but are there also some guides on how to wire the SD part of the ILI9341 (4 Pins SD_CS, SD_MOSI, SD_MISO, SD_SCK) to a Teensy 3.2?

    Thanks for any help!

  7. #7
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,443
    If you look at the page for the display on the store, you will see:
    We do not recommend using the SD card socket on this display. It does not work, but this hardware modification may be able to get it working

  8. #8
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    8,443
    Other side note: I decided to upload a copy of my modified version of touchpaint which I called touchpaint_xpt2046 which is setup to use the touch sensor on the PJRC screen. I issed PR #44 (https://github.com/PaulStoffregen/ILI9341_t3/pull/44) with the program.

    But as I mentioned in the PR I have not tested it in awhile with default IO pins. Testing was done on my Flexiboard which uses alternate SPI pins.

    Also maybe could still use a little more TLC on the MIN/MAX values used to convert touch point to screen coordinates. They currently are set to what values I observed on my first PJRC touch screen.

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    13,418
    I see you found these numbers on your device (re-ordered to match my array below):
    #define TS_MINX 337
    #define TS_MAXX 3729
    #define TS_MINY 529
    #define TS_MAXY 3711
    I found these numbers as integrated into sample in the tsMap[0] group - last touched Nov 2015 - not even updated for Interrupt pin usage as I did it:
    TS_MAP tsMap[5] = { {200, 3700, 325, 3670 }, { 0, 319, 0, 239 }, { 319, 0, 0, 239 }, { 319, 0, 239, 0 }, { 0, 319, 239, 0 } };
    That link to a short sample that could be easily updated to show interrupt usage and perhaps other cleanup. But that tsMap[] array allows for run time rotation with calibrated pixel return - which that sample demonstrates, along with a way to use the display to post DEBUG text to specific lines.

    That [0] element holds the MIN/MAX values and an interface could be added to allow them to be updated during setup. Would be good in combination with a test hit sample perhaps to put out the device specific values as used. Those could then be compiled into setup() at runtime. I got distracted with my button work and never got that integrated back into the XPT2046_Touchscreen itself. After a year some folks using my samples saw the points may not have been right - though I never saw feedback to follow up on as the above might allow correcting as displays evolve/change.

    Kurt let me know if you see value in that - perhaps you might tackle it or twist my arm into making it so.

Posting Permissions

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