
Originally Posted by
young.javier
Yes, I've connected using the second column (Teensy 3.x Audio Board) because I plan to use the Audio Board. Is that Ok?
So is it easy to "tell the SPI library that the alternate pins are used"?
Sorry if these are noob questions but well... I'm a noob
Thank you for your time!
In general, if you go over to https://www.pjrc.com/teensy/td_libs.html, it has all of the pages for documentation about the Teensy libraries.
From there, go to the SPI page, https://www.pjrc.com/teensy/td_libs_SPI.html. It has the following text:
Alternate SPI pins
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.
The main SPI pins are enabled by default. SPI pins can be moved to their alternate position with SPI.setMOSI(pin), SPI.setMISO(pin), and SPI.setSCK(pin). You can move all of them, or just the ones that conflict, as you prefer. The pin must be the actual alternate pin supported by the hardware, see the table above; you can't just assign any random pin.
You should be aware that libraries sometimes have to move SPI pins. (The Audio Library is an example). If you add an SPI device yto your project and it does not work, check whether the library has moved the pins and if so, use the same pins the library does.
If all else fails, the SPI protocol can be emulated ("bit-banged") in software. This has the advantage that any convenient pins can be used, and the disadvantage that it is much, much slower and prevents your sketch from doing useful work meanwhile.