2024-08-22 04:44 AM - last edited on 2024-08-22 04:57 AM by Andrew Neil
Hi, I’m new to the stm32mp15 series and I’ve been trying to convert code over from a previous microcontroller (stm32f429i-disc1) onto my new MPU. I try to read an input voltage value by running the HAL_ADC_GetValue driver but when I run live expressions to read the variable for my adc value, it is just maxed out at whatever I set the resolution to be (i.e., ADC1 resolution is 12 bits so the value is stuck at 4095). I use STM32CubeMX right now, I enabled continuous conversions but I get stuck at this 4095 value every time I debug and run. Any help or suggestions?
2024-08-22 04:51 AM
To add more info, I am connecting through input channel 1, single-ended mode. I have a wire hooked up to ANA0 and the breadboard and the voltage signal in series with it.
2024-08-22 04:53 AM
It sounds like you're encountering an issue with your ADC configuration on the STM32MP15 series MPU. Here are some steps and considerations to help you troubleshoot and resolve the issue:
Ensure that the ADC is correctly initialized in your code. Typically, this involves:
Verify that your ADC read code is correctly implemented. The HAL_ADC_GetValue() function should be used after starting the ADC conversion. Here’s an example of how you might do this:
Use the debugger to:
Try applying a different known voltage to the ADC input to see if the value changes. This can help determine if the issue is with the ADC configuration or the input signal.
Refer to the STM32MP15 series reference manual and datasheet for any MPU-specific details or differences in ADC handling compared to the STM32F429 microcontroller. The ADC peripheral might have different configurations or requirements on the STM32MP15.
If the issue persists, consider reaching out to the STM32 community forums or STMicroelectronics support for further assistance. They might have encountered similar issues and can provide additional insights.
By systematically checking each of these aspects, you should be able to identify and resolve the issue with your ADC configuration.