Remix.run Logo
sansseriff 7 hours ago

I remember 15 years ago when I was in highschool I really wanted to learn how to program 8 bit microcontrollers without Arduino. And everybody looked at me like I was crazy. There was barely any learning material out there about how to do this.

Now, I imagine the bias pushing everyone to learn on arduino is even more intense? Who out there is programming these chips in pure C using open source compilers and bootloaders?

Edit: Of course there's other platforms like Esp32; teensy; seed. But I've only programmed Esp32s using the arduino dev environment. Are there other good ways of doing it?

pedro_caetano 6 hours ago | parent | next [-]

> Who out there is programming these chips in pure C using open source compilers and bootloaders?

The gcc-arm-none-eabi toolchain is pretty much what you are asking for at least for ARM targets. You can literally use a text editor and gcc-arm-none-eabi, that's it.

And if you want something really bare bones avr-gcc still targets the whole atmel family including those ATtiny chips which are also a lot of fun.

I don't know the state of it nowadays but 'Mbed' is probably worth looking into. The project had _a_lot_ of Middleware libraries to abstract hardware, a few levels below, makes embedded development a little less datasheet dependent, specially if you are just hacking something as a hobbyist.

kevin_thibedeau 4 hours ago | parent [-]

You can also ditch the space consumed by a bootloader and save the UART for something productive in your designs. This is makes it feasible to use the smaller capacity chips and have more headroom on the larger ones. AVR programmers are cheap and the latest serial port based protocol requires the barest of hardware to support.

phoehne 7 hours ago | parent | prev | next [-]

15 years ago I think Arduino was the best choice for educational purposes. I still think it's a great choice now. The fact the IDE and board are basically the same as they were 15 years ago, means you can figure out how to set everything up once and focus on teaching, rather than PC trouble-shooting. Which, for basic concepts, or younger kids, is great. And if they find a 5 or 10 year old video on how to do something, it's still relevant.

If I were putting teaching materials today - I would pick something like Micro python. The down side is it isn't as "canned" a solution, meaning there might be something new to figure out every so often. Which means you spend more time helping people trouble shoot why something isn't working, instead of teaching something useful. On the up side, Python is pretty much the introductory language of choice, today. With lots of available materials.

That's not to say Arduino was perfect. Far from it. Just easier to do, and more consistent over time, than other options.

watermelon0 6 hours ago | parent | prev | next [-]

> There was barely any learning material out there about how to do this.

I started playing around with ATmega/ATtiny around 2008, and from what I remember, there were plenty of tutorials and examples out there.

I remember that AVR and PIC were two popular options among hobbyists at that time, but I started with AVR since it was easier to get the programmer, and it had a lot better open source tooling.

colonial 7 hours ago | parent | prev | next [-]

> Are there other good ways of doing it?

I'm working on an ESP32 project right now, and Espressif provides shrink-wrapped toolchains for C/++ and Rust. The latter even comes with a little tool called 'espup' that cleanly installs their fork of Rust and LLVM (for Xtensa support) - I was able to compile and run a blinky in less than half an hour.

See https://docs.espressif.com/projects/rust/book/ - it also wasn't too hard for me to whip up a Nix Flake with the same toolchain, if that's your jam.

adiabatichottub 6 hours ago | parent | prev | next [-]

I learned how to program the AVR in assembly 25 years ago by reading the datasheet and various articles in Nuts and Volts. For its time the AVR had a very accessible development kit, the STK500, which cost about $100. A few years later avr-libc came along and if you were running linux and knew how to write C it was pretty easy to get started.

ErroneousBosh 4 hours ago | parent | prev | next [-]

> Who out there is programming these chips in pure C using open source compilers and bootloaders?

Everyone using Arduino, for a start.

RobRivera 7 hours ago | parent | prev | next [-]

Whats the motorola ecosystem like these days? Its been a good 16 years for me

userbinator 6 hours ago | parent | prev | next [-]

Small MCUs like the low-end PICs are best programmed in Asm.

cptskippy 7 hours ago | parent | prev [-]

> But I've only programmed Esp32s using the arduino dev environment.

Well you can use PlatformIO/VSCode and the ESP-IDF.

If you're ok with the Arduino 2 framework, then you can use PlatformIO as well. Unfortunately Arduino 3 support isn't there yet so a lot of libraries like HomeSpan won't work on PlatformIO at the moment.

https://github.com/platformio/platform-espressif32/issues/12...