Skip to content
MichaelMeissner edited this page Mar 17, 2020 · 24 revisions

SPI (Serial Peripheral Interface)

All ARM Teenys have at least 1 SPI bus, some have more than one.

Each SPI bus has 3 dedicated pins shared with all devices on the SPI bus:

  • MOSI -- data from Teensy to the device;
  • MISO -- data from the device to the Teensy; (and)
  • SCLK -- clock.
  • Each device has at least one additional pin per device (CS) that says the device is active;
  • Some SPI devices have a D/C pin that says whether the data being sent is data or command;
  • Some SPI devices have other pins, such as a reset pin.
  • The Teensy 3.2 pinout card uses the name DOUT instead of MOSI and DIN instead of MISO.

SPI tutorials

Debugging SPI systems

First SPI bus

  • On ARM Teensies, the first SPI bus uses Pin 11 (MOSI0), Pin 12 (MISO0), and Pin 13 (SCLK0) as the standard pins. This is compatible with many of the older Arduino systems.
  • See the pinout cards for your Teensy for the Alternate pins (Teensy 4.0 does not have alternate SPI pins).
  • If you use the revision A-C Audio shield on the Teensy 3.2, 3.5, or 3.6 processors, you will need to use the alternate pin for MOSI0 (pin 7) and SCLK0 (pin 14), since the I2S bus used by the audio shield uses pins 11 and 13.

Special SPI pins for the Teensy 3.2, 3.5, and 3.6

Some SPI displays on the Teensy 3.2, 3.5, and 3.6 systems have special optimizations if you use one of the special pins for both the CS and the D/C pins on the first SPI bus. Several of the pins are exclusive, in that if you use one of the pins for a SPI function, you cannot use the other (but you can use the pin for some other use). The pins are:

  • Pin 2 or pin 10;
  • Pin 6 or pin 9;
  • Pin 15/A1;
  • Pin 20/A6 or 23/A9; (and)
  • Pin 21/A7 or 22/A8.
  • Explanation of these fast pins
  • The Teensy 4.0 has limited optimizations for pin 10 being a special CS pin.
  • The Teensy LC does not have these optimizations.
Clone this wiki locally