cancel
Showing results for 
Search instead for 
Did you mean: 

Event driven low power mode

juraj
Associate II
Posted on September 06, 2009 at 16:32

Event driven low power mode

2 REPLIES 2
juraj
Associate II
Posted on May 17, 2011 at 13:22

Hello.

In my application I would like to use stop mode, which will be exited by any edge (rising or falling) on GPIOA:3. However, I dont know what to do to exit from the stop mode. Here is all important lines (sequentially as CPU executes them) I use to initialize event-driven stop mode:

Code:

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC, ENABLE);

RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);

EXTI_InitTypeDef EXTI_InitStructure;

EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Event;

EXTI_InitStructure.EXTI_Line = EXTI_Line3;

EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising_Falling;

EXTI_InitStructure.EXTI_LineCmd = ENABLE;

EXTI_Init(&EXTI_InitStructure);

RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD;

GPIO_Init(GPIOA, &GPIO_InitStructure);

PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFE);

RCC_HSEConfig(RCC_HSE_ON);

HSEStartUpStatus = RCC_WaitForHSEStartUp();

if(HSEStartUpStatus == SUCCESS) {

RCC_PLLCmd(ENABLE);

while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET);

RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);

while(RCC_GetSYSCLKSource() != 0x08);

}

Can you help me, please? I've read from Hitex document, that event driven low-power mode behaves similarily than interrupt driven, without setting interrupt and interrupt handler (so after wake-up, PC is loaded with the next instruction, not interrupt vector value).

juraj
Associate II
Posted on May 17, 2011 at 13:22

I need to mention, that if I modify preceding code to:

Code:

<BR>-- PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFE); <BR>++ __SEV(); <BR>++ PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFE); <BR>

then the result is still the same, e.g. even setting event by __SEV() before going to stop mode does not help, MCU goes to stop mode and never exits from.

[ This message was edited by: juraj.vanco on 06-09-2009 20:28 ]