I am having an issue with a slow supply ramp, so I have been trying to set the STM32F042 to do a software reset if the supply is under say 2.5Volts. I've been playing around with the PVD settings, and interrupts to no avail. Can anyone out there assist...?
* @brief Configures the PVD resources.
* @param None
* @retval None
/* Enable PWR clock */
/* Enable the PVD Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = PVD_IRQn;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
/* Configure EXTI Line16(PVD Output) to generate an interrupt on rising and
falling edges */
EXTI_InitStructure.EXTI_Line = EXTI_Line16;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
/* Configure the PVD Level to 3 (2.5V) */
/* Enable the PVD Output */
//Mangage a slow power on - or brownout by resetting the uC untils upply is at a sufficient level
There appears to be few people who use this feature - or at least non of the examples seem to use it!