cancel
Showing results for 
Search instead for 
Did you mean: 

Reading continuous data from an external ADC with SPI at a high sample rate

SimonThr
Associate II

Hello everyone,

I'm new to STM32CubeIDE and working on a project that requires high-speed SPI communication between an external ADC and an STM32H7A3 microcontroller (i'm using a Nucleo board). My goal is to sample data up to 1MSPS (not sure if its completely realistic), but currently I'm only achieving about 500 samples per second (1 sample every 2ms).

I've attempted to implement DMA and internal timers to increase the conversion rate without success. Once I get the SPI working at an appropriate speed, I need to transmit this data via UART (limited to 115200 baud) to a Python GUI for post-processing. Since the UART speed is lower than my target SPI sampling rate, I plan to buffer the samples until reaching capacity before transmission.

The ultimate purpose of this project is to evaluate how certain ADC datasheet parameters drift when the device is exposed to specific external conditions.

Since the ADC communication seems to be a well known topic, I was wondering if anyone successfully implemented a similar communication setup who could offer guidance or share example code?

Thank you,
Simon

 

10 REPLIES 10

The product info available online says... 

* ADC1283: "from 50 ksps to 200 ksps, tested at 200 ksps (3.2 MHz clock frequency)." 

ADC120 : "from 50 ksps to 1 Msps, tested at 1 Msps".

So the answer for 1283 is no chance for 1Msps, but SPI clock frequency 3 MHz is easy for STM32H7.

ADC120 perhaps can yield 1Msps, but check details in the datasheet. Again, no obstacles expected from the STM32H7's side.