cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an example about adc, dma and low level library?

White_Fox
Associate III

Hi everyone

Sorry for lazyness, but is there an example how to manage multiple channels of an adc and read from it by dma with low level library?

Most usefull I found was made with HAL, but the HAL functions are doing a lot of stuff (in spedial the dma start function), much more as you can do with some simple register access.

3 REPLIES 3
ASEHST
ST Employee

Hello @White_Fox,

Thank you for your contribution. You can find several ADC examples based on the LL library that can help you here: STM32CubeF4/Projects/STM32F411RE-Nucleo/Examples_LL/ADC at master · STMicroelectronics/STM32CubeF4 (github.com)

 

With Regards,

If your question is answered, please close this topic by clicking "Accept as Solution".

Hi ASEHST

Well, thank you for the link, but it seems to look like the same examples presented by CubeMX.

Nevertheless, I think I best set up my adc in single regular sequence mode. I have a timer interupt (TIM) already, so I want to use the timer to trigger the adc to read a sequence. And to have less work with the data, I want to write them into memory by dma.

 

Now, I'm wondering how to config this in CubeMX? If I take a look at the code examples, it seems to be clear, more or less, how to do. E.g. here:
https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Projects/STM32F411RE-Nucleo/Examples_LL/ADC/ADC_SingleConversion_TriggerTimer_DMA/Src/main.c
the magic happens in line 229: the function LL_DMA_ConfigAddresses tells the dma where the target memory starts and ends, ok.

 

But how can I set this up in CubeMX? The once thing CubeMX configurates, is to enable the dma clock, and that's it. Or do I expect too much from CubeMX?

Hello @White_Fox 

This future is not already available on STM32CubeMX tool. Similar request has been reported on this post.

Your request has been escalated to the development team. We are actively working on it and will provide you with an update as soon as it becomes available.

 

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar