cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 DAC DMA underrun error

marek2399
Associate II
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
4 REPLIES 4
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 Up vote any posts that you find helpful, it shows what's working..
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

Posted on August 13, 2017 at 00:27

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6t2&d=%2Fa%2F0X0000000bxL%2F_z6tggfffVIOVbpiLV1ThAckd3iqmu78LT8MBS3CFdo&asPdf=false
marek2399
Associate II
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.