2013-04-18 12:29 AM
Hi
In STM32F103RC, Configured the interrupt for PVD through EXTI line 16, When the PVDO output bit is on in PWR_CR, but interrupt not triggerd! Thanks #pvdo-interrupt2013-05-09 06:45 AM
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.
2013-05-10 04:01 PM
// Enable the EXTI16 (PVD) Power Supervisor Interrupt
// EXTI16 rising edge for falling voltage, falling edge for rising voltage on PVD
#if (CPUID_PARTNO == CPUID_CORTEX_M3 && CPUID_VARIANT == 0) // for STM32F1xx
PWR_PVDLevelConfig(PWR_PVDLevel_2V9); // 2.9V falling to trigger powerfail
#else
PWR_PVDLevelConfig(PWR_PVDLevel_7); // 2.9V falling to trigger powerfail
#endif
PWR_PVDCmd(ENABLE); // enable PVD
NVIC_InitStructure.NVIC_IRQChannel = PVD_IRQn; // PVD programmable voltage detect
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = BKPDEV_PVD_PRIORITY;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
EXTI_ClearITPendingBit(EXTI_Line16); // clear pending IRQs
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Line = EXTI_Line16; // set up irq trigger
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising; // trigger power rising edge (voltage drop)
EXTI_InitStructure.EXTI_LineCmd = ENABLE; // alert if power status changes
EXTI_Init(&EXTI_InitStructure);
This ishow I do it on F1/F2/F4.
Jack Peacock
2014-05-11 03:47 AM
Hello
Did you found where is a problem?I have same issue with 103RBT6, same code as above.I can't even get any success with:if ((PWR->CSR & PWR_FLAG_PVDO) != (uint32_t)RESET)Thanks2014-05-11 03:15 PM
Problem solved. With source code from PVD example it just works.
Thanks