AN3266 is an application note published by ST. It describes how to use the STM8S-DISCOVERY's GPIOs and interrupt controller to drive LEDs. The note contains hardware connection, schematics, software configuration, program code, etc.
This document describes an application based on the STM8S-DISCOVERY evaluation board. It demonstrates how to configure the STM8S105C6T6 microcontroller's GPIOs and interrupt controller to control a set of LEDs (LD2, LD3, LD4, and LD5) using a pushbutton.
| Microcontroller | STM8S105C6T6 |
|---|---|
| Board | STM8S-DISCOVERY |
| External components | LD2, LD3, LD4, LD5 LEDs |
| Resistor value | 510 Ohms |
| Pull-up resistor | 4.7k Ohms |
| Debounce filter capacitor | 100 nF |
LEDS LD2 and LD5 start blinking, indicating that the programming operation has completed successfully.
Pressing the pushbutton generates an interrupt that triggers the blinking of the other pair of LEDs while switching off the first one.
They are required for the pushbutton to avoid triggering several interrupts due to mechanical bouncing.