cancel
Showing results for 
Search instead for 
Did you mean: 

Power Stop -- Auto wake up

amano_ginji_39
Associate II
Posted on February 20, 2008 at 12:55

Power Stop -- Auto wake up

2 REPLIES 2
amano_ginji_39
Associate II
Posted on May 17, 2011 at 12:24

Hi,

When I configure EXT_Line17(RTC_Alarm) to generate an interrupt, and I Set a alarm, the program don't go in interrupt program.

I want do an auto wake up. I program the RTC Alarm to wake up the STM32 each second in case of RTC.

void RTC_Configuration(void){

PWR_BackupAccessCmd(ENABLE);

BKP_DeInit();

RCC_LSEConfig(RCC_LSE_ON);

while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET){}

RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);

RCC_RTCCLKCmd(ENABLE);

RTC_WaitForSynchro();

RTC_SetPrescaler(32767);

RTC_WaitForLastTask();

RTC_ITConfig(RTC_IT_ALR, ENABLE);

RTC_WaitForLastTask();

}

In the main program, there is

while(1){

RTC_SetAlarm(RTC_GetCounter()+ 1);

RTC_WaitForLastTask();

GPIO_SetBits(GPIOC, GPIO_Pin_9);

Delay(3000); //delay 3s

//PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFI);

//SYSCLKConfig_STOP();

GPIO_ResetBits(GPIOC, GPIO_Pin_9);

}

Normaly, I should have an interrupt in RTC_Alarm , but the interrupt don't occur.

After, I want program the rtc alarm in interrupt of rtc alarm:

void RTCAlarm_IRQHandler(void){

if(RTC_GetITStatus(RTC_IT_ALR) != RESET){

EXTI_ClearITPendingBit(EXTI_Line17);

RTC_WaitForLastTask();

RTC_ClearITPendingBit(RTC_IT_ALR);

RTC_WaitForLastTask();

RTC_SetAlarm(RTC_GetCounter()+ 1);

System_Process();

PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFI);

}

}

This soluce don't run to!

Thanks for your answers

amano_ginji_39
Associate II
Posted on May 17, 2011 at 12:24

I have found my error. I forgot a configuration line to delete another line in a exemple copy (EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;)