2009-01-30 10:21 AM
How to use Programmable Voltage Detect?
2011-05-17 04:01 AM
I also haven't been able to get it to work. It looks easy, the functions in the function library seem straightforward, but it doesn't work.
As the function library suggests, I use the following 2 commands to enable it. Both are supposed to write into the PWR_CR register. PWR_PVDCmd(ENABLE); PWR_PVDLevelConfig(PWR_PVDLevel_2V8); If I read the register (0x70004000) after these commands, it still shows 0. It's as if the register is somehow write protected. And of course the PVDO bit in the PWR_CSR register never flips, no matter how the register is set. 0x70004000 If anyone has gotten this feature to work, please let us know. Thanks2011-05-17 04:01 AM
Figured it out. The following code enables it (I hadn't enabled the PWR peripheral).
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR , ENABLE); PWR_PVDCmd(ENABLE); PWR_PVDLevelConfig(PWR_PVDLevel_2V8); And you can read the status with this: PWR_GetFlagStatus(PWR_FLAG_PVDO); After a cursory check, seems to work well.