Electrical – Stm32F4 Discovery Board ADC

adcsamplingstm32f4

I am trying to do a partial integration on a 550 KHz waveform using STM32F4 Discovery board using the Waijung toolset in Simulink. The sampling time that I am using is 0.018 us, i.e 3 cycles, if the clock frequency is 168 MHz. The ADC prescaler is 2, so the ADC frequency is 84 MHz. The total time required for the conversion should be 0.143 us (12 bit resolution) +0.018 us i.e. around 0.16 us. This should theoretically suffice the Nyquist criteria for sampling. However, I dont seem to get any output at the end. I can't see the real time data after ADC, using the serial interface or the DAC. So I am not sure what I am doing wrong. Any suggestion or idea is much appreciated.

P.S. I am attaching the waveform I am trying to acquire (integration between say 20 us to 140 us) and the simulink program. Please let me know if any other information is required.

Waveform
Simulink Program
Sys Clock

Best Answer

I am not sure exactly which chip you are using, but STM32F4 family has maximum ADC sampling rate 2.4 MS/s or 7.2 MS/s if you use 3 of ADCs in triple mode.

You are also missing that between main clock and ADC is one more prescaler which limit clock on APB2 bus. Maximum clock on APB2 is 90 MHz which has to be divided with 2 for maximum ADC clock of 45 MHz.

To actually achieve this sampling rate you need to consider data speed (7.2 MS/s* 12bit=86 Mb/s), which is way too fast for serial communications available on chip. What you could do is use DMA to gather samples on chip memory and later send then slowly to PC.