cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L053 RTC PERIODIC WAKEUP ENABLE BIT RESETS AFTER FIRST INTERRUPT

unnati811
Associate II
Posted on June 07, 2017 at 14:23

Hi,

I am using STML053C8 controller.

In my application i am using RTC periodic wakeup interrupt for waking up every 1 sec.But the interrupt occurs only for the first time and then the wakeup enable bit & wakeup interrupt enable bit gets reset. also the auto reload counter gets set to 0x0000ffff. i have initialised the rtc as follows:

void RTC_Init_1sec()

{

    //Initialize RTC Only

  hrtc.Instance = RTC;

  hrtc.Init.AsynchPrediv = 127;

  hrtc.Init.SynchPrediv = 255;

  hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;

  hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;

  hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;

  HAL_RTC_Init(&hrtc);

  //Enable the WakeUp

  HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 2048, RTC_WAKEUPCLOCK_RTCCLK_DIV16); for 1 sec

 

  HAL_NVIC_SetPriority(RTC_IRQn,3,0);

  HAL_NVIC_EnableIRQ(RTC_IRQn);

}

To add, i have been successful with RTC periodic wakeup interrupt using the above RTC initialization for my another application using STML052K8.

awaiting for the suggestions.

thanks

unnati

This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0