2017-10-23 02:54 AM
Hello,
Is it possible to change the DMA clock frequency ?
If so, how to do that ?
(STM32L071)
2017-10-24 08:02 AM
No idea ?
2017-10-24 08:14 AM
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.
2017-10-24 10:21 AM
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.2017-10-24 10:29 AM
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
2017-10-24 10:35 AM
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 ?)
2017-10-24 12:07 PM
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.
2017-10-25 02:27 AM
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 !