Skip to main content
Explorer II
April 8, 2025
Question

High output frequency from DAC

  • April 8, 2025
  • 4 replies
  • 663 views

Split from https://community.st.com/t5/stm32cubeide-mcus/problem-with-file-ioc-quot-not-a-valid-ioc-file-quot/td-p/791325 as this is a new question


But now, I have another question. The file I use is one of the example on stm32G431RB "DAC_SignalGeneration2" and for this example, the output frequency on Oscillo is 1kHz but for my use, I want to have high frequency for sinusoidal signal on oscilloscope. I try many issu but i don't have what i want.

 

For example, I calculated PSC et ARR corresponding to my frequency i want or double the number of step in tab sinewave or do (programmed a specific tab sinwave at the frequency i want but i stil don't have good result on oscilloscope. 

And i don't understand the specific roles of each timer (TIM2 & TIM6) in this code.

Thank you for you respond

    This topic has been closed for replies.

    4 replies

    malaAuthor
    Explorer II
    April 8, 2025

    Duplicate - merged.


    I change the file. But now, I have anathor question. The file I use is one of the example on stm32G431RB "DAC_SignalGeneration2" and for this example, the output frequency on Oscillo is 1kHz but for my use, I want to have high frequency for sinusoidal signal on oscilloscope. I try many issu but i don't have what i want.

     

    For example, I calculated PSC et ARR corresponding to my frequency i want or double the number of step in tab sinewave or do (programmed a specific tab sinwave at the frequency i want but i stil don't have good result on oscilloscope. 

    And i don't understand the specific roles of each timer (TIM2 & TIM6) in this code.

    Thank you for you respond

     

    STM32CubeG4/Projects/NUCLEO-G431RB/Examples/DAC/DAC_SignalsGeneration2/Src/main.c at master · STMicroelectronics/STM32CubeG4 · GitHub

    Super User
    April 8, 2025

    @mala wrote:

    for my use, I want to have high frequency for sinusoidal signal on oscilloscope


    How high ?

     


    @mala wrote:

    i stil don't have good result on oscilloscope. 


    In what way(s) is it "not" good ?

    Perhaps show a screenshot from your oscilloscope

    And show the code you used.

    Technical Moderator
    April 8, 2025

    Hello, FYI,

    From the datasheet:

    DAC at 1MSPS

    mALLEm_0-1744131901931.png

    DAC at 15MSPS

    mALLEm_1-1744131984783.png