
The “terrible” 3 cent MCU – a short survey of sub $0.10 microcontrollers - jerryr
https://cpldcpu.wordpress.com/2019/08/12/the-terrible-3-cent-mcu/
======
dbcurtis
These have their uses.

A friend who frequently does contract development in the toy space has (or at
least used to have) a favorite go-to MCU that costs under $0.06 in bare die.
It is essentially a 6502 with 100 bytes of RAM and a metric butt-load of mask-
programmable ROM. It was originally designed for greeting cards. He has
designed it into toys.

It is hard to use, you need a dev kit and a good relationship with the
distributor to get the documentation. It only makes sense in high-volume
products, since it comes as passivated bare die so assembly requires a die-
bonder and expoxy encapsulation depositer.

Not for everyday use. But as my friend says: “You haven’t lived until you have
spent an entire afternoon arguing over $0.05 on the BOM.”

~~~
benj111
"metric butt-load of mask-programmable ROM"

What would that be in this context? I'm guessing we're talking KB rather than
TB?

~~~
vardump
I'd guess about 1 MB order of magnitude. That would be a butt-load even for
samples.

1 MB would be enough for 45 seconds audio at 8 bit PCM @22 kHz. If they're
half competent, they could use ADPCM or much better (and cheaper to decode
too!) vector quantization.

With VQ, you could go even down to ~1 bits (~6 minutes of audio per megabyte)
per sample while maintaining good audio quality. Decoding is very simple, so
6502 would have plenty of oomph to do that.

~~~
childintime
> [Vector quantization] Decoding is very simple.

Do you have an encoder/decoder to point us to?

~~~
vardump
VQ is a very well known technique. For something quick, you might be
interested to check this blog post about (unmodified) C64 playing high quality
audio at 44.1/48 kHz, VQ compressed down to 96-128 kbit/s:
[https://brokenbytes.blogspot.com/2018/03/a-48khz-digital-
mus...](https://brokenbytes.blogspot.com/2018/03/a-48khz-digital-music-player-
for.html)

There's some decoder code there as well.

------
mastax
Some Philips sonicare toothbrushes use(d) a _4-bit_ microcontroller from an
obscure Swiss company. (From memory, since I can't find the EEVBlog video
teardown) 52 bytes of RAM, custom size mask ROM, ? Kilohertz clock speed. It
makes sense, they just needed a timer for the "2 minutes of brushing is up"
feature, and maybe some battery management. It still surprised me that it was
worth the hassle to save a few cents, even if they sell millions of the
things. They must make insane margins: $80 for a vibration motor and $25 brush
refills.

~~~
ska
It's pretty easy to make the hassle worthwhile, if you are selling
(particularly many) millions of things. Even saving a dime on BOM for a
million units shipped will pay an engineer year, roughly.

I still remember a friend relating with a mixture of horror and fondness that
in 15 years probably the biggest impact he ever had to the bottom line of [big
computer manufacturer no longer in existence] was re-routing a PCB in a way
that let them make it smaller with no functional change. The materials cost
savings over product lifetime was in the 7-8 figures range, he claimed.

~~~
pkaye
A product I was working on had different variants based on what parts are
populated. There were config resistors to help route the signals based on what
was populated. I replaced that all with a simple software lookup table in
firmware to reroute the signals correctly. Furthermore I figured out how to
auto-detect the dozens of supported configurations on first bootup. The PCBs
were very small so I made the board designers job a lot easier due to
eliminated resistors. The factory folks were thrilled that they didn't have to
manage the jumpers.

~~~
sitkack
I would hire you. These techniques should be applied pervasively.

Could you write a guide? I would buy it.

~~~
pkaye
Thanks for the kind praises. Unfortunately I'm not much of a writer though I
have lots of interesting experiences that I tell my friends and coworkers.

A big part of how I'm today is due to my boss at that time. One of the most
brilliant engineers I worked it. He also gave us a lot of time and freedom to
think of these kind of approaches. Sadly these days a lot of companies are
always in a rush so one can't think things through properly.

------
ChuckMcM
It is interesting that its possible to produce chips at this price for more
than a short time period. Also that they are all basically PIC clones or
variants speaks to the core competency of these companies is manufacturing and
operational efficiency, not MCU design.

I think a fascinating experiment here would be to invest some time in an
unencumbered scalable design that could be implemented very inexpensively (say
less than 10K gates). Would these manufacturers pick up that design and run
with it, making variants and parts that people could buy? It would get
Microchip off their back (several have been sued apparently).

~~~
joezydeco
I would think a lot of manufacturers are looking to RISC-V for that kind of
eventuality. But in the meantime, and looking at that chart, it seems a lot
more convenient to just rip off the PIC.

~~~
monocasa
I don't think a RISC-V would fit in this gate count niche. Just the register
file for an RV32-C core is half these chips' RAM.

~~~
ywfmotc
Yes, the PICs don't have a register file at all. They also have quite a simple
instruction set, again providing gate savings, but then the size of program
ROM may be a bit larger as a result.

The ALU can be a reasonable chunk of the processor size, and an 8-bit ALU is
going to be much smaller than a RISCV ALU. Although I read somewhere that some
of the Z80s, although an 8-bit processor, had a 4-bit ALU, and also I read
somewhere that the 32-bit NIOS processor has a 16-bit ALU. But whether that's
true or not ...

I designed a size optimised 16-bit MSP430 clone for small size low cost
machxo3 FPGAs that used an 8-bit ALU. It a good way of keeping the number of
LUTs down when optimising for size over speed.

For something like the low cost ice40 FPGAs, a PIC would probably be a very
good match for those too compared to RISCV, because ice40 doesn't have
distributed memory, which is what you'd like for register files (otherwise I
expect one of the block RAMs would be used for the register file, and ideally
you wouldn't want that to happen).

------
tluyben2
When getting into a project, I usually work with someone in the hardware
design space (I can do larger electronics myself and thus prototypes, but I'm
hired for very small circuit projects) and after creating a prototype, we
usually start searching for the the cheapest MCU (and other components) that
fit the project. Spending a lot of time doing assembly and making it fit the
constrained memory _will_ pay off when doing million factory runs. A lot of
MCU's I work with are faster (or only marginally slower) than my beloved Z80 I
grew up with an programmed many years, but usually have less (sometimes far
less) memory. I have not worked with kilohertz since the early 80s but he, if
it fits (it almost never does) I am all for the lowest priced and power
friendly MCUs I can find.

~~~
stevekemp
It's funny but I've been driving a Z80 with an arduino-mega recently, and I
actually timed it for the first time a couple of days ago. I'm getting 6000
clock-cycles a second. 6Khz, rather than that 6Mhz it would be cable of
running standalone.

~~~
kristianp
Why is it so slow?

~~~
stevekemp
Mostly because I'm doing a lot of manual work reading/writing to the
address/data-bus and there is some overhead in the code I've got for emulating
RAM & I/O code.

It should be faster, and could be if I reworked it. But I'm mostly using the
arduino as a crutch right now until I get hooked up to real driving circuitry
so I'm not overly concerned.

------
the-dude
Around the year 2000, a PIC 12C508A was about 1 Dutch guilder @ 5000 pcs.

Today, Mouser lists 1 pcs @ € 0,908, 100 pcs @ € 0,863.

The guilder/€ is 2,20371 ( muscle memory ).

The MCUs in the article are 12C508A class, one is an actual clone.

So for ~ € 0,80 at quantity, the 12C508A currently costs about 1.75 guilder.
20 years later.

~~~
childintime
I wonder how much of Microchip revenue is from old chips at very profitable
prices.

I did a Digikey comparison once, and Microchip alone provided roughly 30% of
all MCUs on digikey. It has, for example, an incredible 175 MCU models with
exactly 64B of RAM, 1.75KB of ROM and just 5 I/Os.

~~~
zokier
That is just combinatorial explosion of fairly small number of features. I
took a peek at the example you provided, and drilling down there seems to be
for example 39 SKUs for PIC12x615 chip:

* Two voltage options (although why on earth do they need 2-5.5 and 2-5 separately?)

* Two main packaging options: tape and tube, and tape is furthermore available as full reel, digireel, and cut tape

* Three different temperature ratings

* Five different device packages from tiny 3x3mm DFN to full-sized DIP

So already from these fairly simple options you get total of 2x4x3x5 = 120
different combinations for essentially the same chip. So they don't quite have
all the combinations, but there are few outlier options and overall the
combination coverage is pretty wide which explains the inflated SKU count. I'm
not sure what conclusions can be drawn from this exercise besides that
Microchip seem to be willing to provide their chips exactly as customer wants
them.

------
firethief
> They address a specific category of low-cost, high volume, non-serviceable
> products with limited functionality. You need to wait for the push of a
> button and then let an LED flash exactly five times? You need to control a
> battery-operated night light? The sub $0.10 MCU is your friend to reduce BOM
> and shorten development time.

If you're allergic to 555s, I guess?

~~~
throwaway2048
These are cheaper than 555s, more easily available in various footprints, need
almost no supporting passive circuity or glue logic, lower power usage, and
more flexible to boot.

Popularity of the 555 waned a long, long time ago.

~~~
thaeli
More accurate timers, too. It's bizarre to think that "program a
microcontroller" is actually cheaper - even in small quantity - than the 555
designs I remember building as a kid.

(In single quantities from LCSC the cheapest 555 is $0.07 and the cheapest
Paduak microcontroller is $0.04 - in quantity the 555 is $0.04 and the Paduak
is $0.025. Plus fewer support passives with the Paduak.)

------
Havoc
>Due to lack of programming tools and evaluation boards I was only able to
review most devices by datasheet

hmm. Well I don't blame the author but that kinda killed my interest

~~~
rtpg
I wonder what the lowest-priced chip you can pick up with a reasonable
toolchain that is accessible to hobbyists?

~~~
hazeii
PIC10F200 in 8 pin DIP is about 41 pence (~50 cents) in 1-off here in the UK;
great for quick hacks (e.g. I just used one as a 60KHz clock generator). The
IDE is free, works on Windows/Linux/Mac and there's an online version too.

------
gumby
You would be surprised by the places sub-$1 mcus appear, even down to a dime.
Car manufactures use them all over the place, even ECUs(at least until
recently; I'm no longer "in the biz"). Yes, shaving a few pennies from the BOM
of a $30K device is still worth doing when you produce them in huge volume.

------
zokier
The top end padauk ("PFS173") actually seems pretty reasonable chip,
comparable to bottom end attinys with only quarter of the price.

~~~
howard941
After I got over being spoiled by ARMs I fell for Padauk's stuff which I now
think are awesome and makes almost everything that leaves the building a
candidate for a micro. It breaks the old rules where you had to have a certain
level of complexity in the product to justify using a processor. Their stuff
are economical replacements for discrete logic and a no brainer for the
ubiquitous ADC->serial use cases.

My hardware guy came on really heavy against the Padauk stuff because it was
put to me that the temperature range wasn't wide enough particularly at the
high end where supposedly we had to operate at 125C. I actually think attinys
made it in the design instead of the Padauks just because of personal
preference and an unwillingness to share the project rather than
unavailability in automotive temp range.

So the tubes of Padauks and a pair of ICEs I brought in so it would be very
easy to play with sit unused and I am now at a different place that places
more emphasis on what all of the engineers think rather than just whoever
happened to draw the long straw for the project.

------
kabdib
I wrote code for a MCU that did power sequencing on a consumer product. 4K of
code, 2K of RAM, some EEPROM, a 16Mhz clock . . . 18 cents.

It was a fun little project:
[http://www.dadhacker.com/blog/?p=1911](http://www.dadhacker.com/blog/?p=1911)

------
kristianp
Sounds like the size where forth code might be used. Anyone done that?

