It Came from Mainland China: Bootleg MCS-251 "32-Bit 8051" - Page 1
Forum section: electronics / general

author: Dass347
author_rank: Newbie
timestamp: May 02, 2024, 11:33:21 pm
content: In my spare time trawling for weird Chinese microcontrollers on Aliexpress, I came across this thing claiming to be a "32-Bit 8051":" alt="" class="bbc_img" />So I thought "why not?" and ordered a few of them. Looking through the Internet, there's barely any information on them anywhere, and the datasheet is only in Chinese. However, it seems that they're a clone of Intel's MCS-251 microcontrollers from the 1990's, but with lower cycle counts for instructions, and better peripherals.After I got them in the mail, I wrangled with them for about a week, going through translation shenanigans and wacky software. After working with them for a little bit, I'd have to say that they'revery quirky, but also very capable as well once all the many, many, many kinks are worked through. Currently, I have it talking to a MAX7456, and everything is going smoothly. Obviously, these things aren't suitable for anything commercial, but as a hobbyist they might be an AVR killer for me.I was wondering if anyone here has worked with these weird little things before, or had any thoughts on them.

author: amyk
author_rank: Super Contributor
timestamp: May 03, 2024, 01:48:14 am
content: STC have been making 8051s for a long time, so that's not surprising, but they also have an ARM-based series that starts with STC32F. There's also stuff like this from other companies:https://www.eevblog.com/forum/microcontrollers/whats-this-8051-clone/Chinese MCU market is really weird.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 03, 2024, 01:57:08 am
content: AFAIK, the STC32 parts currently have only single tool chain support - needing Keil C251 to code.I've been more tracking their sibling parts, the STC8H family, which use standard 8051 tools.https://www.stcai.com/cp_stc8hxleg the STC8H8K64U part is their first with hard-coded USB, and comes down to SO16 in size.It's a challenge keeping up with the details, as they seem to upgrade things with every sub-family spin.Thus the newer STC8H2K8U (STC8H2K12U, STC8H2K17U) has better PWM than the parent STC8H8K64U, and the very new STC8H2K32U (STC8H2K24U,STC8H2K16U), has an improved 32b ALU block,https://www.stcaimcu.com/forum.php?mod=viewthread&tid=5721mentions STC8H32K64U

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 03, 2024, 03:21:13 am
content: Quote from: Dass347 on May 02, 2024, 11:33:21 pmYes, the STC8H parts have moved the '1T' 8051 space.Previously, most 8051 1T parts were 1 cycle per byte, makes sense as they historically fetch a byte at a time.The latest STC parts improved that with wider fetch, to have even 2 & 3-byte opcodes execute in 1T, it is only branch opcodes that need more than 1T, if taken.Addit : this was Posted yesterday at 10:09 :STC8H2K32U -45I-LQFP32, has been put on the WeChat store for sale , just found ithttps://www.stcaimcu.com/forum.php?mod=viewthread&tid=7762STC8H2K32U -45MHz- LQFP32 , QFN32, TSSOP28/20 HW USB , true 12-bit ADC , RTC , 144MHz - PWM supports hardware phase shiftMDU32C , CRC16 , serial port reception timeout , hardware parity checkThe MDU32C looks interesting, but for some strange reason, they have R4-7 = R4-7+R0-3, (3cy) whereas the slight change to R0-3 = R0-3+R4-7 would have allowed a simple DDS loop ??

author: Dass347
author_rank: Newbie
timestamp: May 03, 2024, 11:28:28 am
content: QuoteYup, and Keil is terrible, too. The assembler and linker needed a bunch of weird prodding to actually produce .hex files mapped onto the expanded MCS-251 address space, otherwise anything outside of the traditional 64K of 8051 address space is thrown out without any warning or error. I imagine that Keil C251 was just developed out of Keil C51, hence the weird behavior.Also, Keil C251 requires a roughly ~$3,000 license to make programs larger than 2 kilobytes. After some Baidu searches, it looked like what happened was that an illegal key generator was released in 2020, essentially unlocking the software, and then the development of the MCS-251 clones started.QuoteThe interesting thing about this is that although the STC32G parts are faster overall due to being 32-bits, some traditional 8051 instructions takelongeron the STC32G than the 8-bit STC8H parts." alt="" class="bbc_img" />

author: DavidAlfa
author_rank: Super Contributor
timestamp: May 03, 2024, 01:11:44 pm
content: No thanks, such a prehistoric architecture!Poor docs, barely any compilers or toolchains...Give me a much better documented and efficient arm or riscv mcu!

author: Postal2
author_rank: Frequent Contributor
timestamp: May 03, 2024, 05:19:20 pm
content: Quote from: Dass347 on May 03, 2024, 11:28:28 amI'm using it. It's working.

author: iMo
author_rank: Super Contributor
timestamp: May 04, 2024, 09:34:35 am
content: Do the dev chains support double precision floating point (incl. printf)??

author: radiolistener
author_rank: Super Contributor
timestamp: May 04, 2024, 04:48:18 pm
content: I don't like 51 cores, this an ancient era architecture. I understand that they using it because it is more cheap for production than branded chips like STM32, but in my opinion this is a crap and should be avoided to use.

author: coppice
author_rank: Super Contributor
timestamp: May 04, 2024, 05:02:23 pm
content: Quote from: amyk on May 03, 2024, 01:48:14 amThere's nothing weird about making 8051s in China. Its changing a little now, with the rise of ARM, RISC/V, and more complex applications, but China produced hundreds of thousands of people trained in programming 8051s in assembly language. If you wanted fresh grads be up and running quickly with your silicon then for a long time you put an 8051 core in it. If you tried to sell them a small MCU, having anything but an 8051 core used to count against you.You get interesting dynamics in their market, based on design ins generally being for big volume production. For example some MCU needed only a $50 JTAG gadget for development, while a chip from NEC required a big $10k tool to talk to the chip. Which was the economic solution for the customer in China? Why, the NEC option, of course. They save $50, because the NEC tool is so darned expensive nobody is going to buy it, and NEC had to hand them out for free on long term (i.e. permanent) loan.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 05, 2024, 01:06:15 am
content: Quote from: radiolistener on May 04, 2024, 04:48:18 pmIt's a silicon chip, 'crap' claims are subjective. If it does the job, and is easy to apply, why not use it ?The 8051 is like the logic chip end of MCUs, and many are cheaper than logic chips.You will also find it is rare to see a new 8051 that is not wide supply, as they have avery broadinterface level deployment.You could also claim 74xx logic is 'ancient era architecture', but they are still sold in shiploads.

author: radiolistener
author_rank: Super Contributor
timestamp: May 05, 2024, 05:32:16 am
content: Quote from: PCB.Wiz on May 05, 2024, 01:06:15 amCheaper - yes.Easier - no.Modern 32-bit ARM with JTAG/SWD is much more easy and sweet in debugging and more easy to code.

author: coppice
author_rank: Super Contributor
timestamp: May 05, 2024, 06:07:47 pm
content: Quote from: radiolistener on May 05, 2024, 05:32:16 amThat's true of an actual 8051, but most devices with an 8051 core in 2024 are just as easy to work with as an ARM. For the kinds of application most 8051 based devices go into the bit twiddling focussed instruction set of the 8051 suits the problem quite well, and people get productive writing assembly code for it quite quickly.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 05, 2024, 10:41:15 pm
content: Out of curiosity, I took a look at the datasheet - only chinese though. Couldn't really find anything about the architecture, but I'm guessing they have just cloned the MCS-251.In terms of peripherals, it seems to have pretty much what you'd expect in a modern MCU. More or less. It just has very little RAM.Is cost really the factor here (how cheap can it be, when small RlSC-V 32-bit MCUs can be found for about 10 cents?) Maybe it's even cheaper though? But their existence is just due to the fact there is a market for MCS-251 replacements, which is... interesting.

author: IOsetting
author_rank: Regular Contributor
timestamp: May 06, 2024, 12:13:07 am
content: Quote from: SiliconWizard on May 05, 2024, 10:41:15 pmGood question, no, they are not cheaper. 8-bit MCUs are losing their shares fast as more affordable RISC-V and Cortex-M0 chips are flooding the market after the pandemic.IMHO, putting the bets on MCS-251 is a joke.

author: Postal2
author_rank: Frequent Contributor
timestamp: May 06, 2024, 12:57:53 am
content: Most popular chip for Hi-Speed USB is FX2LP. 8051 is inside of it. Any programmer was forced to use it, prefer or not. As a result, 8051 is well-known and easy to program. Example:https://www.eevblog.com/forum/programming/atmel-maxtouch-bridge/

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 06, 2024, 06:59:12 am
content: Quote from: Postal2 on May 06, 2024, 12:57:53 amYes, I've used the FX1 and FX2 in the past, which were handy and low-cost when nothing of the sort was really available anyway. FTDI started to gain traction, but the FX1 was more flexible than their FT245 and FTDI didn't come up with a USB HS (that the FX2 supports) until pretty late (around 2007-2008 IIRC) with the FT2232H. So, we didn't have tons of choice.I used SDCC for the C compiler, which gave us better results than Keil at the time.The reason the 8051 core was relatively popular in early 2000's is that it went into public domain if I'm not mistaken, so vendors didn't have to spend a dime on licenses.This is probably one reason there are still such chinese MCUs. Obviously now with RISC-V, most chinese vendors seem to turn to RISC-V rather than obsolete ISAs.

author: coppice
author_rank: Super Contributor
timestamp: May 06, 2024, 03:57:31 pm
content: Quote from: Postal2 on May 06, 2024, 12:57:53 amThe 8051 core was a huge hit with most USB chip makers in the days before USB3. Most of the USB chips sold as essentially fixed function have an 8051 core in them.

author: Postal2
author_rank: Frequent Contributor
timestamp: May 06, 2024, 05:36:02 pm
content: Quote from: SiliconWizard on May 06, 2024, 06:59:12 amFX2LP is more flexible than FT2232H. Good driver on PC-side. I will try to use his driver for CH32V307.

author: Dass347
author_rank: Newbie
timestamp: May 10, 2024, 01:56:33 am
content: Quote from: radiolistener on May 04, 2024, 04:48:18 pmIt sure is, but it's interesting crap.Here's a copy of the STC32G datasheet I ran through Google Translate.There's some graphical issues with it, so it helps to look at it alongside the original Chinese datasheet.While STC has published newer versions since, I've been too lazy to dice up a copy of the Chinese datasheet and run it through Google Translate a second time. I don't think the revisions have been major, but I'm not 100% sure.The STC32G April 1st datasheet in Chinese:https://drive.proton.me/urls/2Q7AR1TEN8#NRsdsx7shtIqThe Google Translate English version of it:https://drive.proton.me/urls/FJP87GB9ZR#8WTHykn75WHkI also want to note that I tried DeepL as well, but it had a nasty habit of randomly inserting extra blank pages, breaking the page number equivalency with the Chinese datasheet.

author: Plan9
author_rank: Newbie
timestamp: June 03, 2024, 05:23:21 am
content: Hey folks,I've been digging into the so-called "32-bit 8051" and wanted to share my findings with y'all. Turns out, this ain't some brand new, wacky product like many people think. Way back in 2010, Evatronix was already selling "32-bit 8051" IP (depending on whether you consider a 32-bit ALU = 32-bit processor, which many don't, AFAIK). Some Chinese posts from around 2014 suggest that STC might've used 8051 IP from either Evatronix or CAST (Evatronix sold enhanced 8051 and "32-bit 80251" IP, while CAST actually sold Evatronix's IP - you can see this in CAST's press releases): R8051XC / R80251XC.Now, IP vendors gotta keep customer info strictly confidential, or else they'd go belly up. Well, Evatronix actually did go under in 2013, selling themselves to Cadence (due to low profits, not data leaks, of course). Unfortunately, this caused some issues, with all the IP core datasheets getting deleted (they should really be called Product Briefs, since they don't have a ton of details). But, lucky for us, we've got Archive.org to the rescue! Some of the info has been recovered. If anyone's curious about the enhanced 32-bit 80251, you can check it out, including the Evatronix's 80251 IP datasheet and Design Specification.Interestingly, this IP core does have similar DhryStone performance to the STC32 (Evatronix's manual claims up to 0.39 DMIPS/Mhz, while Chinese engineers measured the STC32 at 0.38DMIPS/Mhz). Other similar publicly sold 80251 IP cores, like the CAST S80251XC3 at 0.655 and DQ80251 at 0.70759, have a pretty big gap compared to this data. It's definitely intriguing that STC shows such close DhryStone performance.Let me know what you guys think!Evatronix R80251XC Datasheet, From archive.org ：https://web.archive.org/web/20111029064753/http://evatronix-ip.com/32-bit-8051/category/1-pierwsza-kategoriaEvatronix R80251XC Design Specification, From archive.org ：https://archive.org/details/r80251xc-design-specification/Dhrystone performance test of STC32G12K128, From Whycan Forum:https://whycan-com.translate.goog/t_7945.html?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp