STM8S: Use Timer 2 as Simple Counter to Blink LED (without Interrupt)

Timers inside MCUs are very useful and essential peripherals for timing applications. In this article I will show Timer 2 in an STM8S (specifically STM8S103F3) can be used to blink an LED.