12 ms·
I love it. I have noted this article for my talk about how CPUs are free. To appreciate that, you have to understand that when the first microcomputers came out
by ChuckMcM 3y ago
I love it. I have noted this article for my talk about how CPUs are free. To appreciate that, you have to understand that when the first microcomputers came out engineers were still in "compute" mode[1], we were lectured that you wouldn't use a hard coded loop to check for a switch closure, you had to use interrupts because otherwise you were wasting all those CPU clocks. And computing at the time was often billed in weird units like "kilocoreseconds" (which is the number of seconds * the number of 1024 word pages of core (RAM)) that were consumed when your program ran.
The logical extreme end of Moore's law was that you could put a CPU into a very, very small amount of silicon and that meant they were essentially free. (Chips cost by die area & layers). Another article like this is Bunnie Huang's discussion of the ARM CPU in flash chips[2].
There have always been jokes that it is cheaper/easier to use an 8 pin uController than it is to use a 555 timer, and the argument has often come down to the current and voltage ranges that a 555 can work under are different, but at some point I expect to finally see the "blending" of analog/digital chips that allow for a wide range of voltages (on board switching PMIC), and analog pins that have few if any compromises for being either digital or analog.
[1] The Chip Letter -- https://thechipletter.substack.com/p/tiny-computers-from-texas https://thechipletter.substack.com/p/tiny-computers-from-tex...
[2] On Hacking MicroSD Cards -- https://www.bunniestudios.com/blog/?p=3554 https://www.bunniestudios.com/blog/?p=3554
- crote 3y ago> at some point I expect to finally see the "blending" of analog/digital chips that allow for a wide range of voltages The irony is that the developments which made dirt-cheap MCUs possible have at the same time basically ruled this out. Digital logic is almost trivial to scale down. With Moore's Law the compute core itself is indeed becoming basically free. However, IO does not scale down: modern chips have far fewer analog pins, far lower current limits, lower voltages, and are increasingly sensitive to ESD & over-voltage events. An ATmega32u4 from 2008 is designed to operate on 5V, can handle 40mA per pin, and has 13 analog pins. It's rather sturdy and can take quite a beating. On the other hand, the RP2040 from 2022 runs on 1.1V, although IO is 3.3V. It can only handle 12mA per pin, which a chip total of 50mA. It has only 4 analog pins, which lack a lot of protection present on the digital pins. Basically, you'll damage it if you look at it funny. I think it's best summarized by a somewhat-recent change in the USB 2.0 specification: originally the data pins were supposed to handle a 24-hour short to 5V without any issues. This requirement was dropped because such a short is incredibly rare in practice, and dropping that single requirement led to 16% reduction in silicon area for the transceiver and a 3x standby power reduction. In today's world of ever-shrinking transistors, dealing with (relatively) high voltages and analog voltages is getting more and more expensive.
- ChuckMcM 3y agoI don't disagree at all, this analysis is spot on. The size of discretes on silicon has not shrunk nearly as much as it has for transistors. However, where I am coming from is that because the transistors have shrunk so dramatically it becomes possible to put an entire CPU in the "left over" space after you've placed the discretes. There was a talk at either Hot Chips or ISSC in 2011? about a mixed mode chip where the die was 2/3rds analog parts and 1/3 digital part. Xilinx, the FPGA maker, came out with the "RF SOC" which has a "huge" analog section with multiple high speed ADCs and DACs and analog reference logic, plus and FPGA fabric, plus a quad-core AARch64 CPU. As I recall Cypress had something similar but the part family is escaping me at the moment. But I am still looking for chip that integrates an SMPS so that they can run on a very wide range of voltages like the CD4000 series did (and still does). Combined with the ability to source 10's of milliamps like the ATMega and PIC chips did (and still do).
- KANahas 3y agoThe Cypress part family you are likely thinking of is the PSoC line, it’s a MCU mixed with very configurable analog front end.
- ChuckMcM 3y agoYeah that was what I was looking for, apparently it has an Infineon[1] part number now : https://www.infineon.com/cms/en/product/microcontroller/32-bit-psoc-arm-cortex-microcontroller/psoc-analog-coprocessor-32-bit-arm-cortex-m0-plus-mcu/ https://www.infineon.com/cms/en/product/microcontroller/32-b... which is kind of cool. [1] Apparently Infineon closed their acquisition of Cypress in 2020.
- londons_explore 3y agoPlenty of chips integrate a voltage regulator so you can run digital logic from as much as 300 volts. Used in the controllers for some dimmable AC Led's for example. I believe the linear regulator is implemented as a large resistor followed by some zener diode or something. I assume that's so the high voltage doesn't need to touch the silicon, merely the other end of some not-very-good insulator put on top.
- nine_k 3y agoFrom the modern MCU perspective, not doing a busy wait would be about not burning the battery. Instead, it should stay in low-power mode while waiting for an interrupt. Very small controllers in a high-power device, like on a motor or a LED, don't have this limitations.
- makerdiety 3y ago> I have noted this article for my talk about how CPUs are free. If teeny computers are free, and if I want to re-program them for my own use cases and personal applications, then why do I have to still spend nearly a thousand dollars or two on embedded systems development equipment like microcontroller development boards, JTAGs, ICEs, ROM flashers, UART-based bootloading solutions, and other delicate programming interfaces for small microchips, microcontrollers, and tiny computers? And don't forget microscopes to do power analysis for reverse engineering some old toy that was made to emulate or fake a real life candle's intractable flame properties.[1] If you can't write code, then what's the point? How would no code be an agent of freedom and expression? Reprogramming a microcontroller unit with a USB cable connected between it and a laptop computer is convenient. But too bad that's not really the standard for old technology and resources laying around the planet, isn't it? You have to basically be uncanny like MacGyver or inhumanly intelligent like Tony Stark to reprogram the apparently free teeny computers laying around the world. [1]: https://cpldcpu.wordpress.com/2024/01/14/revisiting-candle-flicker-leds-now-with-integrated-timer/ https://cpldcpu.wordpress.com/2024/01/14/revisiting-candle-f...
- ChuckMcM 3y agoPerhaps this helps, perhaps not, but the Cortex-M architecture from ARM defines, as required, a build in debug unit. I can build a standalone JTAG/Development tool for it[1] on a $3 breakout board, and program/debug it for free using GCC. It has been a pleasant side effect of competition in the embedded space that proprietary (and expensive) tooling has become a problem for getting a chip adopted and so there is more pressure to support open source solutions. [1] Blackmagic Probe -- https://black-magic.org/ https://black-magic.org/
- mlyle 3y agoFirst: don't conflate NRE and tooling with the cost of something. Plastic spoons are close to free, but making a plastic spoon factory would be expensive. Second: you don't need most of that stuff. Dev boards that are a few bucks and debug probes for under $20 are credible and usable; fairly good compilers are free. > But too bad that's not really the standard for old technology and resources laying around the planet, isn't it? You have to basically be uncanny like MacGyver or inhumanly intelligent like Tony Stark to reprogram the apparently free teeny computers laying around the world. USB DFU is pretty dang common. It's not the absolutely lowest end stuff, but still pretty dang close to free. Compare to doing all of this ages ago, where you'd have an 8051 with an expensive, crummy compiler and need a lot more tooling to do anything.
- jacquesm 3y agoWe're almost at (or are already at) the stage where the packaging of the chip costs more than the computer inside it.
- ChuckMcM 3y agoI have had Microchip FEs say as much to me. Will be interesting when chiplet technology gets to the point where multiple chips are installed in a plastic package (there are thermal expansion/contraction issues that make this a hard problem but still ...)
- kragen 3y agowe're two orders of magnitude past that stage. a ryzen 7 is ten billion cmos transistors for a hundred dollars, ten nanodollars per transistor. so how much does a minimal computer cost at ten nanodollars per transistor? the intersil im6100 was a pdp-8 cpu in 4000 cmos transistors, and the 6502 was comparable, but that's with no memory other than the cpu registers. for a useful microcontroller you probably need about 8192 bits of instruction memory and a few bytes of ram, so let's round up to 16384 transistors for a whole computer. an 8051, with built-in instruction eprom and 128 bytes of ram, was 50k. the arm2 without ram was 27k. an avr, with built-in ram and flash, is 140k. https://en.wikipedia.org/wiki/Transistor_count https://en.wikipedia.org/wiki/Transistor_count at that price, counts of 16384 to 131072 transistors work out to 0.016¢ to 0.13¢. but the cheapest computer you can buy today is a padauk pms150c https://www.lcsc.com/product-detail/Microcontroller-Units-MCUs-MPUs-SOCs_span-style-background-color-ff0-PADAUK-span-Tech-PMS150C-S08_C129127.html https://www.lcsc.com/product-detail/Microcontroller-Units-MC... which is 4.2¢ in onesies (and 2.43¢ in quantity) with 64 bytes of ram and 1024 13-bit words of one-time-programmable prom for the program https://free-pdk.github.io/chips/PMS150C https://free-pdk.github.io/chips/PMS150C. that's 150× more; in the day of moore's law doublings every two years that would have been 14 years, but now it's probably longer. (incidentally this same blog looked at them a few years ago https://cpldcpu.wordpress.com/2019/08/12/the-terrible-3-cent-mcu/ https://cpldcpu.wordpress.com/2019/08/12/the-terrible-3-cent...) ergo we've been at the stage where the packaging of the chip costs more than the computer inside it since about 02009 (obviously the ryzen 7 cpu costs a great deal more than its packaging, though, because that's what you have to do when you're competing on computrons per dollar rather than gpios per dollar. in theory for 2.43¢ you should be able to get 2.4 million transistors, enough for about 300 kilobytes of rom or a 50 kilobytes of sram, or half that together with a 486 or a quad-core arm3. presumably padauk is not doing this because they're using long-obsolete semiconductor process nodes, which is also why their chips are so power-hungry)
- buescher 3y agoYou can tell the age of an embedded programmer by whether they consider sampling an input to be "polling" (which to me implies blocking, but that's another discussion) and then look for silver bullets for interrupt storms.
- floating-io 3y agoPolling has never implied blocking. It’s actually a way to avoid blocking. I think you’re thinking of “busy-wait loops”. The difference between “polling” and “busy wait” is whether or not the CPU is doing other unrelated things between samples. The difference between polling and interrupts is that with interrupts the CPU can halt entirely while waiting rather than having to take those samples in the first place.
- buescher 3y agoYou're not entirely wrong, and thanks for pointing this out, but polling is also frequently used to mean "busy-wait loops" - you can look for it if you doubt me. I didn't really want to get into that conversation. The other thing that polling implies is that there will not always be data present when you poll (think of a UART driver), and you might block as long as there is, and you may or may not be polling at a deterministic rate. Sampling unambiguously implies that a sample is always present and handled. It does not preclude any use of interrupts - you can sample with a timer interrupt or handle a sample with an A/D interrupt. Many embedded programmers of a certain age have a nearly fixed mental model of a microcontroller as a sort of headless VIC-20 and a certain horror at sampling techniques that derives from enduring crummy polling peripheral drivers/handlers from the early days of personal computing.