cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX v 6.6.1: ADC & DMA Changes

KMew
Senior III

Hello,

I am trying to do this tutorial that I found online for measuring an ADC continuously and displaying the voltage read on an LCD Display:

https://www.youtube.com/watch?v=EbWOv_0Lp-U

I am not using the same board though. He is using STM32F746G-DISCO. I am using the STM32H7B3I-EVAL board, which has a built in potentiometer connected to ADC1 (PA0_C). It measures the 3.3V and changes the measured voltage based on the potentiometer position.

I am trying to enable the ADC according to that tutorial (Starting at time stamp 5:15), he enables Scan Conversion Mode, then goes to DMA Settings, adds ADC1, makes it circular, then enables DMA Continuous Requests and sets End of Conversion Mode to "EOC Flag at the end of all conversions". This is also how his menu looks:

0693W00000UnXACQA3.png 

Mine, however, is different. I cannot enable Scan Conversion Mode. Only option is disabled. Additionally, there is no "DMA Continuous Request." Finally, the End of Conversion Selection menu only has "End of sequence of conversion" and "End single conversion."

0693W00000UnXBAQA3.png 

I want to know if the difference is because I'm doing something wrong. If it's not, how do I properly configure the ADC such that I can continuously read it and display it like he does in the rest of the video?

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

@KMew​ ST has explanation slides on many STM32 features.

https://st-onlinetraining.s3.amazonaws.com/STM32H7-Analog-ADC_%28ADC%29/index.html

It could be made clearer and easier for beginners, especially the terminology (how it can be continuous and discontinuous at the same time, what are injected channels ...)

View solution in original post

8 REPLIES 8
RomainR.
ST Employee

Hi KMew (Community Member)

STM32F7 and H7 have not the same ADC peripheral.

The scan mode can be enabled if you change Number of Conversion value.

Scan mode is generally used to perform sequence of multi-channel conversion. Is it your case ?

0693W00000Unbe6QAB.pngBest regards,

Romain,

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello Romain,

Thank you for the reply!

My current objective is to measure a single ADC channel (ADC1) and display it on the screen that's available on the STM32H7B3I-EVAL board. I am aiming to refresh the value on the screen every 10ms continuously. To do some smoothing as well, I would like to take 10 data points from the ADC and get the average for them.

If that is the case, then multi-channel conversion would not be necessary, correct?

RomainR.
ST Employee

@KMew (Community Member)

That's right, you might as well use the ADC continuous mode with your single channel.

Best regards

Romain

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello Romain,

Thank you for confirming.

As for the DMA Continuous Request not being there, will it be needed for my task?

And what is the End of Conversion Selection's purpose?

Piranha
Chief II

> And what is the End of Conversion Selection's purpose?

That is explained in the reference manual. As is almost everything else... RTFM!

Piranha,

Yes, I have done that. Perhaps it is my own inexperience with STM32 programming, but I notice that some of the reference manual material is a bit vague and I have found people on here can explain a few more details that make things more clear (both why they exist and how to use them).

I apologize if that upset you in any way. ​

Pavel A.
Evangelist III

@KMew​ ST has explanation slides on many STM32 features.

https://st-onlinetraining.s3.amazonaws.com/STM32H7-Analog-ADC_%28ADC%29/index.html

It could be made clearer and easier for beginners, especially the terminology (how it can be continuous and discontinuous at the same time, what are injected channels ...)

Hello Pavel,

Thank you for this source! This makes so much more sense now. Having something explain it like this will make future use and understanding of other peripherals and features easier to understand.