We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am developing a signal processing application on the STM32F4 Discovery board, and am in need to use the DAC feature to output a processed signal. Trying to understand how to initialize the DAC so that it uses DMA and Timer6 to generate the sample rate, I looked at the example project in the Pheripheral_Examples document, and came across this snippet of code :
/** * @brief TIM6 Configuration * @note TIM6 configuration is based on CPU @168MHz and APB1 @42MHz * @note TIM6 Update event occurs each 37.5MHz/256 = 16.406 KHz * @param None * @retval None */
I have problems in understanding the comments... where does the 37.5 MHz value come from ? Maybe they intended 42 MHz ? And even if it is a typo and the value is actually 42 MHz, then 42MHz / 256 (the autoreload value of the timer) is equal to 164.0625 kHz and not what is written in the comment... given that the example is meant to generate a sound, the sampling frequency of 16.xxx kHz seems to be more correct than 164.xxx kHz.
Is there anybody who has actually programmed Timer6 to generate a given sample rate and tat can give a couple of words of wisdom on this ?
Thanks.