cancel
Showing results for 
Search instead for 
Did you mean: 

Genration of sine wave using DAC of Nucleo-H743zi2 development board

GHARI.1
Associate II

Hello,

I am using DAC module of STM32H743ZI2 micro controller to generate sine wave of 8KHz frequency I am using Timer2 for this setting using APB1 bus of 150MHz and prescaler of 74 and ARR register of 1.

>>The issue I am facing is jitter in the output wave form like +/-50Hz deviation from 8KHz.

>>I want also sine wave whose frequency varies from 5KHz to 20KHz in steps of 0.1Hz with a delay of 100ms between each frequency step with low jitter is that possible

11 REPLIES 11

The code you are saying is used when DAC buffer is not a multiple of full sine wave am I right? Your are also saying to replace buffer Values will that not effect the signal.

You can use any buffer length, just add correct phaseStep to phase accumulator and do sin(phase) for each sample. Best way is to configure DMA in circular mode and calculate new values in halfComplete / complete interrupts. Google something on sine generation using cpp on stackoverflow. Also note that arm_sin_q31 argument is mapped to some integer/q31 range, you can find it in HAL source code.

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!