cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Spi Devices with STM32F107

giovani
Associate II
Posted on May 09, 2016 at 21:31

Hello all!

We developed a board with 3 SPI devices, STM32F107 is the master and the slaves are SD Card(SPI mode 0) and ADS1118 (SPI mode 1). So if I run my firmware for anyone of slaves separately is works but when I try to integrate both just reads from ADS1118.

Thanks,

Giovani
3 REPLIES 3
Posted on May 10, 2016 at 00:32

So does the chip select on the ADS1118 not work properly, or is it asserting a data ready signal?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
John F.
Senior
Posted on May 10, 2016 at 09:44

The ADS1118 Data Sheet says,

The chip select pin (CS) selects the ADS1118 for SPI communication. This feature is useful when multiple devices share the same serial bus. Keep CS low for the duration of the serial communication. When CS is taken high, the serial interface is reset, SCLK is ignored, and DOUT/DRDY enters a high-impedance state. In this state, DOUT/DRDY cannot provide data-ready indication.

Sounds like the software controlling the Chip Select logic is wrong. If the ADS1118 is not selected, it should be off the bus.

giovani
Associate II
Posted on May 10, 2016 at 13:35

Thanks for the help, but I believe

I have

found the problem. I didn't follow correctly the steps to disable the SPI

and

switching

between modes 0 (SD Card) and

1 (ADS1118)

so

I'll do

some more tests

.

 

In master or slave full-duplex mode (BIDIMODE=0, RXONLY=0)

 

1. Wait until RXNE=1 to receive the last data

 

2. Wait until TXE=1

 

3. Then wait until BSY=0

 

4. Disable the SPI (SPE=0) and, eventually, enter the Halt mode (or disable the peripheral

 

clock)

Thanks,

Giovani