Two SPI devices on Teensy 4.0

frohr

Well-known member
Hi all,
is possible to conenct two SPI devices, display and 24-bit ADC on Teensy 4.0? I have no clue hot to do it.
Wiring you can see on picture.
Could I use same pins and control both devices by software?
Thanks for any advice.
Michal

SPI.jpg
 
See Better SPI Bus Design in 3 Steps

It is possible, as long as the devices are designed to tri-state their MISO to keep the Pin #12 usable.

SPI BUS on Teensy pins 11, 12, 13 can then be shared to multiple devices for use 'in turn' where each requires a unique CS pin connected.

And for Teensy 4.0, those pins must see only 3.3V from the device.
 
the MISO/MOSI/SCK can be ran in parallel provided the devices tri-state their MISO pin on deassertion of the CS pin. However, the other pins should be different: CS, RST, DRDY, RST etc
 
I am working on a project that could use two SPI signals. How do you configure the two CS pins using TeensyDuino? Can you use pins 9 and 10 and somehow tell the Teensy to switch, or can you not use pin 10 (say use pins 8 and 9 as GPIO) and disconnect 10 all together? Thanks for your great work.
Jack
 
On this page, scroll down to Example using transactions to see how 2 SPI devices are handled.

Paul
 
The problem with that is that while the display is updating which can take some time depending on bit depth and resolution, you can't use the ADC, It may or may not matter depending how fast you need to read the ADC.

I'm using DAC and ILI9341 on 2 SPI busses on teensy 4.1 (and the optional psram with qspi) The display uses ILI9341_T3n which controls it's own bus, and the DAC is controlled with SPI library. they work completely independently without affecting each other's speed.
 
Back
Top