Skip to main content
smartpocket
Associate III
July 12, 2005
Question

WFI in LowPowerMode

  • July 12, 2005
  • 4 replies
  • 1150 views
Posted on July 12, 2005 at 07:36

WFI in LowPowerMode

This topic has been closed for replies.

4 replies

smartpocket
Associate III
June 24, 2005
Posted on June 24, 2005 at 05:23

Hi to all.

I have a problem entering in LPWFI: the Main Voltage Regulator is alwais ON, even if bit LPVRWFI is set.

I have made many tests with the same result: the power consumption is too much large!!

For example:

Standby (or powerdown) mode: 800 uA (ARM + rest of board - all PIO in HI)

LPWFI: 2600 uA (ARM + rest of board - all PIO in HI)

This is a source code:

void MySuspend(void)

{

volatile u32 Tmp;

// port in HighImpedence

GPIO_Config(GPIO0, 0xFF, GPIO_HI_AIN_TRI); //

GPIO_Config(GPIO1, 0xFF, GPIO_HI_AIN_TRI); //

// Set LPM in WFI mode

Tmp = RCCU->CLKCTL | 0x01;

RCCU->CLKCTL = Tmp;

// Select CK_AF in LPM

Tmp = RCCU->CLKCTL | 0x02;

RCCU->CLKCTL = Tmp;

// Select 32KHz clock

Tmp = RCCU->CLKCTL | 0x04; // bit 2 - CKAF_SEL

RCCU->CLKCTL = Tmp;

// switch off the PLL1

RCCU->PLLCONF &= ~RCCU_FREEN_Mask; // free running

RCCU->PLLCONF |= 0x07; // stop PLL1

// Power OFF external 4MHz oscillator

GPIO_Config(GPIO1, 0x08, GPIO_OUT_PP); // P1.3 -->> PushPull

GPIO_BitWrite(GPIO1, 3, 0); // 4MHz Oscillator OFF

// Power Menagement in WFI mode

Tmp = 0x0010; // Main Voltage Regulator OFF in WFI

Tmp &= ~PCU_LPRWFI_Mask; // Low Power Regulator ON in Wait-For-Interrupt mode.

Tmp |= 0x0200; // Flash low-power (low-speed) mode select

// Tmp |= 0x0040; // Activate Powerdown Mode

PCU->PWRCTRL |= PCU_WREN_Mask;

PCU->PWRCTRL |= Tmp;

while (PCU->PWRCTRL & 0x4000);

/*==============================*/

// Enter WFI Mode

RCCU->SYSMODE &= ~0x0001;

/*==============================*/

}

Can someon help me ?

Thanks

smart

:-[

anis2
Visitor II
June 24, 2005
Posted on June 24, 2005 at 15:23

Hi Smart,

Your suspend routine seems correct, but I don't think that the high power consumption is due to the MVR.

To have lower power consumption , you have to power down the FLASH during LPWFI mode.

To do this you have to add this instruction:

FLASHR->CR0 |= 0x8000; // set bit PWD

But to do this you must map the interrupt vectors and interrupt service routines in RAM (and remap it to 0x00h). You have to insert a 20µs software delay in the interrupt service routine before accessing any Flash location.

Refer to the STR7x flash reference manual.

Hope it helps

Ciao!

8-)

luciano
Associate
July 12, 2005
Posted on July 12, 2005 at 06:37

Excuse me, Bouha, but I believed that when the micro is in LPWFI mode, Flash is automatically in power down. Isn't so?

Thanks

L.

anis2
Visitor II
July 12, 2005
Posted on July 12, 2005 at 07:36

Hi Lucky74,

The Flash is not automaticaly turned in power down mode when going in LPWFI mode, you have to set PWD bit in the FLASH_CR0 register.

Ciao ;)