I mainly work in web-dev, but working in embedded systems is kind of my hobby. It's kind of refreshing working on bare-metal, optimizing up-to single bytes of data, when I'm usually working on layers and layers of abstraction everyday.
For other low level programming, Atmel's AVR Studio and their dev boards are incredibley newcomer friendly. Their source level debugger (with the debug coprocessor) is a miracle.
If you'd like to get into "big iron", Embedded Linux is amazing. Raspberry Pi is a great start (lots of GPIOS programmable from userspace). To get into embedded linux kernel programming, start with a loadable module on the Ras-Pi. Also, build/load your own Ras-Pi kernel.
Other folks suggested the ESP8266 which is also great fun to use.
Edit: Learn C. Lots and lots of C. Embedded dev is almost all C. A teeny bit of ASM, sometimes C++. But almost all of it will be in C.
Can recommend https://buildroot.org/ for building complete Linux system images. Been using it on multiple embedded projects, both personal and professional.
Somewhat related, I've also used buildroot in both AWS and GCP to run workloads from read-only system images. Quite liberating in my opinion. No ssh, no ansible, etc. Build the image, launch it and off it goes. GCE even allows you to use the same boot disk, if mounted read-only, for multiple instances, perfect for these type of images.
I can second this as well, Arduinos have a bad rep for being too beginner-focused but AVR is a super solid platform and you can do a ton with them. I'd pick Arduino over RasPi for a starter project anytime.
I'm a React Developer in my day job, but I'm disillusioned with the web as a whole and I've always had an interest in low-level stuff.
At the moment, I'm doing a structured C book course (C: A Modern Approach), and I've also signed up for the edX course "Embedded Systems - Shape The World: Microcontroller Input/Output"
It uses the TM4C123 board, which from a look around seemed to be a decent enough board for a beginner. I'd seen complaints of Arduino, but I'm not experienced enough to know the validity of their claims.
Either way, I'm having fun. Not sure if I'd switch career as Web Dev is full of decent paying jobs but it's nice to have a hobby that's different from the day job.
FWIW, those TI boards have tons of hardware bugs. Way more than you'd even typically expect from embedded hardware.
And if you don't use the arduino ecosystem, but use an RTOS on an Arduino, it's a perfectly valid dev board for learning real embedded systems development.
I've heard about the hw bugs a little but couldn't find much information about them.
I'm mostly just using it for the course which was highly recommended in multiple places, so I hope I won't encounter many of these bugs.
To be honest, the whole picking a board thing was quite overwhelming, with many recommendations, boards, variations, etc. Hopefully once I've finished the course I'll have some more knowledge to help me pick the next board.
I think Micropython is fantastic and you can get an ESP8266 + FTDI cable for around $25. You can make this a web server and do fun hardware integrations with it like flashing LEDs for successful CI builds. Here's a good tutorial: https://docs.micropython.org/en/latest/esp8266/tutorial/inde...
I highly recommend the ESP8266 and ESP32 once you're a little more familiar with the arduinos.
They have Wifi, and the ESP32 is actually very powerful and has two cores. They make for great DIY home automation/IOT devices and are pretty easy to work with.
Second this. The ESP8266 (a nodeMCU) is about as powerful as an Arduino Uno, is about half the size of a credit card, is very thin and costs around $3.
The wifi part is the biggest advantage. You can send sensor data directly to your server via simple http requests.
Esp8266 is way more powerful than an arduino Uno. It's got a 32bit 96MHz proc with 96k of ram and Wifi, often coupled with 4MB flash. Uno has 32k of flash 2k ram and (from memory) 20MHz 8bit cpu.
No matter what you do, you NEED tools. I cannot stress this enough. If you can spend $250-$500 on a nice desktop scope, awesome. If you only have $80, you can get a serviceable Hantek USB scope that will at least give you an idea of what you're doing. If you can only spare $20, you can at least get an el cheapo JYETech scope. In addition, you'll want to pick up a multimeter and probably a logic analyzer. Again, no need to go all out; a cheap $20 meter and a $15 Saleae knockoff will get the job done when you're just starting out. DO NOT SKIP OUT ON THESE. Embedded development without being able to see and know what you're doing is miserable, so unless you're doing this because you want to be frustrated, just buy the tools you need upfront.
As for what microcontroller to actually learn on, I would say the MSP430 is a very good starting point. It's a fairly mundane 16-bit RISC microcontroller series with very forgiving electrical design requirements, very good documentation, and very good community support. They make a devboard (TI calls them Launchpads) for the MSP430G2553 that's more than enough to get a beginner started. When you need a little more power, you can either opt to invest in learning the ARM ecosystem, or go for something a little more exotic. Just about every manufacturer makes an ARM microcontroller of some sort, so if that's what you're interested in, take your pick and go with it. If you're looking for something else, the Renesas RL78 and RX series provide a lot of functionality if you're willing to deal with how stodgy Renesas can be.
Some important notes:
1.) Don't bother with Arduino. They were a much more compelling product 15 years ago when you had to pay thousands in tools and compiler/environment licensing to get in on in embedded development. Today, what Arduino nets you is a painfully barren environment that abstracts away a lot of what you're trying to learn when you're starting out. Losing out on the debugging, profiling, tracing, disassembly, memory usage statistics, etc. that modern development environments give you will do nothing but stunt your growth, especially if you're used to having all these tools while writing desktop software
2.) Be careful with (or preferably just avoid) starting with embedded Linux; it's pushing the limits of "embedded". You're going to miss out on a lot of important knowledge and insight jumping straight into using an operating system (and a very heavy one at that), and for many applications, it is MASSIVE overkill. When you start, you're not going to need an RTOS. When you need an RTOS, you're going to reach for something more reasonable, like FreeRTOS. If FreeRTOS doesn't cut it, then you can start looking at Linux.
3.) Don't get tangled up with Raspberry Pis; the microprocessor on these is complex and the documentation is severely lacking/nonexistent. RPis are much closer to a desktop computer than they are an embedded system.
If you really want to get it, I would say one of the most useful exercises is implementing your own microcontroller/processor. You can pick up an FPGA devboard for fairly cheap, and there are plenty of textbooks (Harris & Harris' Digital Design and Computer Architecture comes to mind) that will get you through most of the key concepts. Once you've done this, a lot of the gaps in understanding when dealing with a microcontroller will be filled in. This exercise isn't strictly necessary, but I don't know anybody who has done it that wasn't better off for it.
My final note is to buy or "acquire" Horowitz and Hill's The Art of Electronics. Embedded development is inseparable from electrical engineering, so even if you don't read it front to back, there are some sections that you will definitely be visiting if your background isn't in electronics.
I wouldn't say that. Yes the Arduino "libraries" abstract away a lot of the complexities and hinder true understanding. However for a beginner it is a perfect platform simply because of the huge community i.e. tutorials, code and projects. Once they gain confidence from using this, they can move on to "traditional embedded development" by learning to program the underlying AVR directly i.e. use the toolchains installed by the IDE, delete bootloader and upload your program using the ISP interface (see the book; "Make: AVR Programming"). This gives you the best of both worlds using the same development platform. Another advantage is that many other MCU families also provide a "Arduino-like" interface (eg. Energia for MSP430) and thus all the skills learnt on one can be transferred to another.
My take is driven by me finding the Arduino platform too easy. My first exposure to embedded development was Energia, and I was so underwhelmed that I didn't bother with it again until years afterwards, when I downloaded CCS and got to play in the "big leagues". I know multiple people that had that same experience.
If you're already writing software, you're not going to be struggling with having to learn programming. Translated to Arduino, this is great for engineers who don't write software and just need to get simple shit done fast, but for those with a background in software, it feels equal parts mundane (I called analogRead and... got an ADC value, just as expected) and magic (what did analogRead actually do?). Given, you can go look at the source for these libraries, but a lot of them make very generous use of the preprocessor for the sake of supporting multiple products in one codebase, and it's often not pleasant to read. Working with an MSP430 (or basically any architecture if you're using more capable tooling, like you mentioned with AVR) has a certain clarity to it that the Arduino ecosystem just doesn't seem to capture.
I would make the same argument for AVR and the "real deal" tooling as I do the MSP430; why bother with Arduino when you're probably coming in with decent programming skills?
>why bother with Arduino when you're probably coming in with decent programming skills?
Pure Software programming skills are NOT enough when it comes to embedded programming. You need to know the logical interface to the HW and the EE/Electronics behind the HW itself. This is a huge challenge for people who have only worked with applications software over layers of abstraction. This is where the Arduino shines; hide the overwhelming HW complexities and provide a simple api for software guys to get their job done. This allows them to slowly gain HW knowledge and transition to "traditional embedded programming" as needed. Also, many experienced embedded developers are using the Arduino as a rapid prototyping platform to implement an idea quickly and get clarity on the project before implementation on the actual target using traditional means. Learners can do both on the same Arduino platform.
So here is my recipe for somebody wanting to learn Embedded Development;
1) Get a Arduino Uno, a couple of extra ATmega328Ps, a AVR programmer and a electronic components toolkit.
2) Get a book on Arduino programming and AVR programming. I can recommend "Exploring Arduino" and "Make: AVR Programming". You also need a book on Electronics and "Practical Electronics for Inventors" is a pretty good one.
3) Install the Arduino IDE and go through some blinky tutorials. Do some projects from "Exploring Arduino".
4) Now move on to direct AVR programming. The Arduino IDE has already installed the required toolchains. Setup a Makefile environment using them following instructions in "Make: AVR programming". Do some blinky and other projects from this book. This gives a command-line approach to AVR programming.
5) Next repeat the above using a proper vendor supplied IDE eg. Atmel Studio for AVRs. These IDEs are pretty complex but quite powerful and used extensively in the industry. Go through some tutorials and redo the blinky and other projects using the IDE.
6) Get some test equipment tools to look into the inner workings of the system. I recommend the multi-functional "Analog Discovery 2" which has lots of learning tutorials.
Congratulations; you are now a bare-metal "Embedded Developer"!
To enter the "big boys league", move onto ARM Cortex boards.
Finally you get to "Embedded Linux" and become a "Master Super-Duper Embedded Developer" :-)
A great book particularly for learners/students is "Introduction to Embedded Systems: Using Microcontrollers and the MSP430" by Jimenez, Palomera et al. For every feature of Embedded Programming it gives a illustrated and platform independent explanation followed by how it is realized in the MSP430. This cements understanding like nothing else.
FPGA is pretty challenging to get started with. If you decide to go in on it, you're going to spend quite a bit of your time at the beginning getting your ass kicked. Vendor tooling blows, open source tooling is playing continuous catch-up or is much more focused on VLSI, and resources for beginners feel pretty anemic compared to what you're probably used to coming from the software world.
I can't tell you if this is "the way", but I can tell you how I started. I flipped a coin to decide between Altera and Xilinx and started with a Terasic DE2 board (an Altera Cyclone II devboard) that I borrowed from my university. I don't recommend using this board or something like it (it has actually been superseded by a nearly identical board with a Cyclone IV in place of the dated Cyclone II); the extra peripherals are a headache more than anything, and the simple breakout pins on the Terasic DE0-Nano are greatly appreciated. As for the environment, you can go and download Quartus from Altera basically no-questions-asked.
After pissing with the board for a bit, I decided to pick up a book. Rapid Prototyping of Digital Systems by Hamblen, Hall, and Furman is good, if not a bit out of date. I had this book to thumb through instead of read front-to-back. It is written for older versions of Altera's Quartus software, but with a little bit of exploring the UI I was able to find just about everything I needed. It makes a decent quick reference for Verilog and VHDL syntax, has quite a bit of info on interfacing various things to an FPGA (think PS/2 mouse, VGA, etc.), and a couple chapters on microcontrollers and microprocessors.
An important bit to know is that that a lot of the usage of an FPGA (at least in the way I use them) happens in two phases; the actual logical design, which you'll do on your computer via simulation, and the actual usage of that design on the FPGA. The logical design happens largely in ModelSim (with Quartus only being used to generate libraries at this stage), or some other Verilog/VHDL simulation tool. Altera ships ModelSim free-of-charge with Quartus. It is your run-of-the-mill Tk-based clunker of an EDA tool, but it works and I haven't had it crash on me yet, so I can't really complain, even if I have some gripes with it. This is where most of the work/magic happens, at least for a beginner; you write your logic in your editor of choice, write testbenches, and simulate those testbenches in ModelSim. Having read the Harris and Harris book mentioned in my initial post in the past, I took a quick look at a processor called "Ahmes" on GitHub, and just had a go at it. After getting a primitive processor working/executing instructions, adding some peripherals like some timers is where things started to come full circle, and I started realizing both the power of the FPGA, and why things are the way they are on a microcontroller/processor.
The bit where you actually put it on the FPGA hardware is largely uneventful, or at least it was for me. I didn't have multiple clock domains or anything like that, so I didn't suffer from any timing issues, and basically had the good fortune of just mapping pins and letting it rip. In theory, actually translating the design to the chip doesn't do much, but in practice, a design that exists only on your computer isn't terribly useful. Actually using the hardware adds that "visceral feeling" and lets you play with what you've spent so much time doing, along with getting you familiar with the process if/when the day comes that you actually need to do it. You also get to enjoy/experience the power of bolting on arbitrary hardware to your jalopy processor for the sake of VGA output, GPIO, timers, SPI communication, etc.
I wouldn't consider myself terribly talented or knowledgeable, so if you just throw enough time at it, you can probably end up having just as much fun as I did.
I'd recommend an ESP32 (or it's slightly less capable little brother the ESP-8266) using the Arduino environment to get started. If you prefer Javascript, you can program it that way using something like NodeMCU or MongooseOS. Once you get comfortable with that, if you want to get a little lower level you can use PlatformIO with the vendor's SDK directly.
I like the ESP boards from Wemos. The US made ones from Sparkfun and Adafruit are also really good. The advantage of the Wemos ones (and the many counterfeits you'll see on sites like Aliexpress) is that they're so cheap you don't even have to feel bad if you fry one.
For anyone interested in embedded JavaScript but wants broader hardware support and/or modern JavaScript support[1], the XS JavaScript engine is microcontroller-independent[2], and Moddable provides supported ports for ESP8266, ESP32 (the successor to ESP8266), and the Gecko series of processors. (They also sell some hardware kits for folks who want that: https://www.moddable.com/product.php)