2019-06-13 02:35 AM
Hello,
I am trying to run a simple code for the reading of a single channel of one of the three ADCs available on the STM32L496. I have tried to use different channels while using the code generated from STM32CubeIDE. I use the default configurations (single ended, polling mode etc) but when I read the ADC I get 0xFFF. The sequence of operations I perform are:
ADC_Enable(&hadc2);
HAL_ADC_Start(&hadc2);
status = HAL_ADC_PollForConversion(&hadc2,100);
adc_value = HAL_ADC_GetValue(&hadc2);
HAL_ADC_Stop(&hadc2);
after which I send the adc_value via LPUART. I have used the same code with an STM32F439 nucleo board and it worked properly, so I am wandering if there are fundamental differences between the L4 and the F4 HAL regarding the ADC that I haven't noticed yet.
Any help can be useful, thanks!
2020-05-09 12:22 PM
Hi, I'm facing the same issue, have you solve this? Thanks!
2023-03-12 09:15 PM
Hi, did you checked the VREF+ pin?
I had the same problem on STM32L496G-DISCO board.
On the STM32L496G-DISCO board, VREF+ pin is not connected to VDDA by default.
because VREF+ can be used as an output pin as well as an input pin on STM32L496.
If VREF+ is nearly 0V, the converted data always becomes to 0xfff.
I solved it by implementing a 0 ohm register at R18 to connect between VREF+ and VDDA.