STM8S Tutorials – #1 Tools

— June 9, 2015

STM8S Discovery Board

When it comes to 8 bit family of microcontrollers, Atmel AVR and Microchip PIC are the most commonly used variants with old school 8051 still in use in some relatively older designs. But as I explore more about new STM8 MCU’s by ST microelectronics, more I find a strong replacement for AVR and PIC controllers for my 8 bit controller based designs. After playing with STM8 MCU for a few months now, I can conclude that, as of now, STM8 MCU’s are the most feature rich and cost effective controllers in 8 bit controller segment. As we progress in this tutorial series we will come across almost all the main features of this 8-Bit controller. In this tutorial series we will focus mainly on STM8S series which is a medium code density member of STM8 family.

ST microelectronics provides rich tech support and evaluation platforms for a quick start. Most easy way to start with STM8 microcontroller is to grab a STM8S Discovery board which is a low cost development board with all the necessary features to kick-start application development using STM8 mcu.

STM8S Features

STM8 Core based on Harvard Architecture.

16MHz Operation w/ 3-stage Pipeline

32 KByte Program Memory

2 KByte RAM

Internal RC Oscillator

3, 16 Bit Timers, One Advance, Two Gen Purpose Timers

1, 8 Bit Timer

UART, SPI, I2C Blocks

10 bit, 10 Channel ADC

Single Wire Programming Interface (SWIM)

This series guides you to get started with your STM8S Discovery board. Subsequent posts on STM8S tutorial series will guide you on further programming and interfacing with this feature rich 8-Bit controller. This particular post lists the necessary hardware and software required to start application development.

That’s it, that’s all you need to start application development using STM8S controller. Install these 3 software in your windows based computer. [PS - Development tools for Linux based machines will be updated soon].

Once all three software packages are installed, next step is to configure STVP and STVD to work with STM8S Discovery Board.

STVP Configuration

To configure STVP to program STM8S105C6T6 controller on Discovery board go to Menu bar in STVP and choose

Configure ->Configure ST Visual Programmer

Note configure settings in Image below…

STVP Configuration for STM8S Discovery Board

STVD Configuration

STVD is a great tool, it is used for efficient project management, debugging and overall IDE for STM8 controllers, but remember STVD is not a C compiler, to develop application programs using C language we need a C compiler that understands the language of STM8S internals and does all the cross compilation for STM8S. Cosmic C compiler is one such compiler. Cosmic compiler’s size limited evaluation version is free for download at the link given in software tools section of this post. Once both STVD and Cosmic compiler are installed in system it is necessary to link the path of cosmic C compiler with STVD. So that, STVD knows where to look at, when it need to compile any C file.

Go to STVD-> Project->Settings

Choose following options in General Tab of Project Settings

STM8S STVD Settings to link Cosmic C compiler with STVD

Once configuration of STVP and STVD is done we are now ready to write our first firmware for STM8S105Cx MCU.

In my next post in STM8 Tutorial Series, I will explain how to write and execute “hello world – LED Blinking” program for STM8S discovery using STVD, STVP and Cosmic C compiler. Please do comment your suggestions and queries regarding this tutorial in the comment section below.