2025-01-10 07:46 AM - last edited on 2025-01-10 07:47 AM by Andrew Neil
Hi
On STM32L4xx Ref Man
Programmable voltage detector (PVD) supports external input PVD_IN.
How to configure the GPIO for PVD_IN (ex STM32L4 PB7)?
How to configure VREFINT?
Is there any example?
2025-01-10 08:11 AM
Hello @CanRF
As an example on STM32L476 device (Nucleo-L476RG)
According to DS10198 Rev 11 in Table 16. PVD_IN is an additional function connected to PB7.
And in RM0351 Rev10, PVD can be configured in PWR_CR2 bits PLS[2:0] = 111.
In STM32CubeMX here the possible PVD levels configurations:
The internal voltage reference VREFINT is calibrated in production with VDDA=VREF=3.0V at 30°C, is around 1.2V (see DS10198 Table 26) and it is enabled when VDDA and VSSA are supplied.
Best regards,
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-01-13 04:58 AM
Hi Romain
Thanks for your information.
DS10198 Rev 11 and RM0351 i read before. But I didn't see information for the GPIO configuration nor the VRefint configuration.
From MX Cube I see, that PB7 is configured as analog with no pullup/down.
This was also my intention but i didn't find it in the docs.
Where did you get the information, that VRefint is available when VDDA and VSSA are supplied?
For ADC conversion of VRefInt VREFEN of ADCx_CCR must be enabled.
Can PVD use VRefInt Independent of ADC and VREFEN?
Thanks for clarification
Best regards,
RF
2025-01-13 08:32 AM - edited 2025-01-13 08:33 AM
Hi @CanRF
Sorry, I made a mistake and I misled you. I mixed up the VREFINT bandgap with the VREFBUF.
I'm referring to RM0351 in section 5 Power control (PWR)
When PLS[2:0] = 0b111 in PWR_CR2 register. The external input analog voltage PVD_IN is compared internally to VREFINT. It's independent from ADC.
Best regards,
Romain,
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-01-21 12:47 AM
Hi Romain
Again thanks for your information.
This helps a lot,
But now I've an additional problem.
On startup I want to wait until the power is over the selected voltage.
So I configure PVD and wait until PDVO is 0.
I use the following code
...
HAL_PWR_ConfigPVD(&sInit);
LL_PWR_EnablePVD( );