cancel
Showing results for 
Search instead for 
Did you mean: 

DMA clock frequency

Alexandre T
Associate II
Posted on October 23, 2017 at 11:54

Hello,

Is it possible to change the DMA clock frequency ? 

If so, how to do that ?

(STM32L071)

7 REPLIES 7
Alexandre T
Associate II
Posted on October 24, 2017 at 17:02

No idea ?

Posted on October 24, 2017 at 17:14

To what, from what? The DMA clock comes from the AHB/APB.

You can use a TIM to trigger DMA transfers, and set that to whatever rates the TIM affords.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 24, 2017 at 17:21

Yep I know that it comes from the AHB/APB.

I'm using the DMA to collect accelerometer datas.

The problem is that the DMA speed is faster than my accelerometer refresh rate and I want to avoid memory waste.

So, the goal is changing the DMA clock frequency is to adapt it to my accelerometer frequency.
Posted on October 24, 2017 at 17:29

It is generally undesirable to throttle the bus clocks as this will slow the entire system down and increase bus contention and delays.

Pace the acquisition of data from the accelerometer with a TIM

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 24, 2017 at 17:35

Yep but using a TIM will generate a lot of interrupts and AFAIK it is undesirable ? (I want to record datas at 400Hz -> an interrupt every 2.5ms ?)

Posted on October 24, 2017 at 19:07

Depends, I can use TIM+DMA+ADC to generate arbitrary sample rates, with minimal interrupts (DMA HT/TC controlled by buffer size)

400 Hz is relatively low, 400 KHz yes would be an issue.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 25, 2017 at 09:27

Sorry but I don't get it (first time I'm using DMA). 

For me, using a timer in parallel will allow me to read a part of the RxBuffer but it won't change the frequency.

I also saw that HAL timer embed a DMA but AFAIK it will return all the registers values whereas I just want the x,y,z values of my accelerometer ?

If it is possible to read specific registers from a peripheral address at a choosen frequency, it could be really interesting for me !