Skip to main content
Associate II
Apr 8, 2025 4:00 PM UTC
Question

High output frequency from DAC

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
Associate II
Apr 8, 2025 4:08 PM UTC

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

Andrew Neil
Super User
Apr 8, 2025 4:12 PM UTC

@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.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
ST Technical Moderator
Apr 8, 2025 5:07 PM UTC

Hello, FYI,

From the datasheet:

DAC at 1MSPS: 

mALLEm_0-1744131901931.png

DAC at 15MSPS: 

mALLEm_1-1744131984783.png

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.