AnsweredAssumed Answered

Sine wave generator using DAC - how to obtain exact results?

Question asked by ferentes on Sep 30, 2016
Latest reply on Sep 30, 2016 by Clive One
Hello,

I am trying to create sine wave generator using DAC and DMA based on STM32L476.

The goal is to obtain exactly 100KHZ, 10KHZ frequencies with maximum possible number of samples.

Thus I have set APB timer for DAC to 72MHZ, timer period to 15 and sample sizes to 48 for 100kHz and 480 for 10kHz.  This combination gives ideal frequency results.

However I need more than 480 samples for 10Khz.

If the sample pool is set to say 800, timer period to 9 then the result frequency is never exact there is en error of 1-2%. 

Why is that? Does the DAC/Timer combination require some special timing considerations?

Outcomes