cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S discovery board - Watchdog timer not working?

thaip
Associate
Posted on March 10, 2014 at 17:41

Dear,

I am playing around with the STM8S discovery board using STM8S003K3 MCU. I have done with GPIO, timer, ADC, UART, and now I am trying to work with Independent watchdog timer.

In the init() function, I have:

CLK_SYSCLKConfig(CLK_PRESCALER_HSIDIV1);

CLK_LSICmd(ENABLE);

IWDG->KR = 0xCC; // enable IWDG

After init(), the program just has a while (1) loop.

I put a break point at the init() function to see if the watchdog resets the MCU and returns to init() again or not, and the program just stays at while(1) loop forever.

What am I missing? I read the datasheet several times, but I found no clues.

The compiler I am using is Ride7.

Thank you.

0 REPLIES 0