T3 - Multiple SPI?

Status
Not open for further replies.

hookedup

New member
I noticed there seemed to be 4 SPI outputs on the T3. Can these be used at the same time (i.e. one clock, three data) or is this really a single SPI output? The FEZ Panda II has 2 SPI ports which allows 2 runs of LEDs that do not have chip select / disable capabilities. If there were a way to stream 4 sets of such LEDs at once, that would be an amazing capability. I am not asking for a library to do this, just to know the raw SPI system could or could not handle such a task.

Side note: I have two T3s from the kickstarter project - congrats and great work!
 
AFAIK there is just one SPI port (a normal SPI port uses 4 lines: CLOCK, MISO/DIN, MOSI/DOUT, CS) but of course you can also use any available digital I/O for the CS line(s), if your program bit-bangs the CS pin. The Teensy 3 chip allows the CLOCK, DIN, DOUT to be reassigned to a secondary set of pins shown in light grey on the pinout diagram below, although Paul's Arduino environment does not yet enable that feature.
http://www.pjrc.com/teensy/pinout.html

Of course, depending on the data rate you need, a software SPI implementation may be usable as well.

I would consider a device with no CS (chip select) input as a bare shift register, rather than SPI. With a simple external tri-state latch you could easily expand the SPI output to drive several such devices (eg. just turn off the CLOCK output to the devices you aren't driving at the moment)
 
Last edited:
There is only one SPI port available, with 5 Select Lines ( CS0 to CS4 ) so you can directly drive 5 SPI devices with 1 port (CLK/DIN/DOUT/CSx). That means that CLK DIN & DOUT are shared by all devices, but CSx is specifit to each device.
The light gray SPI pins are, as JBeale just said, just an alternative pinout.
 
There's more (as always...)

CLK/DIN/DOUT are fixed as they are driven by hardware. But the CS pin is not time critical so you could use digitalWrite([port], LOW) to select a device and HIGH to deselect it (CS is active LOW).

On these nice little Teensy 3.0 cards there is actually a second SPI bus visible where the ports are written in grey. But I don't know how to use them:
b47af8930ab8a169e37c95534ab9945e_large.png
 
there is actually a second SPI bus visible where the ports are written in grey
There is only one SPI bus - see Chapter 43 of the manual. The chip has a multiplexer which allows you to reassign inputs/outputs to different pins - see Chapter 10. For example, the SPI SCK signal is normally on T3 pin13 but it can be reassigned to pin14 - I've done it (with help from Paul). See http://forum.pjrc.com/threads/431-Reassigning-a-pin-(SPI-SCK)
So you could reassign the bus DOUT/DIN signals from pins 11/12 to pins 7/8 but it isn't a different bus.

Pete
 
THT, this picture is the old, wrong one (I know it's on the KS front page, but Paul explained that he can't change anything there after the ks was finished.

this is the one you get with your teensy :

card5a.png


card5b.png
 
Status
Not open for further replies.
Back
Top