cancel
Showing results for 
Search instead for 
Did you mean: 

STM8L052R8 Watchdog Timer Issue

snehakarthik
Visitor

I have configured the watchdog for the maximum duration possible, i.e, 1.7 sec. 

void watchdog_init(void)
{
CLK_ICKCR |= CLK_ICKR_LSION;
IWDG_KR = 0x55; 
IWDG_PR = 6; 
IWDG_RLR = 0xFF;
IWDG_KR = 0xCC; 
}

But it seems to be resetting in around 26 - 28 ms. I have also checked this timing with an oscilloscope by toggling a led. 

watchdog_init();
do {
LED5_TOGGLE();
printf("Test!\n");
delay(516);
} while(1);
  
What do you think is the cause for this issue? How is it possible to fix this? 
0 REPLIES 0