SPI Slave - MISO line not availble for other slave devices Topic is solved

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
PVS_Bram
Member++
Posts: 21
Joined: Fri Jan 12, 2024 11:20 am

SPI Slave - MISO line not availble for other slave devices

Post by PVS_Bram »

In a XMOS USB audio project in which I use the XU316-1024-QF60B. I also implemented the XMOS SPI Slave AN00161 library to be able to communicate with another HostCPU present in the PCB stack. My implementation is the same as in the application note without the SPI master part since this is done at the Host CPU side.

The SPI Slave implementation works as long as the XMOS and the HostCPU are the only devices that are communicating over SPI. The MISO line does not seem to be high impedant from the XMOS when not Slave Selected by the HostCPU. All seems to function for the other SPI devices when I disable the XMOS SPI Slave implementation. The application note does clearly state that the implementation should work with other SPI Slave devices:
and is compatible with other slave devices on the same bus
Is there a solution to solve the MISO problem I am having with the SPI Slave Library? I saw that there are functions to disable or set certain pins in high impedant mode. But I would expect this to be implemented in the SPI library side since the AN is advertised as working with other SPI Slave devices.

Thanks for your help and tips.

Bram
View Solution
Joe
Verified
Experienced Member
Posts: 96
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

Looks like the library does not support this currently, looks to be always driving as you've noticed.

It's a single line change to change the miso output to drive in open drain mode (set_port_drive_low(miso)) but obviously you'd need to add a strong external pullup if the interface is to run at any significant clock speed. That might be a relatively easy workaround though. 2k2 pullup would give you 22ns rise time with a Cl = 10pF.

Another workaround to support higher speeds would be to add a three state buffer (74LVC1G125) on the miso line with the OE_N pin connected to SS_N. This would only then drive when slave select was low.

As you say the proper fix is to fix this in the library but it would take a small re-architecting of how it works looking at it so would need a bit of thinking about.

Feel free to add this as an issue to https://github.com/xmos/lib_spi.

Cheers,
Joe
XMOS hardware grey beard.