Timer Interrupt (TIM4)
In this example uses the same concepts of the previous example but it is based on timer interrupt –
TIM4 interrupt. Timer interrupts are very important interrupts apart from other interrupts in a micro.
To me they are highly valuable and useful.
This example demonstrates how to scan and project information on multiple seven segment displays
with timer interrupt while the main loop can process the information to be displayed.
Hardware Connection
Code Example
main.c
#include "STM8S.h"
unsigned int value = 0x00;
unsigned char n = 0x00;
unsigned char seg = 0x01;
const unsigned char num[0x0A] = {0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8, 0x80, 0x90};