ADC Sampling Rate for STM32G431: Practical vs Theoretical measurements
Hello STM Community,
I am working with the STM32G431 microcontroller and have encountered a discrepancy between the practical and theoretical ADC sampling rates. Here's my setup:
- ADC Input: PA0 configured as ADC1_IN1 (single-ended mode).
- ADC Parameters:
- Mode: IN1 Single Ended
- ADC Prescaler: Synchronous Clock Mode Divided by 4
- Resolution: 12 bits
- Data Alignment: Right
- Continuous Conversion Mode: Enabled
- Sample Time: 2.4 ADC Cycles
- System Clock Frequency: 170 MHz
I have toggled a GPIO pin after ADC conversion to observe the sampling rate on an oscilloscope. The measured sampling rate is approximately 142 kHz, while my theoretical calculation suggests it should be around 11.33 MHz.
The theoretical calculation considers the formula:
Sampling Rate=fADC /{ [sampling time(in cycles)] + [resolution (in bits)] +(0.5)}
Substituting the values:
Sampling Rate=170 MHz / (2.4+12+0.5) ≈ 11.33 MHz
I am unable to identify why there is such a significant difference between the calculated and observed rates. Could it be due to additional overhead, configuration issues, or something else I'm overlooking?
Any insights or suggestions to help resolve this would be greatly appreciated!
Thank you!
