Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ok, this got me curious, how much have things changed for low-end embedded microcontrollers?

Some numbers from a few minutes of searching:

- Then: Intel 8021: 1 kB ROM, 64 B RAM, 11MHz, about $.40-.50 in 2024 dollars

- Now: ATtiny25: 1kB ROM, 128 B of RAM, 20 MHz, maybe $.70-$.80 each for a huge order

Not sure if this is the right comparison, and I'm sure there are lots of other differences that the topline numbers don't capture and that I don't know about (e.g, power consumption, instruction set, package size, etc. etc.)



An ATtiny really isn't good value for money, except when looking for something simple to use.

The CH32V003 is $.10-$.20, quite usable in my experience and features a 16 kB ROM, 2 kB RAM and a 32-bit 48 MHz RISC-V.

The PMS150 is available for <$.05 with ~1.5 kB ROM, 60 B RAM and an 8-bit 8 MHz CPU.

If you're excluding chinese manufacturers, the STM32G030 is sub-$.80 in quantity for 32 kBs of ROM, 8 kBs of RAM and a 32-bit 64 MHz ARM CPU.


which is to say, an MMU to run a full blown operating system, and not a small C program with some interrupt handlers.


none of these have mmus, even the stm32g030 is a cortex-m0+


dang. thanks for the correction. Looks like the cheapest chip with an MMU is the Allwinner F1C100S which is $2.20 in quantity.


happy to explore with you!

mmus are a performance hack; they make your memory-protected code run faster than if you use a jit compiler that inserts memory bounds checks. but suppose running code that way costs you a factor of 10× in performance. so maybe your 30-dhrystone-mips processor (https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU..., say, or https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU... for 2×) performs roughly like a 3 dhrystone mips processor. if we believe https://netlib.org/performance/html/dhrystone.data.col0.html that's roughly the performance of a sun 3/160, an amiga 2000, or a 40 megahertz amd clone 80386 pc (though much slower than an intel 386)

that's much faster than many multiuser machines i've used

the promise of java (and oberon) was that such large runtime overhead would be unnecessary with better static checking, and j2me and oberon seem to have largely borne that out

the bigger issue is i think that cheap microcontrollers don't have much ram or off-chip bandwidth. if you want a megabyte on-chip, you end up with things like https://www.digikey.com/en/products/detail/stmicroelectronic... (a 480-megahertz cortex-m7 with 128 kibibytes of flash and a mebibyte of ram for usd11.27), https://www.digikey.com/en/products/detail/infineon-technolo... (a dual-core 150-megahertz cortex-m0+ with 2 mebibytes of flash and a mebibyte of ram for usd12.92), https://www.digikey.com/en/products/detail/nxp-usa-inc/MIMXR... (a 600-megahertz cortex-m7 using external program memory and a mebibyte of ram for usd14.48), or https://www.digikey.com/en/products/detail/renesas-electroni... (a 240-megahertz renesas rx72n with 4 mebibytes of flash and a mebibyte of ram for usd20.85)

i'm pretty sure none of these have mmus either but i forget the rx architecture

a whole esp32 module like https://www.lcsc.com/product-detail/Development-Boards-Kits_... is cheaper and has more ram though. that one has 8 megs of psram and costs usd4.93


You might want to check out The Amazing $1 Microcontroller [1] which explores multiple microcontrollers that could be had for less than $1 (when buying a hundred of them) in 2020. I haven't checked how much the prices have dropped since (if at all) but it could still be a good starting point when looking for parts at the 8021's price range.

[1] https://jaycarlson.net/microcontrollers/


all the following prices are for "under 100 dollars" quantities

https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU... 1.5¢, 32 kibibytes in-application-programmable flash, 4 kibibytes sram, 48 megahertz, nearly 1 32-bit arm instruction per clock

https://jlcpcb.com/partdetail/NyquestTech-NY8A051H/C5143390 1.58¢, 1 kibiword otp prom, 48 bytes of ram, 20 megahertz, nearly 1 8-bit pic16-like instruction per clock, english datasheet https://www.nyquest.com.tw/upload/2024_02_293/NY8A051H_v1.6....

https://www.lcsc.com/product-detail/Microcontroller-Units-MC... 10.5¢, 1 kibiword otp prom, 60 bytes ram, two hardware threads ('fppa') context-switching every cycle so you can get better real-time response, 16 megahertz, nearly 1 8-bit instruction per clock. english datasheet https://www.padauk.com.tw/upload/doc/PMC251%20datasheet%20V0...

https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU... 8.7¢, 20 kibibytes flash, 3 kibibytes ram, 24 megahertz, nearly 1 32-bit arm instruction per clock. english datasheet https://download.py32.org/Datasheet/en/PY32F002A%C2%A0datash...

https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU... 12.45¢, 16 kibibytes of flash, 2 kibibytes sram, 24 megahertz, nearly 1 32-bit risc-v (rv32ec) instruction per clock

these are generally much lower power than the 8021, but really the place to look for power consumption is ambiq; these are all conventional cmos rather than the subthreshold logic ambiq uses

they also incorporate a lot more peripherals


i thought i'd check out the 8021 to see how big the difference is. it's bigger than i imagined

https://en.m.wikipedia.org/wiki/Intel_MCS-48 says it's a cut-down 8048. the 8048 itself has a max clock speed 11 megahertz, 15 clocks per machine cycle, with about 70% of instructions taking one machine cycle, 30% taking two, for about half a mip. not vax mips, tho, an 8-bit mip. there's a manual for the chip family at https://manualsdump.com/en/download/manuals/intel-mcs-48/253...

the biggest omission is that they cut it down from 28 to 21 i/o pins and eliminated interrupts, which would be a big loss in a modern microcontroller, but it was nmos rather than cmos, so you're looking at unholy power consumption anyway; 40 milliamps (typ., p. 192/478 (6-49)) at 5 volts is 200 milliwatts. but they also cut the clock speed, the minimal machine cycle time on the 8021 is listed as 10 μs (with a 3 megahertz crystal) rather than the 8048's 2.5μs or the 8049's 1.36μs. so you get 0.07 8-bit mips. it uses dynamic logic and dynamic ram to save space so you can't clock it at less than 20% of that, so you can't do low-power sleep, ever

they also omitted the subtract instruction, which the 8048 doesn't have either. i guess you can use cpl, inc, add. (i see that what the manual suggests is cpl, add, cpl.) there's enough space for multiply and divide subroutines but they ain't gonna be fast

also, you can forget about programming an 8021's program memory. it's mask-programmable only; you have to do your test programming on an 8748 before you place your order with intel for a batch of 8021s with a custom silicon mask encoding your 1024 bytes of already tested and debugged firmware. so those 42-cent∆ prices were necessarily in rather large batches. the 8051 and 8048/8049 had an 'ea' pin you can pull high to get it to execute code from external memory instead, but i don't think the 8021 did; the manual says, "no external rom expansion capability is provided."

0.07 8-bit mips is about 0.005 dhrystone mips, although i think the 8021 is too small to run dhrystone. the cypress chip i linked above is about 60 dhrystone mips at 48 megahertz, so about 12000 times faster, for about a 25× lower price. it also has 4096 bytes of ram instead of 64 (16×), 32 kibibytes of nonvolatile program memory instead of 1 (32×), plus 8 kibibytes of rom, and you can program the flash in-application (i.e., under the control of the program it's running). it has a hardware multiplier, which is about a 10× additional speedup for dsp type stuff. in deep sleep it uses 2.5μamps. at full speed it's a bit of a power hog by current standards, slurping a hefty 13 milliamps (at 1.8 volts if you like, so 23 milliwatts, almost ⅛ the 8021, but if you're in deep sleep most of the time you can go another 5000× lower). and it's 1.6mm×2mm. and you can program it in c. it has only 9 gpio pins, though!

despite nominally being a psoc the cypress chip has no analog peripherals, not even a comparator. it does have internal oscillators (with no external components), pwm generation, i2c, spi, uart, and quadrature input, and its gpio pins have seven drive strength modes

so depending on whether cpu speed or memory space is the bigger bottleneck for your application, price/performance has improved between 400× and 300000× since the 8021. for things that were constrained by battery life or reprogrammability, the difference isn't quantitative, it's just that the 8021 couldn't do the job at all

in the metric of interest to hopper, though, which was computers per buck rather than mips per buck, it's only about 25× better than then

______

https://data.bls.gov/cgi-bin/cpicalc.pl?cost1=.13&year1=1982... says 42¢




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: