In previous post I showed how we can use Timer 2 as simple counter. In this post I am going to show how we can program to have interrupt when its value overflow. As simple experiment, we will toggle an LED in each second within the interrupt handler (also called ISR, Interrupt Service Routine).
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.