STMicroelectronics STM8 Manual page 68

Table of Contents

Advertisement

Hardware Connection
Code Example
The code example here demonstrates WWDG action. Simply Disco board's user LED and button are
used. When the code starts executing, the LED starts blinking slowly, indicating the start of the code.
When the code executes the main loop, the LED blinks rapidly to indicate main loop execution. If the
button is pressed randomly the micro is reset because the counter is refreshed before the allowed
time. Sometimes the micro may not reset because the counter may be in the allowed window – hence
the name Window Watchdog.
#include "STM8S.h"
void clock_setup(void);
void GPIO_setup(void);
void WWDG_setup(void);
void main(void)
{
unsigned char i = 0x00;
clock_setup();
GPIO_setup();
for(i = 0x00; i < 0x04; i++)
{

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM8 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF