Understanding the basics with an STM8S103F2

Thread Starter

lesneypark

Joined Dec 31, 2015
47
Hello,

I am learning about a reference design circuit which contains an STM8S103F2 (http://www.st.com/web/catalog/mmc/FM141/SC1244/SS1010/LN754/PF215114) to control the switching of two SCR's within a lighting dimmer circuit.

My day job is a design engineer for LV & HV distribution systems, I have basic electronics experience and I have even less embedded engineering/ software coding experience.

I have the software files and I am keen to better understand the software configuration of this MCU as ultimately I wish to make a few tweaks for my application.

My question is therefore, where do I start? what kit do I need? if I tweaked the software, how to I download it onto the MCU? where could I find an engineer to help (if needed)?

Appreciate this is a bit of an open ended post but essentially I'm looking for some tips to get me started in the right direction so I don't waste too much of my time unnecessarily.

Many thanks,

Neil
 

dannyf

Joined Sep 13, 2015
2,197
You may want to check the stm8s discovery board, as I think it has a stm8s103 on board.

Programming can be done with St link.

Software support is a little sub par, as your choices are limited to St visual studio (it sucks) or iar (expensive), for the most part.

It is a great little chip that's under appreciated. I use the 103 and its little brother 003 a lot and really like them.
 

Thread Starter

lesneypark

Joined Dec 31, 2015
47
Danny, thanks for the info.

I think I'll get hold of the STM8S discovery board and ST visual studio to have a play and see what I can do. I won't be doing a lot of this so I hope ST visual studio will be sufficient.

Do you have any tips or advice on using the chip and/or ST visual studio which will help my learning curve?
 

sailorjoe

Joined Jun 4, 2013
364
Lesneypark, in order to program virtually any embedded system like this one, you need to learn a few basic things. Start with a programming language that is recommended by the manufacturer. Typically this will be C++, or perhaps Python, or maybe something else. Get a course or read a book or a tutorial and get comfortable with the the language. Second, you'll want to be familiar with the architecture of the system. For example, the STM8 series is an 8 bit system with a Harvard architecture. That means that code is held in one memory bank, and the data in another, so that it can work faster. Also, the system has a specific arrangement for operating it's I/O pins, it's timers, interrupts, and other internal features. Understanding those will allow you to use the system to its fullest. Lastly, you need a development environment, which is what dannyf recommended. You need the system on a circuit board that can connect to your PC. You need software on the PC that allows you to write programs, download them to the dev board, and communicate so you can see what's going on and fix problems. Once you've done this for one type of processor, the next ten or so are much easier!
http://www.st.com/st-web-ui/static/...ata_brief/DM00156356.pdf?s_searchtype=keyword
 

dannyf

Joined Sep 13, 2015
2,197
Do you have any tips or advice on using the chip and/or ST visual studio which will help my learning curve?
Just one: reading the datasheet and reading the datasheet some more.

Embedded programming is built on reading and comprehending the datasheet. You are presumed to have good knowledge of C, to write your own code and / or to go through libraries; Getting familiar with the IDE is the easiest part but don't get surprised that many "seasoned" programmers cannot pass that.

the ST ide is old and its development has stopped. You will also need to download a compiler for it to work - I use cosmic. For simplicity, the (size-limited) IAR ide is easier to get going.

The STM8S discover board contains its own programmer so it is all you need to get going.

The only known problem with the chip is its I2C module - plenty of fixes around for that.

If you have problems, lots of places for help, including here.
 
Top