This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problems with using 2 spi slaves (sdcard and one more spice device)

Hi,

I wanna use nrf51822 as master which has 2 slaves:  sdcard (fatfs) and adc

I set SPI_INSTANCE 0

and they don't want to work together, I mean I'd like to write some data to sd card and after that call ADC.

sd_write();

callADC();

but if I comment out one of them (sdcard or ADC) it works fine only if I use SPI_INSTANCE 1 of ADC

But I want to use shared clock, most and miso

also I tried to set each CS to HIGH before calling

What I do wrong?

ps: from these topics I found out that nrf51 can't switch chip selects

https://devzone.nordicsemi.com/f/nordic-q-a/23432/interfacing-two-slaves-on-spi-master

https://devzone.nordicsemi.com/f/nordic-q-a/23488/a-nrf52-function-mapping-to-nrf51

And some alternative solutions, but nothing instead of using different pins for spins instance helped

But still, is it possible to use 1 master and 2 more slaves (where one of them is SDC) with shared SPI lines (of course instead of CS) with chip select switch???

Related