2 ms·
A small micro like Atmel (now Microchip) AVR series. One of my favorites are attiny84/attiny85 - 8 KB of program memory, 512 bytes of RAM, 8/14 pins DIP or SO
by theamk 2y ago
A small micro like Atmel (now Microchip) AVR series.
One of my favorites are attiny84/attiny85 - 8 KB of program memory, 512 bytes of RAM, 8/14 pins DIP or SO package, needs no supporting circuitry (even power cap is optional), runs from 1.8-5V so you can connect it to a couple batteries directly.
The device can be programmed in C or assembly. If programming in C, don't expect to be able to use regular C libraries: with just 512 bytes of ram, "char last_error[512]" will cause your device to run out of memory, so you normally write things from scratch. And 8 KB codespace is really not that big either. If programming in assembly, it's a RISC with 130 instructions, and there is no cache or unexpected interrupts - so things like counting execution cycles by hand work reliably. Even in C, I find myself thinking: "OK, that is going to be X instructions for prologue and Y instructions to write, when means I have Z uS of latency total"
The device has some peripherals on board (like serial port and PWM generator), so capability-wise, it's closer to entire old computer (like ZX Spectrum) rather than a single CPU (like Z80). At the same time, there is no pre-programmed ROM, and all you need is to entirely understand a chip is a datasheet (177 pages) and maybe instruction set manual (147 pages) - and that's it, there are no multi-thousand-pages supplemental docs.
The best part is those things are actually useful. For example one of them is next to me, sniffing the signals that drive LCD display on commercial CO2 meter, and formatting them for IOT transmission. Capturing a ~2MHz signal with 8MHz chip was non-trivial, and required some neat tricks to get right.
Another example is various toys - I have a box with a dozen of lights and a bunch of buttons and knobs. Pressing the buttons and turning the knobs changes the light pattern. Even adults often play with this.
- MarkusWandel 2y agoThe love letter to the IBM 650 specifically included interactive computing with it, having the machine to yourself, being able to single-step through programs and patch them and so on. Also it includes the social aspect (compete in what you can do with a program fitting on a single punched card). That was present in a room full of Commodore PET computers, with no other computing machines available to anyone there. Come up with a wizardly hack and immediately have an appreciative audience. The interactive aspect is missing with the attiny85 type of microcontrollers. You already have to be pretty good at bare metal type optimizations to use them, you can't easily learn it on those devices I see mindbogglingly wizardly things being done with RP2040 type boards. But that's orders of magnitude more wizardly than described here. But at least the "show it off" community exists.
- kevin_thibedeau 2y agoI have a shell interface (line editing, command history) that runs on modern ATtiny 2-series. It is easy to have nice things on limited platforms.
- theamk 2y agoattiny85 is pretty interactive, it has full debugging capabilities (via RST pin no less, so no taking away precious GPIO). And with cycle times of <30 seconds, printf-based debugging (or more often, LED+button based debugging) becomes very feasible too. When comparing with old machines, you just need to look not just at the chip itself, but at the whole package - attiny85 + ICE + host PC using to program it. You know how original VAX-11 included a whole separate PDP-11 computer just for booting and diagnostic? It's the same with attiny85, it needs a whole separate computer for program upload and debugging. The fact that this "program upload" computer is many magnitudes faster does not really matter. As for audience / social aspect, I don't think this is coming back - the choice is simply too big now. When Commodore was the only option, everyone had to use it. But now some people like python, some like small MCUs, some do websites, some do JS demos, some do robotics, etc... - so there is less chance that you'll find room full of homogeneous computers. (and RP2040's manual is 642 pages, substantially bigger, so one is less likely to know it all by heart. At least it's better than STM32 family, where some devices have multiple thousands pages of documentation)