Teensy 4: SPI using Audio Board and TFT display?

Status
Not open for further replies.

DerekR

Well-known member
On the PJRC page for the 2.8" TFT display (here), Paul gives the T3.x SPI connections for the display, with and without the Audio Board. This page has not been updated for use with the T4.
I'm just getting around to wiring up a T4 with both a display and an Audio Board, and I'm confused how to handle the situation. It seems the T3.6 had just one SPI port and a set of alternate pins, but the T4 has multiple ports and no alternate pins. So how do we handle it?
The Audio Board is working well on SPI0 on its own, but how do I handle the display as well? I've searched the forum and looked at the libraries...
 
Note, if you are not using either the SD card (pin 10 is the CS) nor the flash memory (pin 6 is the CS), the audio board does not use SPI. If that is the case don't connect pin 10 to the audio board, and instead use it for the display. You only have one fast pin (pin 10) on the first SPI bus. I see ILI9341_t3 has changes in it for running on the T4, but I haven't tried using it personally.

If you do need to use the SD card, you might try using a different pin on the Teensy and connecting that pin to pin 10 on the audio board.

There seem to be various threads where displays are discussed (and often the three main principals seem to jump from display to display in the thread):
 
@MichaelMeissner: I was basing the need for resolving conflicts between the display and the Audio Board on Paul's description when describing the SPI library here:
Sometimes, the SPI pins are already in use for other tasks when an SPI device is added to a project. If that task is simply a digital pin, or an analog input, it is usually better to move that to another pin so that the hardware SPI can be used. Sometimes though, the conflicting pin cannot be moved. The Audio Adapter, for example, uses some of the SPI pins to talk to the Audio DAC over I2S. For this case, Teensy 3.x provides an alternate set of SPI pins.
I presume when he says "Audio DAC" he means the SGTL5000 codec. This makes it sound that the Audio Board needs SPI for more than the SD card?
 
@DerekR - that SPI note on alternate pins is saying - because the Audio Board covers typical SPI pins in order to use - shift to their required Alternate functions - it forces typical SPI use to move to alternate SPI pins for that reason. That need is different between T_3.x and T4 because of the pin functional changes noted below.

Also : T4 indeed works well with ili9341 - though the T4 - unlike the T_3.x boards have differing SPI behavior and they do not have an affinity to hardware CS pins where that allowed combined efficient behavior during SPI transactions. In the case of T4 - IIRC any digital pin can be given as an SPI CS pin.

Also - to the OP - the T4 audio board connection does require unique wiring others have made notes of to move to pins with 'functional changes' - perhaps MichaelM linked above. Make those connections first as needed - then find the Needed SPI pins for the display.

PJRC will soon be releasing a version of the Audio board that is made to accommodate the pins with 'functional changes' - and directly connect to the T4 PCB.
 
@MichaelMeissner: I was basing the need for resolving conflicts between the display and the Audio Board on Paul's description when describing the SPI library here:

I presume when he says "Audio DAC" he means the SGTL5000 codec. This makes it sound that the Audio Board needs SPI for more than the SD card?

IIRC, the SGTL5000 codec is controlled via I2C (pins 18 and 19) and I2S (pins 7, 8, 23, 21, and 20 on the Teensy and 9, 11, 13, 22, and 23 on the Audio adapter). I thought SPI (pins 11-13 + the 6/10 CS pins on the Teensy, and pins 7, 12, 14 + the 6/10 CS pins on the Audio adapter) was only used for the SD card and flash memory systems.
 
Status
Not open for further replies.
Back
Top