cancel
Showing results for 
Search instead for 
Did you mean: 

How to suppress initial glitch in DAC output.

kbhoi
Associate

In my application i have implemented WAV tone player with STM32F072RB using HAL library which utilizes internal DAC with DMA. when i start playback the tone there is spike at DAC output in a initial playback(after power up) and next successive playbacks has some rogue samples which is creating pop up noise. DAC is being triggered with sample rate of WAV tone(32000 for monotone). i've used monotone to check performance. when i've used voice tone there is no such pop up noise even spike or rogue samples were there. But at end we do have to use only monotones for my project, suppressing the initial glitch is crucial for me. Does anyone faced similar issue with DAC or DAC_DMA.

Note:

  • First image refers to initial playback after power up and second image is of successive playbacks.
  • When i tried to work around to suppress glitch at DAC output , i found that providing delay between enable DMA channel and enable DAC peripheral helped bit but still there's a pop up noise in startup.

// code snippet from "stm32f0xx_hal_dac_ex.c"

HAL_StatusTypeDef HAL_DAC_Start_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t* pData, uint32_t Length, uint32_t Alignment)

{

.

.

.  

  /* Enable the DMA channel */

  HAL_DMA_Start_IT(hdac->DMA_Handle2, (uint32_t)pData, tmpreg, Length);

 }

  

 /* Test delay to suppress initial glitch, around 68-70us */

 for(volatile uint32_t i=0;i<199;i++);

  

 /* Enable the Peripheral */

 __HAL_DAC_ENABLE(hdac, Channel);

  

.

.

.

  

}

  • Third images refers to initial play back and fourth image refers to the successive playbacks with simulated delay.

  • please check the names of images as upload happening in different manner(as per the names)
0 REPLIES 0