Electronic – Interfacing a STM32 MCU with an external ADC (and reading the data via SPI)

adcanalogspistm32stm32f7

I want to use a STM32 microcontroller to read data from a multi-channel ADC.
The microcontroller that I intend to use will most likely be something from the F7 series (such as STM32F746ZGT), whereas the ADC that I currently have my eye on is LTC2358-18 from Analog Devices.

The project that I'm working on requires me to simultaneously read 6 analog channels (with a reasonable data rate). As far as I understand, the particular ADC chip can output its conversion results on different serial data output (SDO) channels that can be read out in parallel (the serial clock is identical for all of them):
enter image description here

I was wondering if it is possible to use a single STM32 MCU to read the 6 channel output data via SPI (I don't really need the two remaining channels). In general, I would assume that I need to configure 6 SPI interfaces that are available on STM32F746ZGT, as follows:

  1. One of the SPIs acts as the master and provides the serial clock (SCK) for all the slave devices (5 remaining SPIs on the STM32 chip and the ADC) and the serial data out (SDO) for the ADC configuration. The master would (I'm guessing) pull down the CS for all the SPI slaves.
  2. The remaining 5 SPIs on the STM32F746ZGT share a common SCK line and each are linked to a SDO channel on the ADC.

Or, in other words, it would look something like this:

enter image description here

Would this kind of configuration actually work or am I missing something?

Best Answer

I'm no expert with STMs but for about every controller I've worked with, this wouldn't work for the following reasons:

  • Probably (I didn't check) you cannot access all 6 SPI interfaces simultaneously due to pin mapping constraints, even if you use only one MISO pin from each one; I'd guess it doesn't work out.
  • The six interfaces are all independent from each other, no way to sync the clock from Interface 0 to interface n. This is typically the case because the SPI peripheral is usually bought as IP, then instantiated 6 times; but there is no interconnection between those; they are separate instances with their own registers/memory regions.

What you should do instead is to read them as intended in serial (typically this is done through a DMA read). Since there is only one ADC inside and the maximum sampling rate according to the datasheet is 200k (8ch), assuming a 24 bit transfer (not sure if the STM's DMA can handle this) results in about 40 MBit data rate / spi speed. This should be possible, not accounting for post processing.