Skip to main content
Prajnyajit
Associate III
December 31, 2022
Solved

Use STM32L031F4P as Programmable Voltage Detector?

I am using STM32L031F4P.

I want to use it Programmable Voltage Detector to detect the voltage of its power supply.

I am not finding any library to use.

I want to have some coding help and its library file.

This topic has been closed for replies.
KnarfB
KnarfBBest answer
Super User
December 31, 2022

2 replies

KnarfB
KnarfBBest answer
Super User
December 31, 2022
gbm
Super User
December 31, 2022

Read the description of PWR module, PVD section. Write 5 lines of code/simple C instructions: set 2 registers (PWR->CR, EXTI->IMR), wait for PVDO, if needed - enable PVD interrupt in EXTI, then in NVIC. That's all.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice