2022-10-06 01:25 PM
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:
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."
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?
Solved! Go to Solution.
2022-10-08 07:02 PM
@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 ...)
2022-10-07 07:41 AM
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 ?
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.
2022-10-07 07:52 AM
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?
2022-10-07 07:56 AM
@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.
2022-10-07 08:17 AM
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?
2022-10-08 06:29 PM
> And what is the End of Conversion Selection's purpose?
That is explained in the reference manual. As is almost everything else... RTFM!
2022-10-08 06:46 PM
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.
2022-10-08 07:02 PM
@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 ...)
2022-10-10 04:05 PM
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.