Skip to main content
amano_ginji_39
Associate II
February 20, 2008
Question

Power Stop -- Auto wake up

  • February 20, 2008
  • 2 replies
  • 707 views
Posted on February 20, 2008 at 12:55

Power Stop -- Auto wake up

    This topic has been closed for replies.

    2 replies

    amano_ginji_39
    Associate II
    May 17, 2011
    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
    May 17, 2011
    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;)