STM8 series has already captured a large share of 8 Bit controller market in Industry. It is also gaining popularity in DIY community all over world, all credit goes to great features of this family, plenty of documentation and low cost Discovery Kits by ST Microelectronics. There are also many ultra low cost minimum system boards available on Ebay, Ali Express, Amazon etc. I picked some of these boards recently from this Indian vendor. These boards costs less than Rs. 150 and puts all I/O on PCB headers, power supply, reset switch, SWIM connector and a test LED connected to Port B.5.
- SWIM Connector
- Voltage Regulator [3V3 - AMS1117]
- Micro USB connector to power the board over USB, SmartPhone Charger
- All Pin Outs
- Power LED
- USER LED, Connected to PB.5
- RESET Switch
Programming this low cost board is exactly similar to programming STM8S Discovery board. I have already covered Tutorial on Getting Started with STM8S Discovery. Only trick is, this low cost board doesn’t have ST-Link so we need an external ST-Link for STM8 to program this board. One can use a STM8S/ STM8SVL Discovery board as ST-Link V2 to program this board. Standard ST-Link V2 can also be used to program this board.
- Some modification are needed on Discovery boards to use them as STM8 ST-Link. Open Solder Bridges SB1 and SB2 near SWIM connector to use STM8S Discovery as STM8 ST-Link.
Using STM8S/ STM8L Discovery as ST-Link can program only STM8 Series of MCUs while standard ST-Link V2 can program and debug both STM8 and STM32 MCUs.
Software Tools for Windows
- STVP – Go to STVP Tutorial
- STVD – Go to STVD Tutorial
- Cosmic Compiler – Cosmic Compiler + STVD Tutorial
Choose STM8S103F3P as Device in STVP and STVD.
- void myDelay(void);
- void myDelay()
- int i,j;
- GPIOB->DDR |=0×20;// PB.5 as Output
- GPIOB->CR1 |=0×20;// PB.5 as Push Pull Type Output
- GPIOB->ODR |=1<<5;// PB.5 = 1
- GPIOB->ODR &=~(1<<5);// PB.5 = 0
Compile this program using STVD and Cosmic Compiler and burn the .s19 file onto STM8S103F3P device using STVP. Test LED connected to PB.5 should blink with a constant delay.