cancel
Showing results for 
Search instead for 
Did you mean: 

What is DMA circular mode and in ADC DMA continuous request

Xenon02
Associate III

Hello ! 

[STM32L073RZ]
I've been thinking what is this ADC DMA continuous request. I don't really much know what it is exactly and why it must be enabled. I know there are 2 modes of DMA, which is normal and circular in which normal starts only once and stops after sending everything he has, and circular after sending everything he has starts again from the beggining of a buffer. 

I have here 4 questions regarding to this topic : 

-> What is this  ADC DMA continuous conversion mode and does it involve in DMA modes ?
-> What happens if I have Circular Mode of the DMA and have disabled ADC DMA continuous conversion mode ? 
-> What happens if I have Singular Mode of the DMA and have enabled ADC DMA continuous conversion mode ? 
-> In UART in DMA I didn't have this option of DMA continuous conversion mode, so why in ADC there is this option ?

Extra question : 
-> What is Discontinuous conversion mode ?

-> What is Scan conversion mode ? 

They are probably somewhere in the manual, but I couldn't understand how it exactly works because if DMA is in circular mode why it need to be in ADC set also in DMA continuous conversion mode ? I don't get it and it can also be enabled when the DMA is in normal ;> Which didn't make sense to me at all, DMA continuous conversion mode when DMA is normal like what? 

8 REPLIES 8
Xenon02
Associate III

HERE EDIT : 

I made a small mistake and DMA continuous conversion mode was supposed to be DMA continuous request.
My mistake, and I couldn't edit the post. 

What does the RM say about this?

JW

For DMA continuous request something like this : 

Xenon02_0-1700669053159.png

Which is weird, in UART or other devices I didn't have to set this parameter, because if I set circular then in UART it would send data all the time or if I set DMA in normal mode it would send only once. But in ADC not only I have to set the DMA but also this DMA continuous request which is the same as saying that I am setting DMA two times to be Circular. 

if DMA continuous request was disabled and DMA was in circular I wonder what would happen.

> in UART or other devices I didn't have to set this parameter

Yes, this is an unique feature of the ADC. I honestly don't know what's its intended purpose.

> if DMA continuous request was disabled and DMA was in circular I wonder what would happen.

There would be no more requests (triggers) from ADC to DMA, even if conversions would continue. DMA would remain enabled but would not read converted data from ADC.

JW

Thank you, so it's not only me that thinks why this option is only in ADC which makes it look like I set DMA twice to be circular ;D 

Best question is for what is DMA? = offload MCU Then irelevant what exist normal and circular DMA.

Normal when overrun generate error ... Circular return and write/read continue ...

Good example is DAC or ADC where circular is strict required, because restart traffic cost time and audio cant be interrupted, but for example UART too can be circular when sender dont stop send ... 

DMA settings is for DMA controller and peripheral request set is for peripheral...

And FYI DMA generate half and full buffer complete interrupts = handle point for refill etc.

There would be no more requests (triggers) from ADC to DMA, even if conversions would continue. DMA would remain enabled but would not read converted data from ADC.

If using a model of MCU that does not have the DMA continuous request option, what is the workaround? I'm thinking I can set the ADC to continuous scan mode, but the CPU will have to ping the DMA to make requests every few ms. Will this work?

ADC is probably the most varying peripheral among STM32 families, so details depend much on particular family/model.

Please start a new thread, stating what's your hardware and software, what is the observed behaviour and how is it different from the expectation.

JW