Customizing the ADC Sample Rate
So in the last post I talked about getting streaming data from an Analog/Digital Converter unit on the STM32F746. In that case I let the ADC run at a pretty high clock rate, based on the PCLK2 configuration and a single ADC prescaler. Needless to say, the options for sample rate are pretty limited, even when you throw in the 8-setting "per-channel" delay option. So, what if you want to sample at a more arbitrary rate, or even change the sample rate after booting? One way is to switch from "Continuous" mode to triggered mode. Timer Triggered ADC So if you look closely at the ADC settings in CubeMX, you will see the "External Trigger Conversion Source" under the ADC_Regular_ConversionMode section. This allows you to specify a timer event that will initiate a conversion. For this mode, we want to disable the Continuous mode of the ADC, leaving it in single conversion mode, so that each trigger event starts a single conversion. How Does It Work With DMA? Wh...