cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a sine wave using DAC and DMA with the STM32H563ZIT6?

Berlin-raj123
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

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:

SofLit_0-1718719030620.png

 

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

View solution in original post

4 REPLIES 4
SofLit
ST Employee

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:

SofLit_0-1718719030620.png

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Berlin-raj123
Associate III

Thank you for your answer! I'm confused about configuring of IOC. Could you share a screenshot of the IOC configuration?

The ioc file is available in the link I provided here:

SofLit_0-1718784568330.png

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.

 

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

thank you so much!!!