Teensy 4.0 and multi-SPI support question

Status
Not open for further replies.

leonid

Member
I am using Teensy 3.2 and want to speed up with T4.0 upgrade. My project uses 2 SPIs, on T3.2 SPI0(pins 11,12,13) and SPI1 (pins 7,8,14). SPI0 seems to be pin-compatible between T3.2 and 4.0. Would pins 7,8,14 (MOSI,MISO,SCLK) work as alternative for SPI1 on T4.0? If not, what would be the SPI1 pins on T4.0 (27 is SCK1, 26 is MOSI1, MISO1 is not marked). I need to use SPI1, I want to use SPI2 for a future project expansion.

From the software site, do <SPIN.h> and <ILI9341_t3n.h> support T4.0?
 
Teensy 4 maps the internally defined SPI peripherals as follows:
Hardware Peripheral LPSPI4 is mapped to SPI using CS=pin10, MOSI=pin11, MISO=pin12, SCK=pin13
Hardware Peripheral LPSPI3 is mapped to SPI1 using CS1=pin00, MOSI1=pin26, MISO1=pin01, SCK1=pin27
Hardware Peripheral LPSPI1 is mapped to SPI2 using CS2=pin36, MOSI2=pin35, MISO2=pin34, SCK2=pin37

(As far as I know), These pins cannot be changed. I don't know about the libraries you referenced.
 
I am using Teensy 3.2 and want to speed up with T4.0 upgrade. My project uses 2 SPIs, on T3.2 SPI0(pins 11,12,13) and SPI1 (pins 7,8,14). SPI0 seems to be pin-compatible between T3.2 and 4.0. Would pins 7,8,14 (MOSI,MISO,SCLK) work as alternative for SPI1 on T4.0? If not, what would be the SPI1 pins on T4.0 (27 is SCK1, 26 is MOSI1, MISO1 is not marked). I need to use SPI1, I want to use SPI2 for a future project expansion.

From the software site, do <SPIN.h> and <ILI9341_t3n.h> support T4.0?

Yes the ILI9341_t3n supports the T4.0 and you no longer need the SPIN library to use the ILI9341_t3n library. The constructor defaults for the SPI0 MISO, MOSI, and CLK, but you do have to specify CS, DC and RST if you use RST. To use SPI1 you have to specify the MISO, MOSI and CLK pins as well.
 
It should be noted that several of our other drivers like ST7735/ST7789, ILI9388, HX... have versions of libraries that work with the different SPI busses. WIth some of them you need to pass in which SPI object to use. With others it guesses if you pass in the pins for MOSI, MISO, and SCK...

And for what it is worth I have done some playing around with FlexIO system on T4 and have a version of SPI that works.

NOte; Just to day I renamed some of the code in my own library: https://github.com/KurtE/FlexIO_t4
I renamed the FlexSPI object in this library to FlexIOSPI as to avoid confusion with the other sub-system FlexSPI... I also updated my test library: https://github.com/KurtE/SSD1306_FlexIO
Which can use this to create A logical SPI object on FlexIO pins Note: Mosi, MISO, SCK pins have to be on the same FlexIO object in this case...
Also I needed to separate the code out from normal SPI as there is not a common base clase...

I also started playing around with ST7735 library as well, but have not gone very far with that one yet.
 
Status
Not open for further replies.
Back
Top