4 ms·
You can still do this! The register interface for the peripherals on modern microcontrollers is only a tiny bit more complicated (and in some ways significantl
by ajross 10y ago
You can still do this! The register interface for the peripherals on modern microcontrollers is only a tiny bit more complicated (and in some ways significantly easier) than what we had on 8 bit PCs.
You can absolutely grab a generic gcc/binutils cross toolchain for an ARM Cortex-M, an AVR, or even an Intel Quark board and start writing simple to-the-metal code today. It's not hard, or at least it's not meaningfully harder than Apple II or C64 hacking.
It's just that no one does it. All the vendors ship integration libraries and fancy IDEs for all these boards, so what everyone chooses in practice is one of these, or an RTOS that provides an even more abstracted view. And that's not a bad idea either of course.
But the hardware is still there, and still fun, and still useful for real tasks in the modern world. Start hacking.
- david-given 10y agoI've never hacked assembly on an AVR, but I have on the MSP430, and it's a really elegant architecture to work on; expressive enough to let you get stuff done without hurling your development board at the wall, but constrained enough to make figuring out a neat optimisation both satisfying and useful. Also, the MSP430X has 20-bit registers, just for that added level of surreality. However, even I have limits: stay clear of PIC12. It's just... bizarre, and not in a good way. (Somewhere I have 2/3 of an 8080 emulator for the MSP430, written in machine code. It ran on the basic Launchpad, with 2kB of RAM, and booted CP/M using an SD card for storage and an external serial SRAM device for memory swap. Sadly, while I got it talking to an AT keyboard, I never got a screen to work, and I've since broken up the hardware for other projects. The emulator core was 1kloc of assembly. The 8080 is surprisingly orthogonal.)
- Gracana 10y agoThose vendor libraries are super ugly and take the fun out of a project.. I absolutely hate the tedious "work" programming where you plug bits of pre-built technology together without actually doing much of anything on your own. A while back I had an STM32F7 (ST cortex M7) board that I wrote some assembly code for. Getting correct clock signals and power to all the peripherals and bringing up RAM and configuring devices sure was complex (and it's not explained by the datasheet in a particularly straightforward way), but doing it that way is certainly enlightening and interesting, compared to fiddling with a vendor-supplied toolchain. However... I would recommend not using a Cortex M device if you decide to go the ARM route. Pick a full classic-arm-ISA device so you can use the more human-oriented instruction set. You can stills witch to THUMB if you want, but you won't be forced to deal with its quirks and limitations.