STC 8051 MCUs: yay or nay? - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: October 22, 2016, 06:14:09 pm
content: A lot of folks here (in China) are suggesting me to take a look at STC 8051 MCUs. What is your opinions on those chips?I grabbed a starter kit for those chips (either 2 chips or the minimum order amount, so I can have a backup chip to play with if I let the smoke out of one of them) But because those chips are so cheap my starter kit included 6x IAP15F2K61S2 (supports OCD, 2x DIP-40, 2x DIP28, 2x low-voltage DIP-40,) 2x IAP15W4K61S4 (supports OCD, DIP-40,) 10x IAP15W413AS (5x DIP-20, 5x DIP-16) and 5x IAP15W105 (DIP-8)So far to me...* Their chips are cheap. Almost ridiculously cheap. The cheapest chip STC15W100 (512 bytes Flash ROM, 128 bytes RAM, no EEPROM, next to no peripheral, SO-8 package) costs 15 US cents. While the most expensive IAP15W4K61S4 (61kB unified Flash ROM, 4kB RAM, OCD, tons of goodies built in, DIP-40 package) still cost less than a dollar.* They are locally produced in TSMC fab in Shanghai.* They do not follow the traditional 8051 pinout.* Selectable quasi-bidirectional, push-pull, or open-drain/high impedence pin modes.* Not all models comes with on-chip debug, but for the ones that have OCD (often highest-end IAP models in their respective lines, like IAP15F2K61S2 or IAP15W4K61S4) the debug feature uses normal UART0 pins (while UART0 itself can be multiplexed onto other pins so still useable.) OCD is only available if you are using Keil uVision IDE.* Normal UART0 pins are also used for ICSP using some kind of UART-based protocol, even for those chips that does not have built-in UART.* Models start with STC implements strict Harvard architecture, usually with some built-in data Flash ROM in its own memory space. Strangely MOVC instruction can also be used to read from data Flash, by adding an offset to the address.* Models start with IAP implements a modified Harvard architecture with unified program/data Flash ROM instead of dedicated data Flash ROM, with the same address in data Flash ROM space mapping to the same address in program memory space, and RW access using the same EEPROM registers.* Lots of on-chip goodies especially on those bigger chips like IAP15W4K61S4 or IAP15F2K61S2. Some peripherals are even located in XRAM.Their model names for STC15 series are fairly simple to decode though.* model-name = prefix + "15" + voltage + RAM + program Flash + additional features + "-" + package* prefix = "STC" for normal chips, "IAP" for ones with unified program/data Flash ROM, "IRC" for ones with unified Flash and cannot use external reset* voltage = "F" for 5V, "L" for 3.3V, "W" for wide 2.7-5.5V operation.* RAM = "1" = 128B, "2" = 256B, "4" = 512B, "1K" = 1kB, "2K" = 2kB, "4K" = 4kB* program flash = program Flash (for STC15) or unified Flash (for IAP/IRC15) space in kBI am exploring those chips using their flagship chip and writing up my experiences. You can read it if you are interested:https://en.maxchan.info/tag/stc

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 22, 2016, 06:36:31 pm
content: "cheapest MCU" is a frequent topic here - I'm sure plenty of people would be interested to see your experiences with them

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 22, 2016, 06:38:17 pm
content: Interesting snippets from their datasheet :QuoteQuote..well apart from that 8051 core...

author: technix
author_rank: Super Contributor
timestamp: October 22, 2016, 07:02:22 pm
content: Quote from: mikeselectricstuff on October 22, 2016, 06:38:17 pmFrom what I have heard that they designed their own core, only kept the 8051 ISA intact as it is really old and not patent encumbered.

author: danadak
author_rank: Super Contributor
timestamp: October 22, 2016, 08:40:44 pm
content: If its dirtball low end penny stuff there are a number of vendors thatcan meet that.Cypress has an 8051 core in their PSOC stuff, capabilities look like -For me what stands out is -1) Routability2) Fast 12 bit SAR A/D and slow 20 bit DelSig3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFBcan be used as a GP fast processor block, sililiar to RISC block4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGAlike capability5) Onboard Vref6) DAC, IDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....7) LCDCOM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE9) Custom components capability10) DMA to offload processes like filters11) ARM M0 or M3 or 8051 core12) Extensive clock generation capabilitieshttps://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=truehttp://www.cypress.com/documentation/code-examples/psoc-345-code-examplesGreat video libraryAttached component list. A component is a HW onchip resource.Free GUI design tool with schematic capture, "Creator". Components have rich API library attachedto each componentThis is low end of family, consider 5LP parts as well. PSOC also has arduino footprint boards (pioneer) as wellhttps://www.elektormagazine.com/labs/robot-build-with-cypress-psochttp://www.cypress.com/products/32-bit-arm-cortex-m-psocBut these are not 25 cent chips. They do have ARM M0 based PSOC parts that get << $ 1 though.Regards, Dana.

author: westfw
author_rank: Super Contributor
timestamp: October 22, 2016, 11:05:17 pm
content: Quote12 cycle core or something newer?

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 23, 2016, 12:04:51 am
content: Datasheet says 1 clock per machine cyclehttp://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC15-English.pdffirst time I've seen prices in a datasheet..!

author: janekm
author_rank: Unknown
timestamp: October 23, 2016, 03:57:43 am
content: ST are competing heavily against STC in the Chinese market (are the names a coincidence?) by practically price-dumping on the STM8 range of chips.STM8S003F3P6 gets advertised at under 1RMB, volume pricing might be slightly lower still.And that's a much more modern, "sensible" design than the STC51 as far as I can see, with all the modern peripherals you'd expect, even 10bit ADC, of course on chip debugging, UART, I2C, SPI, ...The cheapest model has 1KB of RAM and 8KB of Flash.BTW I see the STM8 line much more commonly used on really low-cost Chinese products (like 10RMB LED controllers etc) than the STC line.

author: technix
author_rank: Super Contributor
timestamp: October 23, 2016, 04:19:57 am
content: Quote from: blueskull on October 23, 2016, 04:06:28 amAgreed. At least in my school courses involving microcontrollers are designed around STC chips.

author: nctnico
author_rank: Super Contributor
timestamp: October 23, 2016, 10:24:14 am
content: IMHO using a low cost 8051 base MCU makes only sense in very high volume chips nowadays. If you count in the extra engineering time to get around the 8051 limitations the suddenly they aren't so cheap. Going for cheap parts often leads to needing a lot of (unforeseen) engineering time.

author: janekm
author_rank: Unknown
timestamp: October 23, 2016, 10:34:43 am
content: Sure, the needs of universities are very different than the needs of industry. It's all about what's convenient for the professors (who are probably more familiar with 8051 in the first place). And I see a lot of dev kits around STC51 which sure look like they're intended for universities or similar educational environments:https://detail.tmall.com/item.htm?spm=a230r.1.14.203.iOyNpp&id=36522460231&ns=1&abbucket=13But for industry it's a whole other story. I just had a quick look around my desk and here's a few PCBs coming out of different low-cost electronic items designed by Chinese companies.There's the LED controller PCB, a Qi wireless charger (I have a different model that also uses STM8), a dev board (ok that's cheating), a simple transparent serial over radio module, and a formaldehyde sensor (using STM32, a little over-kill there). That LED controller costs 15.5RMB including enclosure and remote control (the package markings are lasered off but the pinout matches STM8S003 including the internal LDO bypass cap). The radio module is 7RMB.I haven't yet seen an STC51 in a shipping product (though it's possible that some rub off the package markings, I suppose).So if you want to learn what's actually used in industry, I'd suggest STM8 or STM32. I've never seen MSP430 used in a Chinese product either.

author: gamalot
author_rank: Super Contributor
timestamp: October 23, 2016, 11:00:37 am
content: I don't like either their products, their website, or their boss.

author: nctnico
author_rank: Super Contributor
timestamp: October 23, 2016, 11:17:44 am
content: Quote from: janekm on October 23, 2016, 10:34:43 amIMHO that is not a good starting point for selecting something. You need to select something which fits your application, abilities/skills and budget. Oh, and I have seen an MSP430 in a Chinese product.

author: janekm
author_rank: Unknown
timestamp: October 23, 2016, 11:40:20 am
content: Quote from: nctnico on October 23, 2016, 11:17:44 amWell I stand corrected on the MSP430 thenI don't like to recommend them as I had some bad experiences around low power modes and part availability but that's a topic for another day, perhaps. They're pretty dead for new designs anyway since even TI is putting ARM cores into their new designs.Sure, for choosing a part for a new design the criteria are different. But if you have a really low budget and need a jelly-bean micro STM8 is worth looking at.For learning purposes of course ARM is the obvious choice. And STM32 and NRF51 are also crazy cheap (but still at least 3x the cost of STM8).

author: coppice
author_rank: Super Contributor
timestamp: October 23, 2016, 12:16:48 pm
content: Quote from: janekm on October 23, 2016, 11:40:20 amTI is still very much developing new MSP430 parts, especially FRAM parts. Some are specifically targeted at the China market, which has always been a pretty good market for the MSP430.

author: technix
author_rank: Super Contributor
timestamp: October 23, 2016, 02:51:38 pm
content: Quote from: janekm on October 23, 2016, 10:34:43 amWhen you buy STC chips in bulk you can get whatever you like be lasered on it. And if the amount is large enough you can even get custom pinouts (e.g. IAP15F2K61S2-35I-SKDIP28 in ATmega328P-20PU compatible pinout, IAP15W4K61S4-30I-PDIP40 in AT89C51RC-24PU compatible pinout, or even IAP15L2K61S2-35I-LQFP48 in STM32F103CBT6-compatible pinout.)

author: technix
author_rank: Super Contributor
timestamp: October 23, 2016, 02:58:19 pm
content: Quote from: westfw on October 22, 2016, 11:05:17 pmThey have the 6-cycle STC89/90 series (which comes with an selectable built-in 2x prescaler to emulate 12-cycle timing) and their custom core in STC11/12/15 series that have variable cycle count (1-cycle best case, 6 cycle worst case for hardware division) for each instruction. I am talking about the newer STC15 line here.

author: technix
author_rank: Super Contributor
timestamp: October 24, 2016, 07:26:19 am
content: Quote from: coppice on October 23, 2016, 12:16:48 pmIn my school MSP430G2 LaunchPads are handed out like candy to frequent visitors of the professor's lab. I got one with MSP430G2553 on it after my 6th visit of the week, even though I am not a member of his team.The post-grads there tells me that I should explore outside AVR (myentire microcontroller experience back then was only AVR) so they gave me this as a kickstarter for something other than that. I took that suggestion in heart and started looking around for different architectures for my projects, and start writing application code that works across all platforms. Although I have already set up shop for AVR, PIC and ARM (STM32) platforms, the MSP430 LaunchPad somehow never really worked...

author: technix
author_rank: Super Contributor
timestamp: October 24, 2016, 07:50:02 am
content: Quote from: blueskull on October 24, 2016, 07:33:44 amI never got it to actually work. MSPGCC+CCS fares better than IAR - IAR refuses to work outright but CCS at least can build and single step the built-in example code. My senior project had an ATmega328P on it, with code written using Arduino IDE and have the Optiboot bootloader.I always used code like this as a sanity check of a platform, as it is easy to understand yet it is non-trivial:Code:#include "system.h"int main(void){systick_init();DDRB |= _BV(4);for (;;){PORTB ^= _BV(4);delay(500);}}and the Arduino-style timing functions being implemented using timer interrupts. I have working code for AVR (any system clock frequency, using timer 0,) PIC (any system clock frequency, using timer 1,) ARM Cortex-M3 (any system clock frequency, using SysTick timer) and semi-working code for 8051 (any system clock frequency, using timer 0, passed under AT89C51RC@24MHz but failed under IAP15W4K61S4@30MHz.) I have yet to got it to work under MSP430, and how do I make MSP430G2553 run off external 16MHz or 24MHz crystal?

author: coppice
author_rank: Super Contributor
timestamp: October 24, 2016, 08:23:19 am
content: Quote from: technix on October 24, 2016, 07:50:02 amA MSP430 launchpad connected to a PC running IAR is about the easiest development platform to get running in the entire industry. If you could get MSPGCC and CCS to work I assume your hardware was not faulty. Were you using one of the cracked copies of IAR which make the rounds in China? Some of those give trouble with some MSP430 devices.Quote from: technix on October 24, 2016, 07:50:02 amYou can't get an MSP430G2553 to run at 24MHz. They only function up to 16MHz. If I remember correctly that device doesn't have the optional fast crystal oscillator. It only has a 32kHz crystal oscillator. You get fast clock rates from the internal DCO. Using a fast crystal generally defeats most of the ultra low power qualities of the MSP430, so few users actually want such an oscillator.

author: coppice
author_rank: Super Contributor
timestamp: October 24, 2016, 08:45:15 am
content: Quote from: blueskull on October 24, 2016, 08:31:18 amThe original MSPGCC worked very well. The current MSPGCC, based on a new port TI paid RedHat to produce, still produces poorer code than the old MSPGCC. This is really sad, as GCC is capable of so much better.

author: technix
author_rank: Super Contributor
timestamp: October 24, 2016, 08:56:50 am
content: Quote from: coppice on October 24, 2016, 08:23:19 amI pulled my copy of IAR off their website (painstakingly - SLOW!!) so I believe it is okay.If I run my 2553 off the DCO @ 16MHz, how can I get a low tempco timing source?

author: coppice
author_rank: Super Contributor
timestamp: October 24, 2016, 10:26:56 am
content: Quote from: technix on October 24, 2016, 08:56:50 amYou can regularly recalibrate the DCO against a 32kHz crystal. There is at least one TI app note about doing that. You will never get super accurate results, as you can with the FLL in, say, the MSP430F4xx parts, but you can get sufficient stability for a wide range of applications.

author: technix
author_rank: Super Contributor
timestamp: October 24, 2016, 12:48:07 pm
content: Quote from: coppice on October 24, 2016, 10:26:56 amCan I run the timer for millis() and delay() off the 32768Hz clock? I can live without micros() and delayMicrosecond() on smaller chips that implements simpler functionalities, and on bigger chips there will be a high frequency clock available.

author: technix
author_rank: Super Contributor
timestamp: October 26, 2016, 04:00:24 am
content: Quote from: janekm on October 23, 2016, 03:57:43 amHowever there aren't too many teaching material out there targeting STM8 in China...

author: janekm
author_rank: Unknown
timestamp: October 27, 2016, 03:09:56 am
content: Quote from: technix on October 26, 2016, 04:00:24 amI just spent literally 30s looking for that, and I don't even read Chinese, and came across this dev board with 81 hoursof video tutorials, and many PDFs of documentation... Seems like that could keep you busy for a while? It does look more targeted to the needs of industry, with topics like "how to connect to CAN bus" "how to connect to LCD display" etc. But I'd be pretty happy if dev boards came with that kind of documentation in Englishhttps://item.taobao.com/item.htm?spm=a230r.1.14.62.EPMNum&id=531379008661&ns=1&abbucket=13#detailAlso ST have big teams of sales / app engineers in China, which may go part way to explaining the ubiquity of their chips.

author: coppice
author_rank: Super Contributor
timestamp: October 27, 2016, 03:40:44 am
content: Quote from: blueskull on October 26, 2016, 04:02:57 amSTM's promotion of STM32 in China is more visible than their promotion of other product lines, but STM has serious support for all its MCUs in China. In fact, some of its MCUs barely have any visibility outside China.

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 05:37:53 am
content: Quote from: coppice on October 27, 2016, 03:40:44 amAt least in my university the EE department uses a lot of STC 8051 while the CS department uses a lot of STM32.

author: zapzapouch
author_rank: Contributor
timestamp: October 18, 2021, 08:24:31 pm
content: STC websites likehttps://www.stcmcudata.com/keep being blocked for malware. I tried downloading their tools months ago and had these problems, and now I'm trying again and still having them. Looks like the culprit ishttp://www.stcmicro.com/rar/Keilv802.rar?This is the file that you need to use STC MCUs with Keil µVision, correct?VirusTotal still says it's bad:https://www.virustotal.com/gui/file/5127b7bb4886a232127e0fe9b02656e8fe46d01a31c0b6017e9b835bddae223aThe website says 防止被杀毒软件误报错 = "Prevents errors from being mistakenly reported by antivirus software". o_OAre these not the IC manufacturer's official websites?I downloaded the file, but I'm not touching it unless I can figure out why it's being flagged as malicious.

author: wraper
author_rank: Unknown
timestamp: October 18, 2021, 08:35:56 pm
content: Quote from: zapzapouch on October 18, 2021, 08:24:31 pmIt doesn't. All that it shows seems to be some false positives from heuristic analysis of mostly bottom of the barrel antiviruses. Not actual virus signature detection.

author: WattsThat
author_rank: Frequent Contributor
timestamp: October 18, 2021, 10:19:41 pm
content: Professionally, I have written tons of 8080 and Z80 assembler for industrial control in 80’s and 90’s, never used an 8051 so I felt like I missed a piece of history. When I discovered the cheap Chinese LED clock kits used the STC 15 series parts, I decided it was time to learn and so I wrote my own version of firmware for the clocks from scratch for fun, it’s one of several versions available on Github.Started out with the bootleg Kiel stuff, which worked well but I didn’t like using it. Switched to SDCC without problem. I never found any buggie peripherals but I was only using the timers and uarts. The stuff just works. My only complaint would be the limited English based documentation and that all the demo programs, of which there are many, are about 95% commented in Chinese.Would I use it for a product? No. But, that wasn’t the goal. If I had to do it over again, would I change anything? Probably not. But, if I had done it 10-15 years ago, it would have been a different result. What I learned was that the 8051 was a pretty limited machine. Not quite as pea-brained as the 8008 but it was a close second.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 18, 2021, 11:41:17 pm
content: I used Cypress FX1 and FX2, something like 15 years ago. For flexible and cheap USB interfacing, that was good enough. Used SDCC with them. A lot of limitations though. Back then, there was not a lot of options, at least at this price point and as flexible.These days, I wouldn't touch them anymore. There are more MCUs with USB than we can imagine, at various price points. No reason to bother with 8051-based stuff anymore IMO. But the FX2 still finds its way in relatively recent products. I guess one benefit is that it's still cheap for USB 2.0 HS, and it has a FIFO interface.

author: nctnico
author_rank: Super Contributor
timestamp: October 18, 2021, 11:47:04 pm
content: Quote from: wraper on October 18, 2021, 08:35:56 pmRecently I had a similar incident with my website as well. False positive for a self installing software packageIf you don't respond then the domain authority will disable your entire domain. The idiots running the scan service (Netcraft in this case) appearantly treat any installer as a potential virus

author: voltsandjolts
author_rank: Unknown
timestamp: October 19, 2021, 12:07:57 pm
content: https://www.stcmicro.com/rar/STC actually have a copy of the Keil C51 compiler in their downloads section, with the crack tool included.So professional.

author: zapzapouch
author_rank: Contributor
timestamp: October 19, 2021, 07:59:12 pm
content: Quote from: wraper on October 18, 2021, 08:35:56 pmMalwarebytes detects malware, too.Quote from: voltsandjolts on October 19, 2021, 12:07:57 pmIt looks like the Keil_lic_v2.exe crack is the file that triggers theMalware.Heuristic. So it's just triggered because it modifies unrelated system files or something?I guess this isn't the .rar file I actually need, though, if I already have a legit copy of Keil C51.This pagedescribes the process of adding it to Keil, which is actually done with the stc-ispX.XX.zip files. (Those get flagged as malware, too, but by fewer engines...)stc-isp-15xx-v6.88I.zip"3 security vendors flagged this file as malicious"stc-isp-15xx-v6.88I-tiny.zip"2 security vendors flagged this file as malicious"Edit:Malwarebytes and Avast didn't have a problem with stc-isp-15xx-v6.88I-tiny.zip, so I ran it, but then Avast had a problem with it. "Anti-Exploit shield".Oh, it may just be from the software trying to contactwww.stcmcudata.comwhich is on URL:Blacklist.But that file doesn't seem to include the Keil modifications. The other one does? But that one asks for administrator permissions,also gets flagged as malware by a few engines, and includes instructions for modifying your system to allow drivers without signatures."由于 Windows10 64 位操作系统在默认状态下，对于没有数字签名的驱动程序是不能安装成功的。所以在安装 STC-USB 驱动前，需要按照如下步骤，暂时跳过数字签名，即可顺利安装成功。""Since Windows 10 64-bit operating systems by default cannot be installed as a driver without a digital signature forTherefore, before installing the STC-USB driver, you need to follow the steps below to skip the digital signature for the time being, so that you can install it without any problems."'电脑重启后，会弹出“启动设置”界面，按“F7”按钮来选择“禁止驱动程序强制签名”项''After the computer reboots, the "Startup Settings" screen will pop up, press the "F7" button to select the "Disable driver forced signature" item'I've never seen any other embedded development software that requires all this...

author: wraper
author_rank: Unknown
timestamp: October 19, 2021, 08:42:41 pm
content: QuoteThey did not bother to submit the driver to Microsoft for validation (and pay for it). That's why it asks to enable win 10 test mode which allows unsigned drivers to run.

author: Mark19960
author_rank: Regular Contributor
timestamp: October 22, 2021, 07:15:01 am
content: I tried to get their development bits.. ICSP etc.It didn't pan out.They responded and told me how much it cost but when I wanted to buy it things went silent.I still would like to take a crack at them. They only wanted 30 USD for it which is totally reasonable.