The STM8S003F3P6 is cheap again!

A project log for eForth for cheap STM8S gadgets

Turn cheap stuff from AliExpress into interactive development kits!

ThomasThomas 08/03/2019 at 09:5433 Comments

When I started this project the STM8S003F3P6, an STM8S Value Line µC with 8K Flash and 1K RAM in a TSSOP20 package, was the cheapest device in its class. Cheap enough to enable an industry of low-cost electronics control devices, e.g. thermostats or voltmeters, with the left-overs of mass production runs. This market for low-mid-range µCs encouraged Nuvoton to market the mostly pin-compatible N76E003AT20, an 8051 family device.

For the initial goal of this project this was bad news:  from then on the Nuvoton chip was the go-to device on the spot market, a chip with an architecture utterly unsuitable for a self-contained Forth system!

Right now, however, the STM8S003F3P6 is at a very low price point: I just received 10 pcs for $1.86, which is as low as it gets!

Don't get me wrong, the Nuvoton chip won't disappear and it's very likely to receive a thermostat like the W1209 with an "non-hackable" chip but at least the TSSOP20 package can be soldered with ease.  


Ken Yap wrote 08/07/2019 at 06:28 point

@Thomas @de∫hipu Just curious, do your Yanwen packages come from China or from all over the world? My eBay sellers mostly use China Post or HK Post, but some packages come from various countries like Singapore, Malaysia, Vietnam, Thailand, and today, one from Fiji. People have reported all kinds of strange origins like Seychelles. For Europe perhaps you will find origins like Cyprus or Spain. In a forum discussion it turned out the address of a company in Spain was just an apartment in a housing estate. Probably that of the local director.

I think this is how Chinese eBay shops (not just electronics) ship. They (possibly a conglomerate) set up a warehouse in a country with cheap postage and labour. When orders come in they forward and fulfill them from stock on hand or in some cases have to wait until stock is replenished. Hence the wide spread in delays. Well why not it's a clever scheme, it also gives locals work, even if menial.

Of course with such long fulfillment chains things are bound to get lost. One package had a slightly wrong address on it but my PO knew it was for me. (You'd think the shippers would print from the address held in their database, but maybe some manual transcription happens.)

I have been fairly lucky, only one package out of maybe 20 has been lost and the seller refunded my money. Another came with a broken TFT LCD screen and I got compensation. AliExpress would seem to have the advantage of holding the money in escrow. With eBay you depend on the goodwill of the seller and their desire to maintain high ratings, as invoking eBay money-back for DoA goods may involve sending it back, not worth it.

For large goods (not just electronics) I prefer to pay a bit more to buy from a local shop on eBay even if they ship from overseas because I can invoke local consumer law. For a bag of LEDs I won't pay 3x. Even if I lose 5% I'm still ahead.

Anyway I like having a range of sources: LCSC, eBay, AliExpress.

  Are you sure? yes | no

Thomas wrote 08/07/2019 at 16:08 point

The last Yanwen package came from China - curiously it had two stacked address stickers. The first one was almost entirely in Chinese, the one that covered it had transliterated names and content information etc. in English. The tracking number was identical. So, at least the STM8S003F3P6 chips came from China. It's very likely that a single wrong data element in the shipping transaction strands a delivery. While platforms like AliExpress make customer data handling relatively safe it's far from certain that data elements don't get mixed up at one of the many mappings and interfaces.

I've also received items from Chinese sellers that were delivered from other countries, e.g. Thailand. It's likely that the "cheap stuff" logistics people know many tricks, but most likely many of them don't apply to more or less formal trading platforms like AliExpress. For an instance, in Portugal. for instance, informal Chinese trade is linked to informal Portuguese markets. The things traded is most often fake branded items (and visibly fake, e.g. "Y5L" sunglasses) and not stuff that sparks some excitement in the average HaD guy ;-) .

  Are you sure? yes | no

Ken Yap wrote 08/14/2019 at 14:46 point

Well a package (not STM8 stuff) that I declared lost has turned up, 10 weeks after ordering. Also it has added another transshipment country to my list: Philippines. Some day I'll collect all the countries in the world. 😉

Next round I'll order some STM8 breakout boards and a ST-Link flasher. They are so cheap and incorporate things like reset switch, oscillator, power LED and test LED that they will probably become my go to platform for small gadgets, to program in C or eForth

  Are you sure? yes | no

Thomas wrote 08/14/2019 at 21:31 point

It's amazing how they make it work - the Philippines would also be new on my list.

By the way, I'm working on a new configuration for STM8 eForth that has half of the dictionary in the EEPROM. Right now it's at 4K while it has all of the goodies: background task, ADC, DO..LOOP and even CREATE..DOES.

  Are you sure? yes | no

K.C. Lee wrote 08/27/2019 at 20:39 point

BTW I got my STM8 chip today (ordered on the 4th Aug) from the aliexpress link.  It came from Estonia to Canada.  Probably much faster than from China because Canada Post + Custom sit on those packages for months.

>STM8 breakout boards
I order generic TSSOP20/SOIC20 breakout boards and have the needed passives soldered onto the back side with the SOIC20 footprint.  Those are cheap and are handy for STM32F030 too.  :)

  Are you sure? yes | no

Thomas wrote 08/28/2019 at 16:40 point

I made some of those, too. I guess I nicked the method from you -  these should look a bit familiar:

  Are you sure? yes | no

K.C. Lee wrote 09/04/2019 at 01:16 point  There goes another STM8

No PCB this time. Just point to point soldering with magnetic wires and pile the caps on top of the STM8.  :)

  Are you sure? yes | no

Thomas wrote 09/06/2019 at 17:45 point

K.C. I've been eyeing modding Chinese RGBW LED light bulbs. The ones I have use a µC in a SO8 package but it's not an STM8 device. Creating a small PCB that replaces the µC shouldn't be too hard.

  Are you sure? yes | no

K.C. Lee wrote 09/09/2019 at 00:03 point

Too bad the STM8S001J3 only have 3 PWM outputs.  You would want to have 5 CAPCOM channels - 1 IR decoding + 4 for the LED. The STM8F003 would be a better fit.

Interesting enough my KVM PCB might do the job. It is mostly a single sided PCB.

It breaks out PC3-PC7 where Timer 1 CH1-4 and Timer2 CH1. There are also power, SWIM and the I2C broken out.  The spacing are staggered  into 2 rows of 0.1" pitch SMT pads so a ribbon can easily soldered to. Ribbon cable also happens to be same pitch as SOIC8.  :)

My rowboat project: has a NEC IR decoder.  It use TIM2 CH3 and can possibly be changed to TIM2 CH1 with some minor register changes.  The code is in hardware.c. (I left the ir remote.c from my STM32F030 in the directory by mistake. )

  Are you sure? yes | no

Thomas wrote 09/09/2019 at 19:12 point

@K.C. Lee  thanks for the tip! The PCB on Oshpark looks nice - a ribbon cable friendly lay-out is a good idea!

  Are you sure? yes | no

K.C. Lee wrote 09/09/2019 at 20:21 point

Sorry had some issues with the OSHPark link.  Here is the up dated one:

  Are you sure? yes | no

Thomas wrote 09/10/2019 at 17:53 point

Cool, that one works!

  Are you sure? yes | no

Jan wrote 08/04/2019 at 17:01 point

ProTIP for those who do not trust Aliexpress sellers:

It's equally cheap there and you get genuine products for low shipping charges :)

  Are you sure? yes | no

Ken Yap wrote 08/05/2019 at 00:00 point

🙏👍 More options.

Sometimes I think I like planning more than executing. I draw these schematics and lay out boards, put them aside for a while, then think of improvements, tinker some more, repeat. Whatever, to pass the time. 😉

  Are you sure? yes | no

Jan wrote 08/05/2019 at 04:43 point

Sometimes? I need a kick in my ass for most of my projects to get them done... It's a pain sometimes, feature creep and looking for better parts with even lower this and that instead of just getting that damn thing done even if not perfect... 

  Are you sure? yes | no

Ken Yap wrote 08/05/2019 at 05:00 point

Well it's a tradeoff. If it's not for a job and if nobody, including yourself, is counting on the final product, then you can do as you damn well please with your time. 😁 After all when the project is finished you'll have nothing more to learn from it and have to find another project.

  Are you sure? yes | no

K.C. Lee wrote 08/04/2019 at 16:37 point

Thanks for the tip.  :)

  Are you sure? yes | no

Ken Yap wrote 08/04/2019 at 00:33 point

Nice. I feel like a kid in a sweet shop. I notice that store charges shipping for some items and not for others. Will they combine ship items in an order? E.g. if I order something that costs $4 shipping and another that costs $3 shipping will I get charged $4 or $7 for shipping?

  Are you sure? yes | no

Thomas wrote 08/04/2019 at 06:29 point

Most shops won't combine orders. In many cases it's not even the seller that ships the product (-> dropshipping). I also wouldn't rule out that there are ways to actually earn money by collecting shipping cost subsidies.

  Are you sure? yes | no

Ken Yap wrote 08/04/2019 at 07:07 point

Ok thanks, will have to assess on an item to item basis then. There seems to be no rhyme or reason why some items have free shipping and others cost. As you say there is probably some subsidy of the cost from the shipping.

  Are you sure? yes | no

Ken Yap wrote 09/04/2019 at 21:57 point

I took the plunge last night; I signed up on AliExpress and bought some stuff last night. Interesting that the billing merchant was AliExpress AU, so it turned out to be a local transaction with no international conversion surcharge. I think I will be browsing their pages more often. 😁

  Are you sure? yes | no

Thomas wrote 09/06/2019 at 17:58 point

Many happy deliveries! :D

  Are you sure? yes | no

de∫hipu wrote 08/04/2019 at 10:44 point

Be careful with free shipping — it often uses the Yanwen mail, which for some reason simply stopped delivering anything this year.

  Are you sure? yes | no

Ken Yap wrote 08/04/2019 at 10:52 point

Ok, will factor that in. Currently another issue is how to pay. I'm a little uncomfortable with using an international CC, fraud protection and the fact that it's Aliexpress that holds the info notwithstanding. Currently looking at how to get onto Alipay. Also for if I want to tour China. Seems using cash outs you instantly as a tourist, even the street vendors take Alipay or Tenpay now. Talk about a cashless society.

  Are you sure? yes | no

de∫hipu wrote 08/04/2019 at 11:22 point

I have a prepaid credit card specially for all my Internet needs. I only put on it enough money for small payments.

  Are you sure? yes | no

Ken Yap wrote 08/04/2019 at 12:12 point

That seems to be a suggestion in the past but even prepaid DCs are waning in popularity here and they come with a load of condtions like recharge fees, expiry dates, in addition to their overheads.

  Are you sure? yes | no

Thomas wrote 08/05/2019 at 04:37 point

I see buying at AliExpress as a bet - always: you win a few, you loose a few.

It happens that I pick a dodgy seller, but that's rare. Besides, I've never had trouble getting my money back.

I know, this can be selection bias, but that also works both ways :-)

  Are you sure? yes | no

de∫hipu wrote 08/05/2019 at 08:47 point

Yes, it's always been a crap shoot, but now it seems to be something else — all packages that use Yanwen get lost in transit, even from previously good sellers.

  Are you sure? yes | no

Thomas wrote 08/06/2019 at 05:46 point

Interesting - maybe some destinations are worse than others? The one in this thread (Yanwen) took 2-3 weeks to arrive to Germany (including getting past customs).

Where do you live?

  Are you sure? yes | no

de∫hipu wrote 08/06/2019 at 08:01 point


  Are you sure? yes | no

Thomas wrote 08/06/2019 at 18:13 point

This appears to be more interesting than I expected. I guess that (bad)luck isn't a sufficient explanation for what some people have to tell (e.g. ). In my case, out of 100 orders maybe 5 didn't arrive, and I got refunds for all of them.

  Are you sure? yes | no

Thomas wrote 09/05/2019 at 05:07 point

The last 5 orders (the ones I ordered or expected while this thread was started) did all arrive). All of them offered "free shipping", were from Chinese sellers, and delivered to Germany by Yanwen. Could it be that there is a problem with their route to Switzerland or even one that's speciffc to your mail address record?

  Are you sure? yes | no

Ken Yap wrote 10/16/2019 at 00:55 point

I made a couple of orders from Aliexpress. One came by Yanwen, the other by China Post. The former went through Vietnam. Both arrived within 3-4 weeks but one had a slightly askew address for me, which my PO corrected. As I recall the form asked for the apartment number separately, which they then printed at the end of the street address contrary to the convention here. So maybe your address is causing non-delivery problems. Maybe edit it to make it as idiot-proof as possible.

  Are you sure? yes | no