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

Thread: Teensy 4.1 MQS and the ILI9341_t3 library ?

  1. #1
    Junior Member
    Join Date
    Jan 2021

    Teensy 4.1 MQS and the ILI9341_t3 library ?

    As seen it stated in a lot of threads that the MQS uses pin 10 and pin 12 , which is used by the default SPI.
    I've tried moving to the alternative SPI pins 26,27,38,39 , with the define the lot. ILI9341_t3 tft = ILI9341_t3( TFT_CS , TFT_DC, TFT_RST, TFT_MOSI, TFT_SCLK, TFT_MISO );
    But it still uses the default pins , and only CS and DC makes any difference.
    I think the library was made for the Teensy 3x , so thinks my pins aren't valid ?

    What do I need to do to move SPI or the MQS pins ? OR is there a Library I should be using on the Teensy 4.1 with the ILI9341 display ?

    Thanks in advance Peter

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Ayer Massachussetts
    It looks like ILI9341_t3 does not have support for the second SPI bus in Teensy 4.0/4.1. Some display drivers have a method to access the second SPI bus, some do not.

    Note, there are 2 concepts. The first is independent SPI buses. These are completely separate SPI buses. The Teensy LC, 3.5, 3.6, 4.0, and 4.1 have a second SPI bus. To access this bus, you would the global variable 'SPI1' instead of 'SPI'. These separate SPI buses are on completely separate pins.

    The other concept is alternative pins for the SPI bus. This allows you to use different pins for the 3 SPI pins (MOSI, MISO, and SCLK). The Teensy 3.x processors allows you to use specific other pins as alternates to pins 11, 12, and 13. The Teensy 4.0 and 4.1 only has 1 alternate pin (substituting pin 39 for pin 1 with the SPI1 MISO1 pin).

    So unfortunately, you cannot move either MQSL/MQSR nor MOSI0, MISO0, or SCLK0.

    KurtE has an alternate library ILI9341_t3n ( that does allow you to use the separate SPI buses.

  3. #3
    Junior Member
    Join Date
    Jan 2021
    Thank you , So the ones mark with a 1 on the card are not alternates which can be used with the normal SPI library , but a second independent SPI bus SPI1 ?
    I will look for the ILI9341_t3n library and see if I can use it on the teensy 4.1 or use i2s which I don't think uses any of the SPI pin.
    My project started life on the esp32 ,but the teensy looked easier to have sound , i2c and SPI for the display all on one chip no extra sound chips etc.

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Yes, the T4 and T4.1 actually have a few SPI buses.

    Click image for larger version. 

Name:	T4.1-Cardlike.jpg 
Views:	25 
Size:	214.9 KB 
ID:	23368

    They are shown on the released card as well as my excel document and photo made from it:
    SPI1 has a few alternate pins for some of the features (on T4.1) which I show.
    Note the ones with Black text are the default pins for it. If in RED you may have to do something like: SPI1.setMISO(39);

    Note: the ILI9341_t3n library does this automatically if you pass in the pin numbers where all of the SPI pins (MISO, MOSI, SCK) are on SPI1, likewise SPI2

  5. #5
    Junior Member
    Join Date
    Jan 2021
    So the default pins for SPI1 to pass is pins 0/1/26/27 ?

    are CS and DC any digital pin and my problem pin is just MISO pin 12 ?.
    So need to use pin 1 , 26 , 27 and the CS pin is any ?

    #define CS_PIN 8 // touch screen
    #define TFT_DC 9
    #define TFT_CS 0
    #define TFT_MOSI 26
    #define TFT_SCLK 27
    #define TFT_MISO 1
    #define TFT_RST 255
    Last edited by peter247; 01-19-2021 at 08:24 PM.

Posting Permissions

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