2023-09-25 09:46 AM
Hi,
I am trying to make the ADC + DMA work a STM32G431CBT6 using STM32CubeIDE and the HAL library. I am used to making it work on other families like the STM32f103 etc.. However, here, when I program the processor using the debug mode and watch the content of my adc/dma buffer, all the values are at 4095 (maximum) and stay like this...
Has anyone an idea on how to make this work? or any suggestions based on my code?
Please find my code and CubeMX settings in the following images.
Thanks in advance,
Solved! Go to Solution.
2023-09-27 01:38 AM
Thanks a lot for your advice @Issamos!
I have found the issue btw: the ADC'S were totally saturated due to a misuse of VREF. I was used to work with other MCUs that did it differently (F1 , F3, etc). So , always check your reference voltage settings and Connections!
2023-09-25 09:47 AM
2023-09-25 10:10 AM
2023-09-27 01:38 AM
Thanks a lot for your advice @Issamos!
I have found the issue btw: the ADC'S were totally saturated due to a misuse of VREF. I was used to work with other MCUs that did it differently (F1 , F3, etc). So , always check your reference voltage settings and Connections!
2023-09-27 01:41 AM - edited 2023-09-27 01:42 AM
Happy to know that your problem has been solved. If so, close the topic by choosing a best answer.
Best regards.
II
2024-02-08 08:00 PM
This answer was helpful as I was having an ADC/DMA issue with an STM32G0B1. I was tricked into thinking the ADC was not updating via DMA. Turns out, my values, liked yours, were simply just pegged at 0xFFF.
The reason I am adding to your answer, is the solution was not very apparent to me:
If using CUBE, go into System->SYS and scroll down to find the "VREFBUF Mode" pulldown menu and activate the internal reference.
As as side note, this was the first controller I had used that contained ST's newer ADC module. I was not aware of the decoupling caps needed on the VRef+ pin in order to use the internal buffer. As one would expect, even though fixing the VREF setup made the ADC values believable, there was an abundance of noise until I added some capacitance.