cancel
Showing results for 
Search instead for 
Did you mean: 

Using PVD

hholms
Associate II
Posted on January 30, 2009 at 19:24

Using PVD

5 REPLIES 5
hholms
Associate II
Posted on May 17, 2011 at 12:22

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

Henrik

hholms
Associate II
Posted on May 17, 2011 at 12:22

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 Holm

stephen
Associate II
Posted on May 17, 2011 at 12:22

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.

virtualfight
Associate II
Posted on May 17, 2011 at 12:22

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?

bruce
Associate II
Posted on May 17, 2011 at 12:22

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);)