9 ms·
Want to Learn Programming and Microcontrollers?
- tmaly 5y agoI would have also suggested using the micro:bit as a good starting microcontroller.
- hazeii 5y agoIt's not much appreciated, but the Microbit V1 is an nRF51 and the V2 is an nRF52. Download the SDK from Nordic Semi [0], grab a copy of ARM GCC[1] or Segger IDE [2] (free for nRF5x, complete with drag'n'drop firmware upload [2a]) and you have a powerful Bluetooth LE/2.4GHz radio/LED blinky development environment (whatever platform you're on). [0] https://www.nordicsemi.com/Software-and-tools/Software/nRF5-SDK https://www.nordicsemi.com/Software-and-tools/Software/nRF5-... [1] https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm https://developer.arm.com/tools-and-software/open-source-sof... [2] https://www.segger.com/products/development-tools/embedded-studio/ https://www.segger.com/products/development-tools/embedded-s... [2a]https://www.segger.com/products/debug-probes/j-link/models/other-j-links/bbc-microbit-j-link-upgrade/ https://www.segger.com/products/debug-probes/j-link/models/o...
- tmaly 5y agofor younger developers, Microsoft's MakeCode is a really great solution for the micro:bit
- sitzkrieg 5y agosilabs efm8bb1 has kits for $6 and are a good start for those ready to learn non arduino, in the weeds 8 bitters at a great cost
- kjs3 5y agoThat's a good one, and it's an 8051 core, which is incredibly widely used. So there are lot's of 3rd party tools & tutorials. And there are 8051 cores hanging out in all sorts of places, so it's useful knowledge.
- sitzkrieg 5y agoindeed should have pointed out its the classic 8051 with a crazy clockspeed to compensate. silabs simplicity studio is the only out of the box eclipse based IDE available for 8 bitters that i know of as well. i believe this is covered in jay carlsons amazing $1 mcu writeup. which is also good details for someone curious from this article ( https://news.ycombinator.com/item?id=19851744 https://news.ycombinator.com/item?id=19851744 )
- kjs3 5y agoWell, that's kinda where 8051s get weird (not by a stretch the only way it's weird). 8051 performance is more '2 dimensional' in the sense it relies on clock speed as well as instructions-per-tick. The 'classic' 8051 is (over simplifying) a 12-clock ticks per instruction processor. So you pretty quick had the second source providers introducing 6-clock and eventually 1-clock per instruction variants, with commiserate increases in speed. And then they jacked the clock speed. So now you have '100 MIPS' 8051s, running at high clock speeds and 1-cycle per instruction.
- A-Train 5y agoThanks for this article. I have a friend whom I asked almost the same question as is in the article. He suggested to me modules based on esp32.
- litoorachure 5y agoEspressif chips are excellent for making projects that work well, but it's a bit harder to recommend them for education. It's tough to get truly "bare metal" code running on their chips once you want to dig more deeply into how things work. Everything is based around their development framework, which is open-source and quite easy to use, but somewhat difficult to read. Part of why people like the Arduino ecosystem is that it supports a wide variety of platforms, many of which have excellent documentation and register-level example code. But at the end of the day, the best way to learn about microcontrollers is to grab the first one you can find and treat it like a toy. Have fun!
- A-Train 5y agoI see thank you for the clarification.
- JKCalhoun 5y agoYeah, you'll have a lot of fun with something like this: https://www.amazon.com/LILYGO-T-Display-Bluetooth-Development-Arduino/dp/B07V7FDHWR https://www.amazon.com/LILYGO-T-Display-Bluetooth-Developmen...
- russh 5y agoOne of my recent projects was a robot using a LILYGO T-Display module running MicroPython. I'm going to use them in "Build a Drawbot" workshops at our local Makerspace. The previous version used an Arduno running TinyBasic. I think Python and Wifi capability will make it a little more accessible. https://github.com/russhughes/turtleplotbot3 https://github.com/russhughes/turtleplotbot3
- mysql 5y agoBefore becoming a web developer I worked as an embedded systems dev for a few years. That experience left me with valuable skills in data structures (Everything is C), understanding how a processor works and executes instructions and hardcore debugging. Not sure if I would recommend building a career in embedded but you will start learning transferable skills doing it in your free time.
- AbbeFaria 5y agoI work as a back-end developer so I usually get don't work at the "bare-metal" level. I did get to use a CPU profiler to isolate a lock contention issue with one of our services recently and it was super fun. But I have realized that I have some gaps in understanding how a processor works (bad idea to not pay attention in your Comp Arch class), I am trying to cover that up by reading up on Comp Arch (Onur Mutlu lectures). would working on Embedded (in my spare time) help in understanding the processor at a deeper level ? Any pointers on how I can accomplish that ? I am well aware that modern processors are complicated beasts, more complicated than Embedded systems for sure not sure how transferrable those skills are.
- photojosh 5y agoAre you more interested in understanding the processor itself, or low-level software, eg operating systems concepts and how that interacts with the hardware? Embedded can certainly help with both, but I would go in the opposite direction from hobbyist-oriented systems like Arduino: learn to set everything up yourself. Bare metal programming, particularly with C and assembly, will require you to understand things like stack pointers, setting up your clocks, initialising hardware. While 8-bit micros are simpler and you could start with one of those if you wanted (AVR is probably the most accessible), I'd probably go straight to a 32-bit Cortex-M4, get a cheap dev board like [0], and get the sample programs running and try to understand every part of those. [0] https://www.st.com/en/evaluation-tools/nucleo-f401re.html https://www.st.com/en/evaluation-tools/nucleo-f401re.html
- flyingcircus3 5y ago
- arwhatever 5y agoAm admittedly too inexperienced to properly weigh the pros and cons of various platforms, but I find the Rust support for certain embedded platforms to be compelling. https://github.com/atsamd-rs/atsamd https://github.com/atsamd-rs/atsamd I have at least managed to get some literal blinkenlights doing what I want on various Adafruit boards with very little effort.
- davidhyde 5y agoIf you are interested in writing Rust for embedded systems then this is a great collection of resources: https://awesomeopensource.com/project/rust-embedded/awesome-embedded-rust https://awesomeopensource.com/project/rust-embedded/awesome-... Visual Studio Code with rust-analyzer and probe-run give you the same turn key experience as Arduino except on a more professional level. Flash your devices with a simple “cargo run” command and see log messages magically appear from your microcontroller in your console. The STM32 line of microcontroller or nordic’s nRF52 boards are well supported. These are 32 bit microcontrollers rather than the 8 bit microcontrollers you get for Arduino. And of course, there’s a book: https://docs.rust-embedded.org/book/ https://docs.rust-embedded.org/book/
- arwhatever 5y agoExcellent resources indeed. I feel like I should also mention that I tried some bare metal embedded Rust about 2 1/2 years ago and didn't get anywhere with it. Now I try and there's support for quite a few boards, and it's easy to get started with them. (good CLI tools, etc.) I have the impression that the Rust ecosystem and community have progressed very rapidly in the embedded direction, and in short time.
- Trex_Egg 5y agoThanks, the list looks awesome
- ajfjrbfbf 5y agoHow does the code size compare with a traditionnal C approach? The book website mentions using STM32 which usually have plenty of space (64-512kB). How well would it work for say, an ATtiny with 2-8kB of program space?
- pengwing 5y agoAre there any useful embedded projects? With very basic app dev or web dev skills, I can easily hack together a somewhat useful project - useful as in used by real people, solving an actual problem. Is that a thing in embedded dev?
- JKCalhoun 5y agoLearning BASIC back in 1980: for-loops drawing lines on the display was damned fascinating. Later trying to write a lunar-lander program cooler still. The problem solved I suppose was developing an interest in programming.
- ohazi 5y agoI'm do hardware/firmware/embedded engineering professionally, but I also like to tinker and follow the electronics hobbyist community for fun (stuff on hackaday and "electronics twitter" is usually more interesting than stuff on eetimes). The three biggest categories that I see are: 1. Toys/novelties (i.e. blinking/flashing things, simple robots, audio/music gadgets, etc.) 2. IoT stuff (e.g. some appliance that I have does some stupid/annoying thing, and I just want to build a one-off gadget to work around it; I don't trust cloud IoT devices and want to build my own; etc.) 3. Specialized hobby things (e.g. I have a hobby shop metal lathe and want to build an electronic leadscrew for it (https://github.com/clough42/electronic-leadscrew https://github.com/clough42/electronic-leadscrew), DIY radio-control airplanes, drones, autopilots, etc.) It's generally a lot harder to "solve a problem" with DIY electronics and then sell it as a useful product with broad appeal, like you often see in Silicon Valley with apps and SaaS webapps. Going from small prototype runs to any sort of mass production can be surprisingly difficult. There are often large step costs with their own engineering intricacies (e.g. 3d printed enclosure --> injection molded enclosure). Regulatory compliance (FCC, CE, UL, etc.) is a soul-destroying pain in the ass. Etc.
- analog31 5y agoI believe it is. I have a side business selling an electronic gizmo. I sell a few per week at roughly 100 bucks a pop. I pretty much followed the mainstream advice on how to find a startup idea, such as finding a problem that you care about, and that other people experience as well. I didn't do anything brilliant. Of course this is not a "startup" by the contemporary definition, but a solid little lifestyle business that I enjoy. I believe a difference is that it's easy to gain the domain knowledge needed to create a basic software project, assuming you've gotten over the "hump" of learning how to code. And at least for smaller projects, operations and distribution are pretty much solved problems. In other words, all of the reasons why software has eaten the world. Hacking hardware necessarily involves moving and transforming physical material. I happen to have that domain knowledge in hardware thanks to my day job, but the starting point is to first get interested in it.
- mkesper 5y agoWhat about ARM platforms? Something like STM32? https://github.com/stm32-rs/stm32-rs https://github.com/stm32-rs/stm32-rs
- dragontamer 5y agoThe Seeeduino XIAO discussed in the article is a ARM M0+. The STM32F4 is a ARM M4, a higher-end ARM. There's a lot of different chips and chip categories at this level. Ultimately, the CPU doesn't really matter in physical projects. Mundane issues like voltage support, ADC converters and timers dominate the issues you come across.
- asciimov 5y agoMicrocontroller courses in college were some of my favorites in college as you got to build something that actually moved and effected the world beyond a screen. I tried hard to get a job doing anything with them when I first graduated. Sadly I got few replies, and I was often told I needed an EE not a CS to work with them.
- ruslan 5y agoPersonally I do not like Arduino (and its IDE) because it hides many complex things under cover. But, really good thing about it is that programming microcontrollers like this teaches you to keep your code lean, worshipping any single byte of memory you have left, counting any single tick of your clock. I wish all software developers would begin their careers by programming MCUs to work out proper habbits. :-)
- sircastor 5y agoThis is actually the thing I like about Arduino. This is what made it accessible to folks who didn’t have any programming experience artists, experimenters, students. There is a lot to be said for coding at the metal, but accessibility holds greater value for me. That said, you also can skip most of the Arduino stuff even if you are using the platform.
- TrackerFF 5y agoGetting started with microcontrollers is a breeze today, so many good resources, ready add-on components, controllers that support high-level language, etc. My first controller was a PIC which you programmed in assembly language, then AVR/Atmel Atmega, which could luckily be programmed in C. Probably my favorite class in college too. But from a hobbyist standpoint - if you want to build cool stuff that you're going to use, I'd probably go for something which has a more rapid development process than the older cards. MCUs are GREAT for learning applied/hands-on electronics, while also getting a small crash-course in computer architecture, but unless you're super motivated, and like to spend time on shopping for parts, it kind of becomes a chore to roll out everything on your own.
- keithnz 5y agoI did embedded systems for 20 years before moving towards backend/web development. However, I still do a bit of embedded development. One thing I found is a "hobbyist" approach to writing embedded code is fine for home made projects, but tends to turn into disasters in commercial projects. Beyond simplistic embedded systems (quite a few projects I work on have multiple embedded devices, but often have code that do one very specific thing) you need to create a well designed "engine" which is like a mini custom OS with very modular and adaptable micro "services". Where everything is built from the ground up to be traceable and observable for easy debugging. This has to be done really efficiently where there often isn't much wiggle room. Everything has to be done very robustly where things can be easily tested and simulated. It's quite fun to build systems like that, but they do require quite a specific set of design skills.
- cwingrav 5y agoThat does sound fun. Formal systems approaches and automata always seemed more applicable to embedded development. State machines, statecharts, etc always seemed like something I was using on my projects. However, I also felt like I was always writing loops and tests for why some bit wasn’t flipping or some event didn’t occur. That’s the frustrating part... reading and rereading manuals and scratching your head.
- segmondy 5y agoYup, exactly what you said. If you can define the system as a finite state machine do so, then define it. Much easier to reason about and if your state is correct you can have a high level of confidence on the robustness of your code.
- daly 5y agoI can highly recomment Robert Paz's channel https://www.youtube.com/channel/UC7uJBXcRdGlDlKIyr6ZbjBw https://www.youtube.com/channel/UC7uJBXcRdGlDlKIyr6ZbjBw
- Krustopolis 5y agoRIP Robert.
- daly 5y agoDid something happen to Robert?
- ostenning 5y agoAfter 8 years of working throughout Europe as a web developer and a burnout, I’ve gone back to my EE roots to designing embedded systems with Rust and hardware. Honestly, I love it. It’s more cognitively challenging, and I really like bridging the worlds between digital and physical. It’s fun getting flashbacks to University where I was studying the saturation points of a NPN BJT, using capacitors as LPF’s for analogue circuitry etc