2009-01-30 10:24 AM
Using PVD
2011-05-17 03:22 AM
Sorry for my imppatience, but is there no one which had the PVD up and running using ST's Libray?
If someone would post some PVD code that works, it would save me some time ;-) For now I just park this part of the project - but eventually I will have to get it up and running. Best Regard Henrik2011-05-17 03:22 AM
Hi,
I am having a bit of trouble getting the PVD (Programmable voltage detector) on a STM32F103xx work as I expect. I use the STM firmware library on a Keil Eval board. My code looks like this: PWR_DeInit(); PWR_PVDLevelConfig(PWR_PVDLevel_2V9); PWR_PVDCmd(ENABLE); while(1) { if(PWR_GetFlagStatus(PWR_FLAG_PVDO)==RESET) { //Vdd>2.9 LEDOn(5); } else { LEDOn(7); } } PWR_GetFlagStatus(PWR_FLAG_PVDO) return RESET nomatter if I am starting up with a voltage around 2.2V or starting up at 3.3 and lowering the voltage to 2.2V when the system is running I have two questions: 1. What am I doing wrong in the configuration of the PVD? (do I need to configure PVD interrupt?) 2. Should PWR_GetFlagStatus(PWR_FLAG_PVDO) PVD return SET if the system is started on 2.2V? Hope someone is able to help me out. Best Regards Henrik Holm2011-05-17 03:22 AM
Hi hholms,
Did you manage to get the PVD module working? I am also trying to do this, and have been surprised that there is no example/application note for this feature when the rest of the chip(IWDG, WWDG etc.) is so well documented. I would be grateful if you could post your working code here. Many thanks, Stephen.2011-05-17 03:22 AM
I have the same problem.
I tried to use the PVD directly after startup. I used assembler to inialize the PVD but at the adress of the Power control register (0x40007000) nothing changed. There is always the value 0x00000000. Has somebody some experience using the PVD?2011-05-17 03:22 AM
Got it to work, see my posting:
http://www.st.com/mcu/forums-cat-7936-23.html (The short answer is don't forget to turn on the pwr component with: RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR , ENABLE);)