teensy audio and SPI port 1

benyboy

Member
Hi , I am trying to add a radio module ( si446x ) to teensy 4.,1 while also using audio adapter rev D.

pins , 10,11,12,13 appear to be used by the audio adapter for SPI SD card ( I think its shared with the SD card on the teensy 4.1 )

Can I safely use SPI1 instead of SPI0 for my RF board ?

pins 0,1,26,27 pins 0,1 are also RX1 RX2 a UART ? on the schematic AD_BO_2 and AD_BO_3 are what ?

does anyone have a PDF schematic of the teensy 4.1 ? or something other than the picture on the website , I find that really hard to read / search for pin connections.

any help / advise / pitfalls of using SPI1 would be much appreciated.
 
Hi , I am trying to add a radio module ( si446x ) to teensy 4.,1 while also using audio adapter rev D.

pins , 10,11,12,13 appear to be used by the audio adapter for SPI SD card ( I think its shared with the SD card on the teensy 4.1 )

Can I safely use SPI1 instead of SPI0 for my RF board ?

pins 0,1,26,27 pins 0,1 are also RX1 RX2 a UART ? on the schematic AD_BO_2 and AD_BO_3 are what ?

does anyone have a PDF schematic of the teensy 4.1 ? or something other than the picture on the website , I find that really hard to read / search for pin connections.

any help / advise / pitfalls of using SPI1 would be much appreciated.

The SPI is a shared bus, so you can have other devices on the bus. Each device must have at least one CS pin that tells the device that the SPI packets are meant for it. There are a few devices that don't have CS pins -- these devices generally can't share the SPI bus (these are mostly cheap displays). Also there are a few devices that don't tri-state the bus correctly, and they also can't share the SPI bus. Here is a paper that talks about the three things to look out for:


The Teensy 4.1 actually has 4 SPI controllers. The main one uses pins 11, 12, and 13. The second uses pins 26, 1 or 39, and 27. The third one is used for the SD card, and the fourth one is used for the optional PSRAM and FLASH memory chips underneath the Teensy.

As I see it, you have 3 options:

  • Use the standard SPI device and just choose pins other than 6 or 10 for the CS pin. If you don't use the two SPI devices on the audio adapter (the adapter's SD drive that uses pin 10 for the CS pin and the pads for soldering a flash memory chip that uses pin 6), it probably will just work, because you won't be sharing the SPI bus. The Audio adapter only uses the SPI bus for those two devices.
  • Assuming your driver supports using a secondary SPI device, it should just be a matter of changing the constructor to reflect this setup and use the secondary SPI device. You could use the third and fourth SPI devices but those are harder to get to, and since the second SPI is otherwise unused, I would say go for the second.
  • Just don't connect pins 6, 10, 11, 12, and 13 from the Teensy to the audio adapter. Then there won't be an issue, since the audio adapter won't see any SPI traffic. Of course with this, you won't be able to access the SD card on the audio adapter (the SD card on the Teensy itself is still accessible) nor the flash memory on the adapter. Given you can solder flash memory to the Teensy 4.1, you could use that to access flash memory.
 
The SPI is a shared bus, so you can have other devices on the bus. Each device must have at least one CS pin that tells the device that the SPI packets are meant for it. There are a few devices that don't have CS pins -- these devices generally can't share the SPI bus (these are mostly cheap displays). Also there are a few devices that don't tri-state the bus correctly, and they also can't share the SPI bus. Here is a paper that talks about the three things to look out for:

Yes my device has CS but it will be hardware interrupt driven on packets received so I think it may be better its the only thing on the SPI bus.
the SI446x part SPI can run at up to 10mhz and SD will pass over SPI at around 128000 bps so maybe its ok on shared SPI1 bus but
I'd rather that not be a possible issue for now. I also still don't know what else is hooked up to SPI1.

I will do as you say and disconnect pins 6, 10, 11, 12, and 13 from the audio adapter board and teensy.
I read there is a FIFO on teensy main SPI0 port. Maybe that will help to?

Thanks for your advise.

I'm new to teensy. the library I'm using needs to define build flags so I having to use platform IO and have no way to debug yet ( breakpoints etc )
I think I just have the debugger setup wrong but that's another issue. will make another post for that.
 
Yes my device has CS but it will be hardware interrupt driven on packets received so I think it may be better its the only thing on the SPI bus.
the SI446x part SPI can run at up to 10mhz and SD will pass over SPI at around 128000 bps so maybe its ok on shared SPI1 bus but
I'd rather that not be a possible issue for now. I also still don't know what else is hooked up to SPI1.
Nothing is hooked up to either SPI bus until you connect something. If you connect the audio shield with the default pins, there would be two SPI devices (audio shield and flash memory on the audio shield), but until you enable either pin 6 (flash memory) or pin 10 (SD card reader), these devices should not be active.

The other two SPI buses for micro SD and flash/psram will have those devices connected.
 
Nothing is hooked up to either SPI bus until you connect something. If you connect the audio shield with the default pins, there would be two SPI devices (audio shield and flash memory on the audio shield), but until you enable either pin 6 (flash memory) or pin 10 (SD card reader), these devices should not be active.

The other two SPI buses for micro SD and flash/psram will have those devices connected.

Yes thanks , I cut the pins off anyway now as I don't need sd card on audio shield or the flash mem pads , maybe I could have left them on , just 2 x 10k pullups on pin 6 and 10.

I set the pins up the library and chose pin 41 as the hardware interrupt pin.

Now onto my other debugging problem :)
 
Yes thanks , I cut the pins off anyway now as I don't need sd card on audio shield or the flash mem pads , maybe I could have left them on , just 2 x 10k pullups on pin 6 and 10.

I set the pins up the library and chose pin 41 as the hardware interrupt pin.

Now onto my other debugging problem :)
IIRC, the audio adapter already includes pull-up resistors for pins 6 and 10. But random other SPI boards don't include pull-up resistors.
 
Back
Top