Question
STM8L052R8 Watchdog Timer Issue
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?
