An electronics hobbyist writes about very cheap microcontrollers, LED hacks, reverse engineering and small neural networks on tiny chips.
HN links it for the 3 cent microcontroller survey and related projects such as LED candles and MNIST inference on cheap chips.
> 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/
I got the chip from a blog elsewhere (https://cpldcpu.wordpress.com/2019/08/12/the-terrible-3-cent-mcu/), advertised as a 8.75-cent MCU.
I did a brief search before posting, and one webpage suggested a 1000+ quantity price for $0.11 USD. However, upon closer inspection, this webpage is completely out-of-stock. (https://www.lcsc.com/product-detail/Others_Holtek-Semicon-HT68F001_C133382.html). I assumed the ~10-cent price point was still available and should have looked more into it before posting.
> Holtek 'Buy Online' shows $1.50 @ 500+
That is indeed terrible. ATTiny4 chips (cheapest chip on Digikey that's available... 512B Flash + 32B RAM) are available at 39-cents @100 Quantity from Digikey, so these HT68F001 chips need to come in significantly cheaper than the ATTiny4 before I consider them.
Sure, the ATTiny4 is like 20 uA at 128kHz, but this is all less than the leakage current of batteries, so we're definitely looking at multi-year battery lives. Also PWM, Analog Comparator, ADCs, and other such features are included. So its more capable.
In 2019, the HT68F001 _WAS_ a 8.75-cent chip or so. Alas, the 2020+ chip shortage may have killed the cost-effectiveness of this particular model.
As noted in the first post, the Z80 is still much easier to generate code for than the 6502.
I see everyone there seems to be referring to free/open-source compilers, but I know of one commercial compiler for Z80 (IAR) whose output is quite good, and I have linked to in this previous comment I made on a different article about Z80 C compilation:
https://news.ycombinator.com/item?id=18902501
If one didn't know better, it would look almost like handwritten Asm.
On the topic of architectures which are difficult to compile C to, I can also think of several more: 8051, low-end PIC series, and these: https://cpldcpu.wordpress.com/2019/08/12/the-terrible-3-cent-mcu/
...and most of those have C (or at least C-subset) compilers too.
Completely accurate, particularly around the "don't tell them it's an 8051" clones.
I have a friend that used to reverse engineers all sorts of embedded black box products and he's said "when there's no markings or other clues, assume it's some kind of 8051 and see where you get". That might not be as true these days with ubiquitous ARMs and sub 10 cent Chinese/Taiwanese microcontrollers (many apparently PIC12 knockoffs[1]), but it apparently worked for a long time.
[1] https://cpldcpu.wordpress.com/2019/08/12/the-terrible-3-cent-mcu/
Read the article:
> There are rectangular regular areas that look like memory, there is a large area in the center with small random looking structure, looking like synthesized logic and some part that look like hand-crafted analog.
And the PIC12 is known to be a source of inspiration for dirt-cheap Chinese microcontrollers, see for example [0].
Hard evidence? No. But if it looks like a duck, walks like a duck, and quacks like a duck...
[0]: https://cpldcpu.wordpress.com/2019/08/12/the-terrible-3-cent-mcu/
You can actually bit-bang low speed USB on Arduino [0]. There is even a bootloader [1] for ATtiny visible to host as HID USB device. It is obviously not compatible with Arduino, but those tiny boards look too cute to ignore [2]. Also, you can use USB port both for downloading firmware and your application.
[0] https://github.com/obdev/v-usb
[1] https://github.com/micronucleus/micronucleus
[2] https://cpldcpu.wordpress.com/2014/04/25/the-nanite-85/