Skip to main content
Associate
May 28, 2025
Solved

Measure voltage via PA3 - STM32L431

  • May 28, 2025
  • 2 replies
  • 354 views

..

Best answer by TDK

Here are 4 example projects which use the ADC on the STM32L4:

STM32CubeL4/Projects/NUCLEO-L432KC/Examples/ADC at master · STMicroelectronics/STM32CubeL4

2 replies

TDK
TDKBest answer
Super User
May 28, 2025

Here are 4 example projects which use the ADC on the STM32L4:

STM32CubeL4/Projects/NUCLEO-L432KC/Examples/ADC at master · STMicroelectronics/STM32CubeL4

"If you feel a post has answered your question, please click ""Accept as Solution""."
shaieAuthor
Associate
May 28, 2025

Hello.

Thank you for your reply.

I'm trying to do it but it gives bad result..

If you will have an example for PA1 as input for measuring voltage it will be great.

Thanks again.

shaieAuthor
Associate
May 29, 2025

Hi.

I’m unable to write the code... it either gets stuck or gives me an incorrect value. I’d appreciate it if someone could point me in the right direction or share code that allows me to read a voltage value on PA3. Thank you very much for your help.

 

Thanks again for all the help.

TDK
Super User
May 29, 2025

There are example projects you can follow. If you can't get those up and running, I don't see how providing yet another example will help.

If you want help on your code, post your code along with your debugging findings.

This is not a forum for people to write your code for you.

 

This project converts PA4. It should be a few lines to change it to PA3. You will need to change the ADC channel and the pin initialization.

STM32CubeL4/Projects/NUCLEO-L432KC/Examples/ADC/ADC_RegularConversion_Polling at master · STMicroelectronics/STM32CubeL4

"If you feel a post has answered your question, please click ""Accept as Solution""."