AnsweredAssumed Answered

Active/Halt wakeup with RTC

Question asked by akbulut.serkan on May 3, 2013
Latest reply on Jun 19, 2013 by ma.wenbing
Hi ,
I am a new user of STM8.  In my project I am using Active/halt mode an it wakes up with RTC Wakeup operation. My problem is, it is always waking up same times. it's equal to 3ms. I want update auto wake up times. 

I am trying to change RTC_SetWakeUpCounter(30000) but it is not setting wake up times. How can ı change wake up times.
Thank you for your comments.

Here is the example code;

#include "stm8l15x.h"
#include "stm8l151f3.h"

#define ENABLE                         1
#define DISABLE                         0

void RTC_Config(void)
       CLK_RTCClockConfig(CLK_RTCCLKSource_LSI, CLK_RTCCLKDiv_1);
     while (CLK_GetFlagStatus(CLK_FLAG_LSIRDY) == RESET);
       CLK_PeripheralClockConfig(CLK_Peripheral_RTC, ENABLE);
       RTC_ITConfig(RTC_IT_WUT, ENABLE);
void GPIO_LowPower_Config(void)
      GPIO_Init(GPIOA, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow);

   GPIO_Init(GPIOB, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_7, GPIO_Mode_Out_PP_Low_Slow);

   GPIO_Init(GPIOB, GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5, GPIO_Mode_Out_PP_High_Slow);

   GPIO_Init(GPIOC, GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6, GPIO_Mode_Out_PP_Low_Slow);

   GPIO_Init(GPIOD, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow);

   GPIO_Init(GPIOE, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow);

   GPIO_Init(GPIOF, GPIO_Pin_All, GPIO_Mode_Out_PP_Low_Slow);

void Halt_Init(void)


   /* Switch to LSI as system clock source */
   /* system clock prescaler: 1*/

   while (CLK_GetFlagStatus(CLK_FLAG_LSIRDY) == 0);

   /* Set STM8 in low power */
   /* Set GPIO in low power*/    
   /* Stop RTC Source clock */

   CLK_PeripheralClockConfig(CLK_Peripheral_LCD, DISABLE);

void main(void)