STM8

Other STM8 core (Sduino,...)
leif
Posts: 6
Joined: Wed Oct 14, 2020 1:55 am

STM8

Post by leif »

Does anyone work/play with the STM8 here?

Apparently this forum used to have an STM8 section but it doesn't seem to anymore.

I'm using sduino on an STM8S003F3 and I have trouble getting interrupts to work. Does anyone have any pointers? Examples?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM8

Post by fpiSTM »

I've added an STM8 section.
I've not listed all the STM8 cores as I'm not aware of all available ones. I can add them if needed/request. For the time being, I moved your post in other forum.

For your issue, I've no clue as I don't know this core only. :?
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: STM8

Post by mrburnette »

leif wrote: Wed Oct 14, 2020 6:31 pm ...
Apparently this forum used to have an STM8 section but it doesn't seem to anymore.
...
... old forum crashed and this "new one" has the same URL but is administered by STM. Some of the "old" content has been recovered at stm32duinoforum.com

For STM8, the link below will give you results for the old forum:
stm8 site:stm32duinoforum.com

Including "interrupt as required in the search criteria:
"stm8" "interrupt" site:stm32duinoforum.com

Of course, there are a few references to interrupt+stm8 on other sites line arduino.cc and embedded-lab.com


Ray
leif
Posts: 6
Joined: Wed Oct 14, 2020 1:55 am

Re: STM8

Post by leif »

Thanks for creating the forum!

The STM8 hobbyist user base seems extremely small for some reason. It's probably a chicken-and-egg problem -- yes it's ridiculously inexpensive, and very powerful for the price, but the toolset is nowhere near as hobbyist friendly as Atmel, ESP8266, and STM32 of course.. so the threshold of entry is much higher.

That said, there ARE tools, and I love a challenge. The STM8 is literally the price of an AND and a NAND gate, and it can "just a bit" more than that. I really need to learn this.

I found a _very_ small reddit community (5 people, 6 with me) where someone has posted some incredibly helpful videos that are essentially an "Arduino to Real MCU" conversion guide / curriculum.

With that, I'm starting to feel like I can get this done, and learn a ton of new things to boot. Now that I'm starting to understand what goes on under the hood in the Arduino Uno that we all know and love, I'll also be able to understand the STM8 data sheet, and get the information I'll need from there.

Anyway, I'll report back. :)
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: STM8

Post by mrburnette »

leif wrote: Thu Oct 15, 2020 4:31 am ...
The STM8 hobbyist user base seems extremely small for some reason. It's probably a chicken-and-egg problem -- yes it's ridiculously inexpensive, and very powerful for the price, but the toolset is nowhere near as hobbyist friendly as Atmel, ESP8266, and STM32 of course.. so the threshold of entry is much higher.
...
I do not view the STM8 a chicken-n-egg problem any more than the Atmel tiny85 is a chicken-n-egg problem. Rather I propose that STM8 is simply a niche microcontroller, as I view the tiny85/45. But, I come from a hardware environment where hardware selection is driven by detailed specifications.

Atmega328P is a defacto chip in the 8-bit Arduino line: too powerful for some projects, leaving a large percentage of underutilize silicon, but adequate for 75%+ of user projects. But, the "clone" boards are inexpensive and the wasted silicon translate to under a $1 in my guess. Having one architecture to deal with makes the weekend programmer more comfortable and likely drives a higher project completion rate. Dealing with the known is for more comfortable for non-professional programmers.

In the case of STM32, the F103xx is the 32-bit equivalent of the Atmega328: a workhorse. There is a large volume of online materials, this forum, the multiple Wikies describing many aspects of using the microcontroller. Again, for weekend Arduino coders, this uC can be obtained on rather inexpensive boards. Using a STM8 just complicates ones life and forces architectural and engineering decisions which are unnecessary when using the STM32F103xx ... and there is very little real cash savings to be had for hobby projects.

There are a goodly number of tiny85 users, likely more than STM8 but probably because the tiny85 cores were developed for Arduino early on and Digispark and Adafruit both had commercial boards for these uC with forum support.

But, the above is just this old engineer's beliefs. Rather than drill too deeply into the non-mainstream chips, I rather find that I enjoy devoting my spare time across a range of diverse architectures: Atmel, STM32, Espressif, Cypress PSOC, Raspberry, etc.


Ray
leif
Posts: 6
Joined: Wed Oct 14, 2020 1:55 am

Re: STM8

Post by leif »

Different thinking keeps the world interesting, Ray.

Edit: I just checked out your hackster page... nice! we don't think all that differently :)

What attracts me to the STM8 is the possibilities that come with the price tag. I mean, it's 22 cents in quantity 30 stuffed on a board by jlcpcb. At that point it's literally the same price as a couple of logic gates, cheaper than a standalone ADC (yet it has five built in), cheaper than an MCP23017 i/o extender (yet it has 16 I/O pins, you could probably use 13 while leaving a couple of pins for serial communication and one for programming).

The ESP8266 was a similar paradigm shift for me. Leaving a wifi-capable computer up in a light fixture with the sole duty of informing whether the light is powered would have sounded insane to me, if the price tag hadn't been $2.50.

Here's a full microcontroller for _one tenth_ of that price.

I'm working on a little carrier board for the ESP-01 for home automation purposes. The ESP-01 is wonderful except that the pins flicker on power-up, and a couple of the pins must be held high during startup for it to boot from flash. I could do it with two NAND gates, two AND gates, a capacitor, a zener diode, a transistor, and bunch of resistors and maybe some other support components.. but the STM8 beats all of those by doing an infinite amount more -- for _less_, and more flexibly, because I can always load different software on it.

Yeah. I'm hooked on this thing.

In other news, I just got interrupts working! Onwards and upwards. My first project is a quad trailing edge dimmer. The STM8 will be handling the PWM timing in response to the zero crossing pulse. That's all it'll do. At that price that's all it _needs_ to do to earn its keep. For this project, which includes having custom boards made with factory soldered SMD components, it's absolutely the most suitable part for the job.

///Leif
Last edited by leif on Fri Oct 16, 2020 12:22 am, edited 1 time in total.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: STM8

Post by mrburnette »

leif wrote: Thu Oct 15, 2020 5:35 pm ...
The STM8 will be handling the PWM timing in response to the zero crossing pulse. That's all it'll do. At that price that's all it _needs_ to do to earn its keep. For this project, which includes having custom boards made with factory soldered SMD components, it's absolutely the most suitable part for the job.
...
$0.22 / 30 is not the extended price ... it is $6.60 for the uC's plus, PC board setup fee, stencil fee, other components and per solder connection fee. I am sure it is reasonable, but not 22 cents.

Either you are going to consume the lot of 30 yourself or give them out to friends & family, or you are going to try your hand at selling them; which is not my idea of hobby electronics. When one sells, every penny makes a difference. To understand if you picked wisely, all costs must be summed and divided by 30 to get a unit cost.

Compare your unit cost to $1.89 which is the cost for a clone Black Pill Board. A real Blue Pill on Aliexpress is $2.59. Both Black & Blue have a shipping component.

In my approach as a hobbyist, I would inquire on the off-shore vendor by email the quantity where shipping is free (or substantially reduced.) I was able to get free-shipping on the Black Pill at quantity 10x... your mileage may vary. My testing of the Black board is here. Obviously, products for market need to be better defined in costs, maintenance fixes, and revisions: designing on a uC that is 99% flash full is going to likely bite you in a tender location.

Much of the coding for your STM8 is unique or constrained in comparison to an STM32F103xx. If you are willing to sacrifice a $2.50 ESP8266, why not a $1.89 Black Pill?

[truth]
Hobbyists reading this should not go out an buy $6.60 worth of STM8 microcontrollers thinking they are just perfect for a number of projects unless they realize they are going to work extra, extra hard to develop.
[/truth]

For folks out in the wild, buying qty=10 may be far too much of an overkill, but never buy just 1 (one) as you need to keep one board just to validate that your development board is working correctly. Off-shore components rarely go through any Quality Assurance testing.


Ray
leif
Posts: 6
Joined: Wed Oct 14, 2020 1:55 am

Re: STM8

Post by leif »

Thanks for taking the time to respond again, Ray!
mrburnette wrote: Thu Oct 15, 2020 10:36 pm $0.22 / 30 is not the extended price ... it is $6.60 for the uC's plus, PC board setup fee, stencil fee, other components and per solder connection fee. I am sure it is reasonable, but not 22 cents.
You're absolutely right. This is completely true -- it doesn't make any sense _on its own_. Adding it to a board you're already making (in my case, a dimmer / home automation control board, which I'll be using in every room of the house I'm building), it's not hard to get to 30 units, and at that point it really only _adds_ 22 cents, since it's one of the few parts that are part of the basic library, eschewing the $3 per component setup fee.
Plus, I may do something commercially in the future -- not yet, but I consider this good practice.

I finally get your point now, though. When you're making your own circuit boards with SMD parts, you're really not in arduino-land anymore. The criteria is quite narrow at this point, high level software abstractions designed to make it easy for beginners to get started probably aren't worth the development effort for such a narrow use case. I _do_ very much appreciate the sduino core as it exists, though. At this point in my own personal development, having the familiar setup and loop functions, not to mention pinMode and digitalWrite, helped me get it to do _something_. Even if I won't end up using the wrapper functions in the end, they were really nice to have in the beginning.

The STM8 indeed doesn't make much sense as a standalone development board. Where it makes sense is as a stand-in on a breadboard for what will later be an SMD part on a PCB.
mrburnette wrote: Thu Oct 15, 2020 10:36 pm If you are willing to sacrifice a $2.50 ESP8266, why not a $1.89 Black Pill?
That was last year, when I had just started with electronics and microcontrollers (after a 20 year x86 software-only career). How things have changed since then :). That said, the Black Pill doesn't have WiFi does it?

I've personally used ESP8266, ESP32, Atmega328P and LGT8F328 for electronics projects so far. I haven't personally found a use case for the STM32 yet, but at this point I know I will get there too.

By the way, I checked out your projects page -- very cool! I for one cannot wait for the rainy day when you get bored and dremel out that circuit board under the ESP32 clone board's WiFi antenna. I'm really curious as to what makes that huge performance difference. It could very well be the module itself I think. I have seen similar huge performance differences on ESP8266 boards. Some Wemos D1 Mini boards have a wrong capacitor value right on the ESP-12F module IIRC.

//Leif
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: STM8

Post by mrburnette »

... when I had just started with electronics and microcontrollers (after a 20 year x86 software-only career).
Back in my work days, I managed a JAVA team of 10 programmers for 3 years. With every thought of those days, it makes retirement sweeter :D

Good progress with building your new home. Do take a rainy day and review my project here on NodeRED. With your background, you could get into this with ease.

Ray
zoomx
Posts: 28
Joined: Fri Dec 20, 2019 10:12 am
Location: Near Mt.Etna

Re: STM8

Post by zoomx »

I played with these cheap chinese STM8 boards some years ago with sduino
https://tenbaht.github.io/sduino/
that was the only core similar to the Arduino one before the new official ST core.

I translated to it an RGB lamp sketch, I used an Attiny86 too!
Post Reply

Return to “Other”