Audio Shield SPI Sharability Question

Status
Not open for further replies.

lemmings

Member
Hi there, just a quick question here about sharing the SPI pins that are used for the Audio Shield. I would like to use those pins for a small OLED screen (SSD1322) as well. The specs for the Audio Shield say these pins are shareable, are there any limitations there? The OLED screen will not be running any video or complicated animations, just a menu, but the teensy will be running a teensy synthesizer. I haven't used SPI before, so I'm just trying to avoid running into future problems after I have a pcb for my project printed. Thanks everyone!
 
Ahh, excuse me, I just realized the SPI for the Audio board is only for accessing the SD Card reader, which I am using too, but I imagine there won't be an issue here.
 
SPI is a common bus that can have multiple devices on - each gets a unique CS or chip select pin. If the hardware is built right it won't interfere with other devices when its CS is not selected.

Paul has a post on TriState that IIRC is linked on PJRC.COM in some SPI related place 'how to properly do SPI'.

Audio card has SPI for FLASH and SD card when used.

If using a T_3.6, T_3.5 or T_4.1 ( or wiring the SD card under the T_4.0 ) they use a unique set of SDIO pins that give faster 4 bit SPI SD card access and do not use any of the SPI pins.
 
If you do use a SD card, it's important for every library accessing SPI to use the beginTransaction() and endTransaction() functions if the audio library is also reading files from the SD card. Today most libraries do use these functions. But if you have an old library from before those function were part of Arduino's API, or if you write your own, not using those functions will cause problems. They are essential for the SPI library to manage access between different software uses of the bus.
 
Ah thank you very much for this info! Really appreciate it. I'll be sure to follow this procedure as well as the guidelines laid out on the link provided.
 
And one other thing to remember. If you are using Teensy 3.1, 3.2, 3.5, or 3.6, the Audio Shield and library remap two of the SPI pins:
  • MISO: Normally pin 11, now pin 7;
  • SCLK: Normally pin 13, now pin 14.

The revision D shield for the Teensy 4.0 and 4.1 do not do this remapping (i.e. MISO is 11 and SCLK is 13).

Both pins 6 (flash memory) and 10 (SD-card) are used as the audio shield's SPI devices.
 
Status
Not open for further replies.
Back
Top