2024-06-18 06:27 AM
Hi, I'm trying to generate a sine wave using the DAC and DMA with the STM32H563ZIT6. How should I configure the IOC setup? I want to generate a 100 Hz frequency with a 50% duty cycle. Can anyone please help me?
Solved! Go to Solution.
2024-06-18 06:43 AM - edited 2024-06-18 06:57 AM
Hello,
You can inspire from the example provided in STM32H5 cube: https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H563ZI/Examples/DAC/DAC_SignalsGeneration
For this, you need to create a sine wave lookup table as done for the above example to generate the escalator wave (aEscalator8bit[6]).
You can also refer to the AN3126 "Audio and waveform generation using the DAC
in STM32 products" mainly the section 2.1 Using the DAC to generate a sine waveform:
2024-06-18 06:43 AM - edited 2024-06-18 06:57 AM
Hello,
You can inspire from the example provided in STM32H5 cube: https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H563ZI/Examples/DAC/DAC_SignalsGeneration
For this, you need to create a sine wave lookup table as done for the above example to generate the escalator wave (aEscalator8bit[6]).
You can also refer to the AN3126 "Audio and waveform generation using the DAC
in STM32 products" mainly the section 2.1 Using the DAC to generate a sine waveform:
2024-06-18 11:48 PM
Thank you for your answer! I'm confused about configuring of IOC. Could you share a screenshot of the IOC configuration?
2024-06-19 01:15 AM
The ioc file is available in the link I provided here:
And need to read the readme file of the example and also read the AN to apply changes to the ioc file to fit your needs. There is no Sine Wave generation ST example off the shelf for H5.
2024-06-19 10:22 PM
thank you so much!!!