I see there is some interest in the STM8 processor, with Armduino porting their core to this (8 bit) architecture, so I thought it was worth making a section of this even though its not a STM32 device, and is quite a different type of device.
I just received a couple of these
“STM8S103F3P6 ARM STM8 Minimum System Development Board Module For Arduino” boards from eBay, for $1 each.

PS. I love the way the eBay vendors add the word “Arduino” to the end of virtually everything, even if there is not an Arduino core for such a device ![]()
[RogerClark – Thu Jun 29, 2017 5:06 am] –
PS. I love the way the eBay vendors add the word “Arduino” to the end of virtually everything, even if there is not an Arduino core for such a device![]()
But it simplifies the search! Using the single word Arduino you find a lot of results that are interesting. Try to search using ARM, you will get a looot of results that are not useful.
[zoomx – Thu Jun 29, 2017 6:26 am] –
But it simplifies the search! Using the single word Arduino you find a lot of results that are interesting. Try to search using ARM, you will get a looot of results that are not useful.
True.
I got some other interesting stuff in the post, including some IR time of flight distance measuring modules, but I’ll need to post that to my Postbag ![]()
Almost the same (package and price), but 32 bit and more peripherals:
https://www.aliexpress.com/item/STM32F0 … 17601.html
Ten ICs:
https://www.aliexpress.com/item/Free-sh … 90554.html
It is dirt cheap.
Possibly its he knock down price.
I think STM8 has sold 3 billion of them and still get massive sales figures
Lots of low end devices still use them.
Personally, I’ll mainly be using the STM32 but some devices I want to reverse engineer and modify have STM8’s in them
looking forward to this
it is indeed obsolete, in terms of specs.
it is anything but obsolete, in terms of its market share.
[racemaniac – Thu Jun 29, 2017 9:22 am] –
i’m starting to be happy again i once ordered some cheap tiny stm8 boards. might end up doing something with them after all XD.
looking forward to this![]()
I think some people are working on the Armduino core to get it to work on the STM8, and have some success
I’m not sure whether the STM8 is arm or not, so perhaps the name of that core does not suit this use, but the name doesnt matter that much ;0)
Core: ARM® 32-bit Cortex®-M0 CPU, frequency up to 48 MHz
srp
oops, followed links above ![]()
Looks like it only sips a few mA when it is running. There appears to be a low power version that sips even less.
I’m not sure whether the STM8 is arm or not
Stm8 is not based on arm cortex m at all. Good old 6502 instead.
the good thing about stm8s is that i think st-link v2 can be used to program those, hence this would be at least a piece of shared ‘dongle’ with stm32.
i’m yet to even start learning about it.
unfortunately, i think the currently the available open sourced c compiler sdcc didn’t seem quite as ‘industrial strength’ as arm gcc compilers
http://sdcc.sourceforge.net/
debugging is also a problem in linux as it doesn’t use SWD
oh the other thing is i think it runs on 3.3v, hence there’d be no issues related to 3.3v-5v interfacing with stm32
my thoughts are that these may make good i2c devices
actually i’m thinking of using it for a 4×4 keypad, for a normal ‘digital’ way of doing 4×4 keypads u’d need 8 pins (4 input, 4 output) for the scans, using 8 pins on a maple mini / blue pill is a sin, u’d run out of pins sooner once u do that
but if we have stm8s as a ‘co-processor’ e.g. handle the keypad, but it could do more than that, we can reduce a good fraction of i/o functions to a mere 2 pins on i2c, we could have the stm8s handle keypad + rotrary encoder & even some basic analog stuff & even drive motors
i’ve been pondering about it but i’m thinking that interfacing between 3.3v stm32 to 5v AVR is a hassle, i’ve been looking around for cheap 3.3v 8 bit mcus & i’d think stm8s is one of those which in addition can be programmed from the same st-link-v2 dongle, this saves various other accessories needed to program it
there are occasions that i struggle between deciding on using basic logic blocks e.g. those 74hcxx 40xx stuff, but those ‘chips’ would almost always need several different components for a particular use case. e.g. for a 4×4 keypad i can use either a multiplexer, decoder (e.g. 4-16 multiplexer) or 2 sets of shift registers (4 bits output, 4 bits input) to reduce the interfacing pin counts to stm32, and there are still necessity to set aside additional pins for clocks, output control etc, the end result is that pin counts interfacing with stm32 is not really reduced
to reduce the true pin counts interfacing with stm32 a ‘co-processor’ would really do that using only 2 i2c pins and the ‘co-processor’ is not limited to a single function device. this would really help to reduce component counts vs using basic logic blocks
of course the other way is to use the somewhat pricier ‘high density’ stm32 devices which can really reduce component counts to just the mcu alone
More and more peripherals are now 3.3V, which makes the AVR boards harder to use as I need level converters (voltage dividers at the bare minimum)
I did still use an AVR a while ago as I needed a I2C slave, but we should now be able to do that with ST’s core.
it makes a lot of difference where portability goes
3V operation is attractive.
Its just a shame that they are not supposed to be to tolerate the 3.7 (or max 4.2V) from Lipo
I think the practice they would probably work OK at 3.7V but its beyond the spec
https://www.newark.com/pdfs/techarticle … sBrchr.pdf
https://www.diodes.com/assets/Datasheets/ds28002.pdf
it would take just 2 pieces in series to get 3v from a 4.2v LIPO,or perhaps it may even be possible to make do with just a single diode
alternatively, we could simply connect an LDO or use the existing one on MM/BP
I use diodes a lot ![]()
[Pito – Thu Jun 29, 2017 5:57 pm] –
This types of cpu’s are not C friendly (6 registers and 20 addressing modes..). Best to program it in asm![]()
I programmed only two MCU in asm, ST6 and ST9, some decades ago. ST6 didn’t had a flash but a UV erasable memory. They where the first MCU that I used. ST6 was popular in Italy because an italian magazine, Nuova Elettronica, published a course for it with many examples and a beautiful asm skeleton to start.
The magazine had a particular style of schematic drawings that is still used by Pighixxx http://www.pighixxx.com for his schematics.
I think possibly on the Z80 or 6502
.. and ST started as SGS Microelettronica..
The ST8 architecture is “similar” to the 65xx/68xx and 65/68 are known for lacking a good C. All developments in past were mostly made in asm..
Here it is the STM8 CPU programming manual
http://www.st.com/content/ccc/resource/ … 161709.pdf
at page 10 is written
The Analog to Digital Converter uses a sample and hold technique. It has 12-bit resolution.http://www.st.com/en/microcontrollers/s … tId=SC1244
[Pito – Fri Jun 30, 2017 8:33 am] –
.. and ST started as SGS Microelettronica..
Before was SGS-Ates Componenti elettronici S.p.A. It was here
https://www.google.it/maps/@37.4389452,15.0645871,18z
in the same place of the new bigger factory they do research and production but no MCU. Many years ago they produced components for CFL lamps.
I still have an old ATES transistor somewhere.
[Pito – Fri Jun 30, 2017 9:06 am] –
Only STM8L and STM8AL chips have got 12bit ADC.
The programming manual don’t say that ADC can be 10 or 12 bit, it say only 12. Maybe because it is the programming manual and no one read it.
Even so my first asm code crashed as I was using 8085
somewhere i’ve dozen or so 3v3 nano, mini or similar without usb needing a usb/serial block.
stephen
1) I wouldn’t call STM8 “obsolete” as it’s one of the newest 8-bit microcontroller families on the market. It also seems to be very widely used.
2) Peripheral set is very similar to the STM32 line. This is helpful for those who might want to move back and forth between the 32 and 8 bit world.
3) The core runs at 1.8 V. This gives relatively low power at full speed, that is, the guaranteed clock speed does not roll off with voltage as does AVR. The MCU will tolerate a wide range of input voltage (2.95 – 5.5 V for STM8S) which is nice for running off unregulated battery. STM8L runs at lower voltage (1.65 – 3.6V). The I/O pin voltage are relative to Vdd.
4) Software/community support isn’t anywhere near comparable to Arduino / AVR or for that matter PIC or MSP and so forth. I started with one of the commercial (but free for personal use with size restrictions that aren’t relevant for the value-line STM8 products) compilers from IAR and have used the STM/COSMIC compiler as well. Both are full featured commercial grade products with a steep learning curve, but include (via STLINK) in circuit debugging tools, simulators, and such.
5) SDCC the open source compiler supports STM8 but documentation is pretty thin and it’s hard to find example code. There is no open source support for debugging tools, but there are recent rumors of a project to do so.
6) I’ve lately been playing with an eForth port https://github.com/TG9541/stm8ef/wiki that supports compile to flash, interrupts, a periodic background task, “software serial”, and “board support packages” for a number of cheap Chinese STM8 boards. As “hacker projects” go the code and documentation are quite good.
7) I haven’t used it, but there exists an Arduino-like library for STM8/SDCC that is supposed to allow programming using Arduino paradigms. https://github.com/tenbaht/sduino/blob/ … s/index.md Edit 2 (better link for Sduino): https://tenbaht.github.io/sduino/
Edit for addition observations per previous post:
a) There’s no such thing as 8-bit ARM regardless of what eBay vendors say.
b) There are STM8 variants that have DMA, but the low-end STM8S103F3 or STM8S003F3 boards common on eBay don’t have DMA.
c) Minimal circuit configuration for STM8S is MCU and 3 capacitors (Vdd bypass, Reset, and Vcap (1.8V core voltage)) using internal oscillator.
thanks for your review!
STVD is a dog, ugly as hell.
there is an unlimited cosmic available on github. the morality of using it may be questionable to some, however.
I use IAR. it is simple, intuitive and very utilitarian as well. the beauty of it is that you can use the same IDE across most MCUs that I touch. couldn’t have been happier with it.
I looked on STMs website about the compiler for STM8 and it seemed to be a free download, of what I presume is the compiler from Cosmic.
I looked on Cosmic’s site and the STM8 compiler was available for free download, however there was some wierd legal stuff about it being only a 1 year license, albeit which they said was renewable.
I dont know if the compiler checks the date and time or whether the license duration is just from a legal standpoint.
BTW. Cosmic seem to have a compiler for the STM32 as well, but as STM official use gcc e.g. That’s what the CubeMX is compatible with, I don’t know who would use the Cosmic compiler for STM32
https://easyeda.com/LightningStalker/ST … d69f4df7ea
[LightningStalker – Sat Nov 04, 2017 3:39 pm] –
I made a little breadboard pill board, more of a breakout board really, for my project with the STM8L152C6T. Feel free to do what you want with it. The traces are kind of ugly, mostly autorouter, but I was in a hurry. Also there is no regulator onboard. It was mostly copied from the STM8L discovery.
https://easyeda.com/LightningStalker/ST … d69f4df7ea
Thanks for posting…
I few forum members have some $1.50 STM8 boards, bought from eBay (from China), but I don’t think anyone , me included is actively using them for a project.
[RogerClark – Sat Nov 04, 2017 8:23 pm] –[LightningStalker – Sat Nov 04, 2017 3:39 pm] –
I made a little breadboard pill board, more of a breakout board really, for my project with the STM8L152C6T. Feel free to do what you want with it. The traces are kind of ugly, mostly autorouter, but I was in a hurry. Also there is no regulator onboard. It was mostly copied from the STM8L discovery.
https://easyeda.com/LightningStalker/ST … d69f4df7eaThanks for posting…
I few forum members have some $1.50 STM8 boards, bought from eBay (from China), but I don’t think anyone , me included is actively using them for a project.
I’ve been using the dollar STM8S103 boards for running servos & PWMing LEDs on a model kit. All the work has been done with bare-metal direct register twiddling with SDCC though. I might try and rewrite it at some point using the Sduino libraries.
I have loads of ghetto STM8S003Fs on pcb adapters, working just fine. They came to me at like 30c/chip. likely the least expensive brand-name MCUs.
Do you know which version of STM8 it is, and whether it can be reprogrammed.. Some STM8 can only be programmed once
https://www.eevblog.com/forum/reviews/b … -be-fatal/
yes I understand that , as i just solder new ones so i do not lose the original software ” is there away to recover it”, i still can reflash the same one on board no problem with st-link to get it working but looking to have it working with i2c or spi better than the limiting rs232 also the LEDs are not working.
with the updated firmware, thought to having it using arduino core much better if i can find examples how to use i2c and with 2 pwm (freq/duty cycle) to control the voltage and and current.

