At these sizes, the packaging is probably a significant fraction of the cost. They may also offer a bare die version at < $0.01 each.
Despite its name, this is not an 8051. Looks like this competes with the PIC10F200 which costs dozens of times more yet has a similar "RISC" (that's what they call it, but it's more like an 8-bit accumulator architecture) ISA and general layout.
Packaging is always a significant fraction of the cost. It can be 20-30% for a typical MCU part, and nearly half of the cost for a complex chiplet-based CPU (where the internal assembly is indeed complex). I suspect that manufacturer's profit margins are lower than that, especially for simpler MCU parts.
38kHz support for IR is a nifty feature (this is the "TV Remote" signal).
Its a real niche, this is probably the cheapest thing that can make a TV Remote. A couple of AA batteries and you'll have 5 years of life. Forget "sleep", a lot of TV Remotes just go fully off after each button press. When a button is pressed, reset the computer, figure out which button, send the IR signal at 38kHz and then turn off again. The end.
I see these $miniscule microcontrollers are being more or less the end of the road for ASIC's, apart from those that have high performance requirements.
Like you say - with 1kb "rom" and 48 whole bytes of ram you can make a TV remote, or the thing that debounces a switch, maybe something that decodes SP/DIF, control a battery charger, drive a vape ... all sorts of edge 'tasks' can become just one SKU and a couple of hundred bytes of code. Wild.
You consolidate support for different systems... much like how this chip has a dedicated 38kHz generator, other chips can have more flexible timers that support other frequencies, dedicated UARTs, USARTs, I2C, SPI that leads to better communication to other devices.
For example:
> control a battery charger
Okay, to make a battery charger requires:
1. Current measurement. Current measurement requires a shut-resistor (ex: 0.1Ohms) and an ADC. But the ADC needs to be able to measure micro-volts if you want any level of accuracy (1mA across 0.1 Ohms == 0.1mA aka 100uV of change) This is possible with either 16+ bit ADCs, or alternatively an ADC with x16 or more gain (effectively gaining "4-bits of zoom").
2. Alternatively, you can have Chopper/Instrumentation OpAmps that voltage-multiply the current shunt up to a level that your ADCs can see it. (Instrumentation OpAmps and Chopper OpAmps have low Bandwidth-Gain but very accurate zeros aka Voltage Offset statistics).
3. You'll need a high-speed dual-timer and XOR to implement PWM with dead-zones to control two MOSFETs to make your buck (or boost) converter. You can turn on the "low side" MOSFET at the same time as the high-side MOSFET otherwise you literally just short power to ground, a few microseconds of dead-time is all you need to keep things safe (and utilizing flywheel diodes for those brief microseconds is fine). Higher-speed Buck/boost converters (ex: 2MHz) are possible but a fundemental timer much higher than that. Ex: if you want 5-bits of control over the 2MHz PWM, you'll need a 64MHz timer.
4. 64MHz timers are possible with Phase-locked-loops that multiply your fundamental frequency (ex: an 8MHz base clock) to the much faster speeds.
------------
So if we're talking about the cheapest equipment that controls a battery charger effectively, in a flexible way that other people can use the tidbits, we'll need:
* 64MHz timers / PWM at the 64MHz speed. (~6-bits of control over 1MHz PWM... to implement a possible PID controller or maybe just PI controller (no-D needed??) )
* Current-measurement circuitry (ADCs at 16-bits and/or a 16x Gain ADC at 12-bits, or OpAmps)
* Complex enough timers to handle "dead time". This is not easy and is a rare feature in my experience.
* Analog Comparators to sense the voltage going into the battery and perform logic. ADCs could work in theory but a dedicated Analog Comparator is cheaper, easier, and more reliable.
* Ideally temperature control on-board, to provide safety.
RP2040 fails because it doesn't have accurate enough ADCs (thus requiring a 2nd or 3rd chip for the Instrumentation-Amp to amplify the current high enough).
There are a large variety of 8-bit chips that have powerful enough timers + powerful enough analog equipment to handle all of this BTW. STM32 cheats by just providing lots of OpAmps, as does TI's MSPM0 line. A lot of this stuff is quite easy with OpAmps actually.
There's a few PIC and AVR chips that have powerful enough timers as well.
----------
Yes, even something as simple as a battery charger has a surprising amount of logic for the buck/boost behavior. Its something you can do from scratch with a uC and Microcontroller though.
But traditionally speaking, you build such circuits out of transistors and OpAmps instead. Today's uCs have all the right stuff in the right places (IE: 3x free OpAmps on the TI MSPM0) that solve large sets of these problems.
It seems to use 1ma when on, so if you hooked this up to one of the larger smartphone batteries at 5000 mah, this could run for 200 days.
I'm not sure what you'd do with that, but I think as power consumption drops to 0 on these sorts of thing it might make some remote sensing applications cheaper/easier to deploy, if you could just deploy it with a battery and forget about it for a year or two.
1. I believe modern 8-bitters at 32kHz (yes: KHz. This is a very common wristwatch crystal and is the slowest you can run many chips....) use like 50uA.
2. If you take advantage of sleep states, it is possible to reach single-digit uA but this is difficult. Even the leakage currents of your capacitors (0.1uA to 10uA, depending on chemistry and conditions) starts to overwhelm your microcontroller.
3. Case in point. Internal leakage of most batteries is in the 1uA to 100uA range.
4. Alkaline (AA, AAA, AAA, and 9V) and CR2032 batteries are very very low leakage.
------
2 years might be on the easy side, especially if you use AA batteries. That way a 10uA leak isn't really that big a deal. This is aiming at a 150uA circuit or less which is fine.
With a bit of effort, it's not too hard to run a circuit for 5 years. But you do need to really watch the leakage currents and carefully design it. That's under 70uA with the AA batteries.
10years is probably pushing it even with an Alkaline or Lithium CR2032, but it's theoretically doable.
Isn’t that rather a lot of current for what it is?
I didn’t read the datasheet but I imagine it has to have a lower power mode than that. Much larger MCUs can manage an average power consumption far lower and power off the same battery for periods measured in years, not days.
This is simple enough you’d think you’d be able to power it off an EM field directly!
If you slow it down to 1MHz you can get it down to 0.5 ma. If you switch to low frequency oscillation at 32kHz it gets into low-double-digit microamps.
Yeah that's high, considering that a lot of 8-bitters are also in that ballpark and we haven't talked sleep states yet (with a few X00nA class sleepers out there).
In any case, Tomagachi is famously a 32kHz toy. There's a lot you can do at 32kHz.
I can understand how the material cost is low for such a tiny chip -- it said 337,000 of them fit on a wafer, but testing time must cost more than 1.5 cents per die.
Everything is automated. Testing a simple micro with few pins can be extremely fast.
Look up some modern factory tour videos. The RGB LED factory videos are interesting to watch. You can see how the bulk of the work is completely automated. Once the machines are set up, you let them run and collect the output.
My guess is that testing complexity is a function of the number of gates, so it doesnt matter too much if they are on a big die or many small dies.
Also testing is an extremly paralell process, scaling with the number of connections you can connect to the tested wafer, and recent technology(from testing hbm ram) can really scale that:
They probably don't test. Yield is likely high enough that failures are the responsibility of the customer.
Honestly, this is where I'd love RISC-V to be making inroads. It would be really nice to have a super simple processor with a standard architecture and tooling.
Yeah, that's a savage bastard too. 48MHz, DMA, UART, I2C, SPI, a sleep mode ... 16KB flash and 2KB ram. Certainly enough to run something with a UI, probably enough to implement a basic software defined radio, could probably do some neat tricks when buried inside a USB cable.
I mean, clearly we're at the "splash the cash" end of the Chinese processor market here but at least you get good bang for buck.
Yes but... modern 8051 has grossly different peripherals / drivers than the original.
Most of your code / effort will be in getting these peripherals to work. A ton of microcontroller programming is a simple if(voltage>0.5V) then {setup peripherals to do Y}.
In fact, voltage > 0.5V is a peripheral (aka: the Analog Comparator + DAC loopback) on most uCs today. So in practice its:
"If (analog comparator) then {do Y}".
Except "if analog comparator" is itself an interrupt that you put into the interrupt table, so that the processor can sleep for minimum power usage. So really its all just configuration of interrupt table handlers, configuration of various peripherals, and then a massive amounts of sleep.
The Pine Ox64, The Milk-V duo and the RPI packages are all interesting products (at a sub 10 bucks each).
The MILK-V duo S is very appealing (form factor wise). If they ever mange to get POE/HDMI in version out it will be a killer product (even more so if they get all that into a sub 20 buck price point).
The 48 bytes of sram are enough to encode several state machines. It has pwm and dedicated IR signalling output, but no ADC for input.
It's generally designed to be a very simple controller-of-things. Push an up button, increase the pwm output up to some limit, etc. remote controls, fans, etc.,
Indeed. I've seen a retail toy use a similar microcontroller from Nyquest to accept infrared control commands and drive some H-bridge drivers to make a simple, cheap RC car.
The page linked to buy the product say 10 pieces in stock, and 'not recomended for new designs'.
Following the link in that page to manufacturer and then to 'microcontroller units' shows 14 products, all 'not recomended for new designs', except for the ones with zero stock.
It's an 8-bit processor running at up to 20Mhz. Maybe an Apple-II would be a comparison. Likely the 6502 had a more powerful instruction set. Apple II had a 1Mhz 6502.
This chip:
8 MHz, 8 bit processing
1K x 14 bits EPROM.
48 bytes SRAM.
6 general purpose I/O pins (GPIO), PB[5:0], with independent direction control.
In comparison to the usual suspects like Apollo guidance computer or TI-83, it has a higher clock speed but shorter word length and extremely limited ram and memory. Precisely due to the cost engineering - this is meant to run simple, limited size programs.
The 8051, first released in 1980, the 8051 effectively created the microcontroller market. 4kB ROM and 128B of SRAM for the original 8051. It always was on the small side.
---------
We have to go earlier than 1980 but I'm not quite familiar with all of those computers.
Despite its name, this is not an 8051. Looks like this competes with the PIC10F200 which costs dozens of times more yet has a similar "RISC" (that's what they call it, but it's more like an 8-bit accumulator architecture) ISA and general layout.