STM32 ADC DMA Sample Rate Time
Hi everyone,
I have some questions about using ADC. I have an analog channel and want to read it for a specified time according to my PWM signal because it has been used as a voltage sense on an inductor. However, I need more samples and have to check the changes. To do this, set two-timers, one has been used to get compare of PWM value, other trig the ADC for 100samples. Here I am confused right here. I'm not sure how to calculate the timing, also I'm afraid of getting overrun and wrong data. So, I need your help and have some questions about this application. By the way, I'm using STM32G431 which is new MCU.
- The datasheet says that the maximum of the clock frequency of the ADC module is 40MHz. The clock frequency of MCU is 160MHz. Then, should I set the clock prescaler of ADC as "Sync divided 4" or does it never exceed 40MHz anyway? (for example, what about in async 1?)
- If a new trig occurs by the timer used for trig before the adc read cycle is complete, will raw value be wrong?
- How should I set the trig time according to adc reading time?
