EEVblog Electronics Community Forum
Electronics => Microcontrollers => Topic started by: rhodges on November 15, 2023, 01:04:05 am
-
A few may know that I have been using STM8S for a few years now, and sharing my code on github. After years of Z80, x86, 6809, PIC, and MIPS, I latched onto STM8 as a really nice architecture. And I liked the STM8 offerings.
Then I moved into STM32/ARM and enjoyed the minimal 32F030, the crusty 32F103, and the monster 32F407. I came to admire ARM as a worthy successor to MIPS.
Recently, I have been buying and using CH32V003. They are very cheap. And after scratching my head (wondering) about RISC-V, I think this is a great step in architecture. So my path goes this way.
One thing I admire about the STM8S is the super easy EEPROM and Flash access.
I guess I did not get to using the STM32 flash, so I did not hate it. Nor did I regret that my STM32 parts did not have EEPROM.
Let's get back to the CH32V003. Like the STM32 parts I had, this part has no EEPROM. And I have to erase large areas, either 64 or 1K bytes before writing. That is a bummer if I am storing settings that might change frequently. I will have to deal with that.
Now to the title. We have seen the CH32V003 chips priced well under 20 cents. And today I see the STM8S003 for less than 20 cents:
https://www.aliexpress.us/item/3256805848010706.html (https://www.aliexpress.us/item/3256805848010706.html)
Over the years, I have seen the STM8S for much higher prices. Maybe 60 cents at best?
Question for discussion: Is STM starting a price war to defend their STM8S against CH32V003?
-
Is STM starting a price war to defend their STM8S against CH32V003?
Unlikely, because the entire STM8 line is NRND and ST will likely stop making them in a few years.
Besides, I wouldn't take pricing from a random AliExpress seller as any kind of evidence of a manufacturer's pricing strategy.
-
Puya is 11 cents and uses arm cm0+ architecture, flash erase block size is 64 bytes so easy to use as EEPROM.
Stm32g030 will completely destroy those stm8s for 35 cent.
Stm8s are probably only used for existing, ancient designs.
-
Over the years, I have seen the STM8S for much higher prices. Maybe 60 cents at best?
Question for discussion: Is STM starting a price war to defend their STM8S against CH32V003?
STM8S were price leaders a long way back, they set the standard in the 20c space when others were still OTP, often with less code space.
Since then, many other vendors have copied the '003' pinout, with 8b and 32b cores, so there are now many choices.
Even STM seem confused, pushing a 32b MCU as a STM8 replacement (but their 32b MCU is 3V only, not wide Vcc). :palm:
A quick compare
STM8S003F3P6 TSSOP-20 1000+ US$0.3373 8KB 2.95V~5.5V STM8 1KB 16MHz 10b ADC 5Ch
STC8H1K08-36I-TSSOP20 3024+ US$0.1684 8KB 1.25KB 1.9V~5.5V 36MHz 10b ADC
STC8H1K08T-36I-TSSOP20 1008+ US$0.2705 8KB 1.25KB 1.9V~5.5V 36MHz 12b ADC 144MHz PWM
STC8H8K64U-45I-TSSOP20 1008+ US$0.2721 64kF 8kR 1.9V~5.5V FS-USB 45MHz 12b ADC
ie you can get wider supply range, better ADC, much higher PWM MHz and even HW-USB with 64KF and 8KR for a similar/lower price point ?
-
Stm32g030 will completely destroy those stm8s for 35 cent.
I might agree more, if the 32G series were not limited to 2V~3.6V.
These 20 pin MCUs are now generic, jelly bean level, why release a limited Vcc range ?
They should be like CMOS logic, wide Vcc and wide spread use.
-
Let's get back to the CH32V003. Like the STM32 parts I had, this part has no EEPROM. And I have to erase large areas, either 64 or 1K bytes before writing. That is a bummer if I am storing settings that might change frequently. I will have to deal with that.
How frequently?
Some uses might tolerate keeping the setting in RAM and checkpointing it to flash only ocassionally.
More robust would be to erase a relatively large region and then to use the same kind of scheme as used to update settings in OTP, overwriting old entries in a way that marks them as invalid, and doing a linear search for the most recent value for each setting. You might be able to tolerate the search every time, or you could load the settings into RAM on reset and use that as the primary reference. Then you only erase the flash region when successive updates have filled it.
-
Or use a small external EEPROM. Bummer yeah, that's one chip more. But price-wise, you can find a 32 Kbits EEPROM for about 2 cents in medium quantities.
-
...today I see the STM8S003 for less than 20 cents:
https://www.aliexpress.us/item/3256805848010706.html (https://www.aliexpress.us/item/3256805848010706.html)
Be carefull, some years back, before the pandemic, i ordered from a reputated AliExpress Seller, an amount of 40 pcs of STM8S103F3P6 at 0.14€ each (i've got a dmx controller design that uses this chip). What I received:
-14 STM8S103F2P6
-11 STM8S103F3P6 (the ones i ordered)
-13 STM8S003F2P6
- 1 STM8L151F3P6
- 1 IC whose surface was sanded or scratched, not even sure what to say regarding this IC.
They were packed in tape and reel, but they were obviously recycled crap, because every single IC had a different marking/serial. I refused to mount them to final boards due to lack of confidence (although the ones tested seemed to work fine, even then undocumented flash memory in the F2P6).
If you want something compatible with STM8S, being about 0.20€ each, with internal EEPROM (or maybe it's internal flash but with a program/erase granularity of 1 Byte, as in EEPROMS), take a look on the HK32F030MF4P6. Same pinout, same lack of DMA, and with 448 bytes EEPROM. The last version of the manual clarifies how to manage such EEPROM and it is quite simple.
Or as David said, the cheap 35ct STM32G030F6P6 makes the rest of 8 bitters MCUs bite the dust.
-
Now to the title. We have seen the CH32V003 chips priced well under 20 cents. And today I see the STM8S003 for less than 20 cents:
https://www.aliexpress.us/item/3256805848010706.html (https://www.aliexpress.us/item/3256805848010706.html)
I don't see the ST marking on the chip, are you sure it is legit ST?
-
Or as David said, the cheap 35ct STM32G030F6P6 makes the rest of 8 bitters MCUs bite the dust.
Nice thing of the STM8 is that it is 3.3 and 5V compatible.
-
Or as David said, the cheap 35ct STM32G030F6P6 makes the rest of 8 bitters MCUs bite the dust.
Nice thing of the STM8 is that it is 3.3 and 5V compatible.
Many cheap microcontrollers are.
For example the $0.10 (8 pin) to $0.14 (20 pin) CH32V003 previously mentioned in this thread runs on anything from 2.7 to 5.5 V. Same for ATTiny85, which I used a lot five years ago, but it's now far more expensive than WCH and Puya 32 bit MCUs with twice the flash and 4-6 times the RAM. Some others have been mentioned that run on 1.9 to 5.5 V.
-
If you want something compatible with STM8S, being about 0.20€ each, with internal EEPROM (or maybe it's internal flash but with a program/erase granularity of 1 Byte, as in EEPROMS), take a look on the HK32F030MF4P6. Same pinout, same lack of DMA, and with 448 bytes EEPROM. The last version of the manual clarifies how to manage such EEPROM and it is quite simple.
Not entirely compatible - doesn't run at 5V, only 1.8-3.6V. By the way, not to be confused with the HK32F030 (no 'M' suffix), as that is not pin-compatible to STM8S003.
There are many other STM8S003 pin-compatible (at least, for TSSOP20) Cortex-M0+ MCUs that are capable of running at 5V:
- Geehy APM32F003
- Zbit CX32L003
- HDSC HC32F003
- WHXY CW32F003
- MindMotion MM32F003
But none of them are a 100% drop-in replacement though, mainly due to the requirement for at least two pins for SWD (SWDIO/SWCLK) versus the one SWIM pin of the STM8. But the CH32V003 is 100% drop-in - I have done exactly that myself on one of my own designs. All I did was leave out the capacitor on the VCAP pin (CH32V003 doesn't need it).