Exploring STC MCU Part 1 – The chips

It seem to me that there are some interest in ultra cheap microcontrollers. The Chinese brand STC makes a few 8051-compatible MCU which sells at ridiculously cheap prices.

Since they are cheap, I grabbed a few to experiment with. The “a few” – 2 each unless there is a minimum order amount greater than that – turned out to be a good stash of chips, and this entire order costd me $15, shipping from Shenzhen included: (weird as those are made in Shanghai, but they don’t have a store front here.)

STC microcontrollers with unified Flash for both code and data.
STC microcontrollers with unified Flash for both code and data.
  • 2x IAP15W4K61S4-30I-PDIP40
  • 2x IAP15F2K61S2-28I-PDIP40
  • 2x IAP15L2K61S2-28I-PDIP40
  • 2x IAP15F2K61S2-35I-SKDIP28
  • 5x IAP15W413AS-35I-DIP20
  • 5x IAP15W413AS-35I-DIP16
  • 5x IAP15W105-35I-DIP8

Those IAP-prefixed STC chips implemented a modified Harvard architecture: while it is binary compatible with traditional 8051 architecture, the data Flash access registers can access the entire internal code (or in this case, unified) Flash space. (while the ones with STC prefix have semi-separated program and data Flash address spaces.)

STC OCD chips
STC chips with unified Flash and on-chip debug capability.

All STC chips requires in-system programming using their proprietary protocol and tool that is Windows-only, and their Visual Basic 6 code are so broken that it won’t even work under Wine if you are UNIX person. The bright side is that the required hardware is simply a serial connection (you can, in fact, bypass their so-called programmer hardware entirely and use your usual USB to Serial module.) ISP uses the usual UART0 pins P3.0 and P3.1 regardless of the existence of UART hardware. But UART0 itself, if exist, can be multiplexed to other pins, so the hardware can still be used. The IAP chips with 2K or more RAM also comes with on-chip debug feature using the in-system program interface. This on-chip debug also uses their in-system program interface and only works with Keil uVision IDE. Since I hate simulators this is going to be my way stepping through the code and figure out what is going on.

If you are trying to get the chips or the tools, be aware that their website is noisy and ad-heavy.

Experiment setup

Most of the experiments in this series will be attempted on this chip, clocked at 30MHz.
Most of the experiments in this series will be attempted on this chip, clocked at 30MHz.

For the experiments I have the same basic setup:

  • IAP15W4K61S4-30I-PDIP40 clocked at 3024MHz
  • STC U8W-Mini ISP/ICD probe connected to P3.0/P3.1 as the ISP/OCD interface.
  • USB to Serial adapter connected to P3.6/P3.7 as the UART0 interface.
  • Reset button for entering ISP mode
  • LED on P2.7 through a MOSFET.

2 thoughts on “Exploring STC MCU Part 1 – The chips”

    1. First off, I am Chinese, there is this symbolic patriotism involved. Second, what made you think you should rely on this brand?

      I have checked the STM8 line. They cost about the same as those 8051s here if not slightly more (keep in mind that SMT packages are cheaper than DIP even though the silicon is the same inside,) but they are not available in PDIP packages (prevents easy prototyping) and not really readily available in the city I live in.

Leave a Reply