Topic : STM8S Software Reset

Forum : ST7/STM8

Original Post
Post Information Post
October 22, 2010 - 10:49am
Guest

Hi,

How can I reset the STM8S processor using software?

Thanks&Regards

Replies
Post Information Post
+1
0
-1
October 22, 2010 - 2:32pm
Raisonance Support Team

Hi Volkan,

A trick is to use the IDWG: Activate it and loop forever. Once the timeout expires, a reset is generated.
A drawback of this method is that it is relatively slow.

Here is the code:

    // Reset the CPU: Enable the watchdog and wait until it expires
    IWDG->KR = IWDG_KEY_ENABLE;
    while ( 1 );    // Wait until reset occurs from IWDG

Regards,
Bruno