Skip to main content
Graduate
August 12, 2024
Question

About STM32F429 DAC

  • August 12, 2024
  • 1 reply
  • 1764 views

Hi everyone,

I'm encountering an issue with generating a 1 MHz sine wave using the DAC, TIM, and DMA for DDS. I'm utilizing a wave table to generate the sine wave.

Currently, I have the HCLK and APB2 clocks both set to 180 MHz, and I'm using TIM8 as the timer for the DAC. I've configured the timer with a prescaler (PSC) of (1-1) and an auto-reload register (ARR) of (2-1), which gives me an FMCLK of 90 MHz. The LUT (wave table) length is set to 180, and the DAC data width is set to Word. However, instead of the expected 1 MHz output, I'm getting an incorrect result of around 125 kHz.

I've tried various methods and different parameter adjustments. Changing the FMCLK causes the output frequency to drop further, and altering the LUT length affects the output voltage. And under the 130kHz is very normal.

Only using the Digital Storage Oscilloscope to get the wave of board DAC output, and DMA is the High priority in DMA.

There is my code, and I'm referenced other sources. 

tasabao_2-1723461619888.png

tasabao_3-1723461630092.png

 

 

And this picture is my generated wave, the voltage is down 1v to 2v, and the frequency at 125kHz.

SDS00016.png

Thanks for help!!

 

 

 

    This topic has been closed for replies.

    1 reply

    Super User
    August 12, 2024

    The DAC is not able to update at 90 MHz. Reduce the number of samples per period. Looks like it can do about 1/8 of what you want, so maybe shoot for an update rate of 10 MHz.

    This app note suggests 10.5 Msps as the max rate. Might be slightly different for your chip.

    TDK_0-1723462854487.png

     

    It's going to be tough to get a clean 1 MHz without artifacts.