Nyquest NY8A051H – 1.5 cent microcontroller: weekend die-shot
zeptobars.com
zeptobars.com
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.
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.
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.
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.
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!
In any case, Tomagachi is famously a 32kHz toy. There's a lot you can do at 32kHz.
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.
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.
> Honestly, this is where I'd love RISC-V to be making inroads
A 32-bit CPU is way too big for this price point still.
Not sure what you mean by "this price point" but CH32V003 is RISC-V and around 10 cents. It is only 6 times more expensive.
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.
Pragmatically speaking, that architecture already exists -- it's the 8051. (This part is a PIC clone, but 8051 is also extremely common.)
RISC-V has promise for larger microcontrollers, but really tiny ones like these (48 bytes RAM, 1KB ROM) are better off with an 8-bit architecture.
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 RPI2040 is under a buck in bulk (the chip).
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).
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.
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:
https://www.formfactor.com/applications/high-volume-test-on-...
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.,
https://cpldcpu.wordpress.com/2019/09/28/a-led-candle-based-...
https://cdn.hackaday.io/images/9838991700773145118.file-1700...
https://cpldcpu.wordpress.com/2024/05/02/machine-learning-mn...
Toys, like a house which blinks lights and plays tinny music when a button is pressed (as long as speech / complex sounds atr bot involved)
Remote control toys (with external transceiver)
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.
https://en.wikipedia.org/wiki/MCS-51
ny8a051h
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.
---------
We have to go earlier than 1980 but I'm not quite familiar with all of those computers.
Or it can be done via laser, scanning the wafer and burning the fuses.