[riot-notifications] [RIOT-OS/RIOT] cpu/sam0_common/spi: move out pin muxing into spi_acquire / spi_release (#14107)

Juergen Fitschen notifications at github.com
Fri May 22 14:01:28 CEST 2020


Sry for the spam.

I think, I understand what's going on here: All output pins go HIGH-Z, when `dev(bus)->CTRLA.reg &= ~(SERCOM_SPI_CTRLA_ENABLE);` is called.

High-Z causes floating on the SCK line which leads to undefined voltage levels. Connected slaves feed their clock system from SCK. If SCK is not gated by the CS line, they start to draw current, unexpectedly.

I think we have only two options:
1. Keep the SPI peripheral on all the time.
2. Mux the SCK pin to GPIO function before the SPI peripheral gets disabled.

I would opt for 2. and will push a fixup commit. Option 1. costs too much energy (~400uA for two enabled SPI peripherls.)

The MOSI line should be uncritical because its read by the SPI slave on rising or falling edge of SCK.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14107#issuecomment-632656370
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200522/009c8155/attachment.htm>


More information about the notifications mailing list