What Is This Project?

STC Arduino Core is an open-source Arduino core that brings modern C++ support to the STC8 microcontroller — for the first time in the 8051's 40-year history.

Write your sketch in C++ just like any other Arduino board, hit upload, and it runs on a chip that costs less than $1.

No special programmer. No proprietary IDE. No stripped-down C compiler from 2003. Just the Arduino IDE you already know, with the full expressive power of C++ — classes, templates, the standard library — backed by GCC, one of the most mature compilers in existence.

Under the hood, this is made possible by running a RISC-V emulator (rv51) on the STC8 itself, bridging a 40-year toolchain gap with a single clever layer of abstraction.

Why This Project Exists

The 8051 microcontroller architecture has been around since 1980, and despite remaining incredibly popular — especially in low-cost Asian markets — it has never received proper modern C++ toolchain support. Existing compilers are either proprietary, outdated, or severely limited. The STC8, one of the most capable and affordable modern 8051 derivatives (often under $1), deserved better.

How It Works

Rather than writing a new compiler from scratch, this project takes a different approach: it runs a RISC-V emulator (rv51) directly on the STC8 hardware. This allows the chip to execute RISC-V instructions at runtime, which means we can leverage the entire mature GCC toolchain — GCC 13.4.0 specifically — to compile standard Arduino sketches targeting RISC-V, then have them run on an 8051.

The result is a fully functional Arduino core where:

  • You write standard Arduino C++ code
  • GCC compiles it to RISC-V bytecode
  • rv51 executes that bytecode on the STC8 at runtime
  • Upload happens directly over USB — no serial adapter, no external programmer

What Makes the STC8 Special

The STC8 series improves significantly on the classic 8051 — faster execution, more peripherals, built-in USB support, and a price point that makes it ideal for high-volume or budget-conscious projects. It's widely used in consumer electronics manufactured in China, yet largely invisible to the Western hobbyist community due to the lack of English toolchain support.

Current Status

The core is functional and under active development. Supported features include digital I/O, delays, USB serial, and basic Arduino API compatibility. Performance is naturally constrained by the emulation layer, but for many embedded use cases it is more than sufficient.

Who This Is For

  • Hackers who want to experiment with ultra-cheap hardware
  • Educators teaching embedded systems on a tight budget
  • Engineers already using STC8 in production who want a better development experience
  • Anyone curious about ISA emulation as a portability strategy