Friday, May 10, 2013

The 8051 won't die... will it?

The 8051 8-bit MCU architecture was introduced, by Intel, in 1980. It is still in wide production by at least a half dozen vendors (including my fave -- Silabs) at prices as low as a half a buck.  My current favorite is the C8051F988 (currently used as the brains behind my sensor nodes). This MCU costs about $1.60 (for low volume purchases) and is essentially an 8-bit SoC.

The C8051F988 comes in a couple of packages, one of which is hand solderable. It requires no additional passive components (an internal oscillator can run at 25Mhz), but I usually throw a capacitor on the power supply pin and a 4K resistor pulls up the RST line.  It has a mere 512 bytes of RAM and 4K of flash (a beefier version can be had for around 1 dollar more). I program it in Charley Shattuck's MyForth, so the memory doesn't feel so constrained.

The C8051F988 has an ADC, internal temperature sensor, a UART, SPI, I2C, etc.  It executes 70% of its instructions in 1 or 2 clock cycles.

Here is the power specs (from the datasheet):

Ultra Low Power Consumption
- 150 µA/MHz in active mode (24.5 MHz clock)
- 2 µs wakeup time
- 10 nA sleep mode with memory retention
- 50 nA sleep mode with brownout detector
- 300 nA sleep mode with LFO
- 600 nA sleep mode with external crystal
I'm impressed. But, of course, why bother with this when an ARM Cortex blows it away? (Ultra low power consumption 32 bitters are starting to arrive.)

A couple of things keep me interested in this chip (and other 8051 variants), and that gets us to what this blog post is about.

First, look at the part count: For under $2 (hobbyist pricing): the 8051 chip, an (ebay provided) SOP board, a resistor and a capacitor.  I have the old Silabs serial ec2 programmer (for initial flashing of a forth bootloader) and use Silabs free programmer under Linux WINE.  No ARM I know of has this simplicity.

Second, and most interestingly, the 8051 architecture doesn't seem to want to die.  Its a relatively simple chip (low gate count) and can be easily implemented as an FPGA core.  When you want to do simple things, it is very handy. It is built into *everything*: Keyboards, microwaves, the new Bluetooth LE chips (like the popular TI CC254x chips).

Start taking stuff apart and you are likely to run into an 8051.

They don't want to die. Somewhere there are engineers who sniff at the new 32-bit Cortex M series (meant to replace those old 8-bit 8051/AVR/etc processors) and then get their job done with assembly or C code that has run solid for the past 30+ years.

2 comments:

Anonymous said...

Just watned to say that I enjoy these posts a lot. Thanks for doing these! - Coming from an 18 year old student.

Todd Coram said...

Thanks. I try to keep it interesting ;-)