Skip to main content
marek2399
Associate III
August 12, 2017
Question

STM32L4 DAC DMA underrun error

  • August 12, 2017
  • 2 replies
  • 850 views
Posted on August 12, 2017 at 17:43

Hi guys,

Iam trying to set up highest resolution on DAC as possible. If iam right there should be 10Msps DAC. so in 12b resolution i should get output samples 833 333.3ps. Timer (in my case TIM6) is clocked by internal cloch APB (80MHz) and DAC needs 10MHz clock for full speed. i've setted prescaler to 0 and autoreload value to 8 (0x07) but i get underrun error. What iam doing wrong?

Many thanks for help.

#dma #tim #dac
This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
August 12, 2017
Posted on August 12, 2017 at 19:35

>>What i am doing wrong?

Without code illustrating the issue it's hard to guess.

If you drop the speed at what point does the underrun stop occurring? Does it work at 1 MHz?

Is the DMA using the right channel?

Is the pattern buffer in the fastest SRAM?

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
marek2399
marek2399Author
Associate III
August 12, 2017
Posted on August 12, 2017 at 20:22

I will past the code later cause iam not on my pc now but the code works. Dac generated sine but i get the dma underrun. 

I do not know how to assign pattern to the different ram space. 

Are my supposions about calculated speed of dac correct? 

Fmax=(10Msps/12bit)/count_of_samples_per_vawe

Many thanks

marek2399
marek2399Author
Associate III
August 14, 2017
Posted on August 14, 2017 at 20:01

Well,

I've found issue in STMCubeMX and also in reference manual.

Tim6 & Tim7 does not support One pulse mode! They do not have CCR registers thus they are not able to make rising edge for pulse. In GUI of STMCubeMX is checkbox to activate one pulse mode.