How to write LED Blinking program on STM8S with timer 2 peripheral.
As we know STM8S family microcontroller generally consists of TIM2|TIM3|TIM5 general purpose timers. Here we have set a problem how to create a 1 Second LED ON/ LED OFF. For this we need to understand some feature which are as follows. Material Required: 1. STM8S Development Board (Here we are using STM8S003F3P6) 2. STM8 & STM32 ST-LINK V2 programmer Software Required: STVD (ST Visual Developer) STVP (ST Visual Programmer) Cosmic CXSTM8 Special Edition 4.5.2 Compiler Source files and Header files can be download from this link: https://github.com/vivek889/STM8S /*STM8S003F3P6 LED BLINK PROGRAM WITH TIMER 2 (1 SECOND ON 1 SECOND OFF)*/ #include "stm8s.h" int main() { // Default clock is HSI/8 = 2MHz GPIO_DeInit(GPIOB); // prepare Port B for working GPIO_Init (GPIOB, GPIO_PIN_5, GPIO_MODE_OUT_PP_LOW_SLOW); //Declare PB5 as push pull Output pin TIM2_DeInit(); TIM2_TimeBaseInit(TIM2_PRESCALER_2048, 1952); TIM2_Cmd(ENABLE); while(TRUE) {...