Microcontrollers

⏱️Overview

This is my tutorial (or guide) on microcontrollers as a hobby.
I am using simple English to make it easier to read for beginners and young people.
I’m trying to make it educational and cover many topics, but shortly with links to Wikipedia and other pages.

ℹ️What is a microcontroller

Microcontroller (MCU for short) is one chip (IC) that already has all needed components inside:
– a processor (CPU)
– program memory, for code (Flash)
– memory, for variables (SRAM)
– pins (input / outputs, GPIO)
– it usually also features few devices like:
ADC, DAC (analog converters), SPI and other bus controllers, EEPROM, RTC (clock) etc. – more about them next.

Microcontrollers are quite small, need far less current (power) and aren’t very fast (in computing), when compared to SoC (System on Chip, where memories are as separate chips).

Being small and needing little power, makes them ideal as IoT and other devices that run from batteries.


⚙️Components

I group and describe here (nearly) all microcontroller components (inside MCUs).
If needed, many of them can also be added with chips or modules.

🔨Basic

⚡️Power supply

Let’s start with this, not really a component but important part.

I don’t recommend 5V, unless you are a beginner and go with oldest Arduinos.
It is complicated if you want to use it with 3.3V devices (a display, module or chip).
Or generally have more voltages (5V and 3.3V) in one project.
Converter is then required. And it is possible to damage (destroy) a component by accident.

So, starting with 3.3V powered microcontrollers will cause less problems.

Most MCUs use 3.3V for power. MCUs powered from USB (which has 5V) use a regulator that gives 3.3V.

🔋Batteries

Powering MCU form batteries is possible, but needs to be checked first.
It is usually done through low drop LDO voltage regulators that give e.g. 3.3V for MCU.
LDO means it will have less voltage difference by itself. They have some requirements though, need capacitors, etc.

Example LDO: MCP1700T-3302E 3,3V, 6V max, 250mA current max, 1,6μA doing nothing, 178mV drop.

A MCU can have power supply range e.g. for Bluepill🔵: from 2.0V to 3.6V max.

  • LiPo batteries are 3.7V, but 4.2V when fully charged, and can go down to 3.5V even.
    So they seem to be best with a LDO regulator to power 3.3V chips.
    Some MCUs can work from LiPo directly without regulators, like ATmega328P🔺 (from 1.8V to 5.5V).
  • It could be powered from 2 batteries (e.g. AA size) which are 1.5V (but more if new / fresh).
    Not ideal, since AA voltage (from capacity graph) goes down to 0.8V at end so they won’t be used fully here (best if MCU was from 1.6V).
  • Using LiFePO4 batteries, which are 3.2V (most of the time) could be an option too I guess.

Either way you’ll have to use MCU (deep) sleep modes to minimize its power use
and wake it up only at some intervals to do work or measurements.

Additionally you could need a LiPo battery charger like TP4056
and e.g. some diodes (best Schottky for low drop) to allow MCU working from either battery or power supply, and charging.

💡LEDs

One last remark, some white LEDs need higher voltage than 3.3V to light up fully, so it’s best to know it first.
Otherwise it is possible to use a converter with a transistor to power LED from 5V.

BTW of LEDs, there are cool calculators like this, or this, for computing needed resistor value (without it LED will be destroyed). Theory explained e.g. here.

💻CPU

Just like with a computer, the CPU it is a quite important component. Usually faster ones will need more power.

There a few key parameters here:

  • CPU Frequency (with higher, CPU is faster and works / computes quicker).
  • CPU Bits. Old 8-bit CPUs can use 16-bit values, but will have trouble even with doing simple division. Still it may be just enough for some.
    For most cases 32-bit ones will be okay, for example if you read any value analog and want to scale it to display number.
  • FPU. Some CPUs can compute using floating point (real numbers, not integer).
    FPU is a dedicated unit that computes floats in hardware and so it is much faster.

All CPUs have ALU (Arithmetic Logic Unit).
For more advanced operations I recommend reading ALU Wiki (e.g. how to clear or set a bit).

📍Pins (GPIO)

A pin or GPIO (general-purpose input/output) is where you can connect:
LEDs, switch buttons, potentiometers🎛️, rotary encoders, etc.
More are needed at once for displays (SPI or I2C, even more for parallel) and for most modules.

A pin mode (purpose) can be changed easily. It can be:

  • an Input (a button)
  • or Output (a LED)
  • or off, “floating” (High-Z state).

It is also possible to configure input pull-up resistors (inside MCU) needed for e.g. switch buttons.

It is quite important how many there are available when adding many components or modules.

Notes

Good thing is that buses (SPI, I2C etc.) allow more than 1 device attached. So e.g. you can have few chips that use SPI connected to the same SPI pins of MCU.

Lastly, there are ways of making more outputs, for example by adding more chips:

  • parallel latch (e.g. 74HC573)
  • (serial) shift register (e.g. 74HC194, CD4094).

But this means more trouble and more space. And it kind of breaks the benefits of having a microcontroller (it’s main advantage is having all in one chip).

👉Touch sensing

Some MCUs allow detecting finger touch on few pins.
It is cool but isn’t something too awesome.
If not present, you can do it anyway with 2 resistors or even just using ADC (advanced).

Lastly, there are (expensive) dedicated chips for touch sensing if needed, e.g. MPR121 or AT42QT2100.

PWM

PWM (Pulse Width Modulation) can be used for example to change brightness of LED (or speed of a motor).
Just having a pin as output (digital) will make a LED full on (bright) or turned off.

PWM uses much higher frequency than human eye can see (e.g. 10kHz). So for LED brightness no filter is needed.

It is cheap and many MCU pins support it.

PWM with RC filter

PWM also allows a cheaper way of making an analog signal.

Best way of having an analog output is from a DAC (special converter), but these are quite expensive.
Still, for (good quality) audio outputs DACs may still be the best / only option.

PWM output is still digital, but using a simple RC filter (with Resistor and Capacitor) you can turn it into analog.
More info on PWM Wiki.

It isn’t the best (cleanest) analog signal though, and you don’t really get much bandwidth (not for high frequencies).
RC filter is used to make it smoother (get rid of PWM modulation) with higher R,C values, but passing less higher frequencies from signal.

Links: Calculator for RC filter values, and
another, better one – great for showing modulation noise (peak-to-peak ripple value, response graph).

🛠️Medium

📈ADC

ADC (analog to digital) converters are quite common in MCUs.
Usually there are 1 or 2. But more inputs (pins) can be used to read. MCU selects just one at a time.

ADC for example for 12 bit, converts input pin voltage 0 – 3.3V to a 0 – 4095 value, (4095 = 2^12 – 1) after short conversion time.

📉DAC

DAC (digital to analog) converters are not that common in MCUs.
Cheap, old or low power MCUs will not have them.

E.g. a 12-bit DAC’s output pin will have analog voltage 0 – 3.3V from a 0 – 4095 value, after short conversion time.

Converter bits

Even if MCU has a converter (ADC or DAC) it usually won’t have much resolution (usually 10 or 12 bits).

This is because with more bits, they need cleaner power supply (otherwise it will just have the same noise)
and this is difficult to do inside MCU, so close to CPU 😀.

Other thing is how many bits will be useful. E.g. it may happen that from 12 bit ADC, 2 bits are noise.
This is a practical thing to check and likely won’t be written in specs.

ADC or DAC chips, for 16 bits and good quality aren’t cheap.

ADC and DAC can be both inside a codec chip, possibly also with an audio amplifier.
Codecs save space but aren’t best in quality.

EEPROM

EEPROM is the kind of memory that permanently stores data.
In other words, it remembers what it has after turning it off.

This makes it rather necessary if you have any configuration or parameters you want to keep after user changes it.
Sadly not all boards or MCUs have it, and usually there isn’t much of it, in bytes.

But if you have SPI bus (and want to go into this trouble) you can attach a separate chip with serial EEPROM e.g. 25LC256 (64 kB).

Of course if you use a SD card (for SPI) then EEPROM isn’t needed. SD cards have a lot of (storage) room, but are expensive.

⏰RTC (Clock)

RTC (real-time clock) counts time (seconds, minutes, hours) and date accurately.
It usually needs an extra 32 kHz crystal. And a 3V battery to keep working when MCU is off.

Generally RTC is present (like DAC) in newer MCUs.
So when a MCU isn’t cheap, old, or very low power, it features a basic RTC already inside.

For those microcontrollers that don’t have it (or for more RTC features like alarm), an external RTC chip can be used.
E.g. DS1307 or DS3231 (there are a few others), they need I2C bus.

⚙️Advanced

⏲️Timers

Generally when coding, there are some classes or methods to deal with timing on higher level (given interval).
If so, then knowing the details of timers in MCU isn’t needed. But when going closer to hardware, it usually is good to read about what is possible in technical specifications (e.g. some 8-bit MCU can have just one 16 bit timer).

If used manually they need setting up counter value, which decreases (with CPU Frequency, possibly scaled first)
and generates interrupt (calls your short procedure) every time it reached zero.

DMA

DMA (Direct Memory Access) allows CPU to run your code, while at the same time memory is being transferred.
DMA transfer needs to be set up first by CPU (few parameters set).

One example would be using LCD display: CPU does (computes or draws) something
while DMA unit reads screen memory buffer and sends it to SPI display.
This way is fastest and optimal.

Interrupts

An interrupt means CPU stops running normal code and
jumps to executing interrupt procedure (usually very short code to deal with this interrupt type).

Interrupts can happen:

  • internally – e.g. after ADC finished conversion or DMA transfer ended)
  • or externally – e.g. user presses button, changing GPIO input level).

↔️Buses

A bus is simply just a set of wires (with given names and purposes),
for transferring data (sending and/or receiving bits and bytes).

The more advanced (and expensive) a MCU is, the more bus types it has, and more than 1 of each type are available.

USB

Having USB on MCU board is usually very good:

  • Uploading your code into MCU is super easy, you just plug in a USB cable to board and into PC USB and then upload.
    No need for the other board (programmer or serial converter).
  • MCU can become a USB device (e.g. send (receive) data to PC, be a keyboard, mouse, joystick etc.).
  • Some MCUs have a USB connector but don’t allow above (uploading and being a device).
    And only allow host devices to be plugged in, e.g. connecting a keyboard or mouse to MCU.

So it is best to check first. Also few USB variants are present. They have different transfer speeds and current (power) limits.

SPI

SPI uses 4 wires and is meant for fast devices like: displays or SD cards, various devices, chips, etc.
Transfer rates e.g.: 8, 16, 24, 30, 60, 80, .. Mbit/s.
SPI wires are named: MOSI, MISO, CLK, SS (or CS, chip select).
Displays can have additional signals e.g. D/C, RST.

I2C

I2C is slow, but only needs 2 wires (named: SDA and SCL).
Transfer rates e.g.: 100, 400 kbit/s, 1, 3.4, 5 Mbit/s.

Some displays work with I2C. If a display is also available for SPI, then using I2C means it is slower (to refresh) but needs less pins.

I2S

I2S is meant for sound devices and needs 3 wires.

UART (serial)

UART and similar USART.
USB to UART converter is used to program ATmega MCUs that don’t have USB (with this converter on board).

UART can be used for the Serial monitor (or e.g. Putty) as COM port in PC, to print text messages while MCU is working.

RS-232 and RS-485 exist since long, have very many devices and usages, and long cable range, but very slow rates.

Other

There are also other buses.

For example: DS18B20 temperature sensor uses 1 wire bus and so it needs additional library (more flash code).

CAN is industrial and popular in vehicles.


⚖️Comparison table

In following table I gathered most important MCUs, only smallest and IMO worth mentioning.
If there is a bigger variant or more expensive one I’m not adding it.
I listed key parameters in columns (scroll right to see all).

RowBoard name💰Price $🖥MCU (chip)⏱CPU MHz⭐️Rating (5 max)CPU bitsARM CortexFlash kB (code)SRAM kB (memory)📍Pins GPIO📩EEPROM BytesUSBSPI (Mbit/s)📉 ADC bits📈 DAC bitsBoard name
18 pin chip~1.5ATtiny852018 🐢80.55 😡512no1x1x 108 pin chip
2Arduino Nano🅰️~3 to 10ATmega328P163 💫8 🐢322141024yes2x1x 10Arduino Nano
4STM8S~2 to 10STM8S103F3P61628 🐢M08116640no1x (8)1x 10STM8S
5Bluepill🔵~2STM32F103C8T6724 ✨32
M3642033no2x (18)1x 10Bluepill🔵
6Blackpill⚫️~4STM32F4111003 ✨32M451212832yes5x (50)1x 12Blackpill⚫️
7Nucleo-L432KC⚪️11 😡STM32L432KC
80232M42566420 to 26?yes2x1x 122x 12Nucleo-L432KC⚪️
8ESP32📡~7 to 11Tensilica Xtensa LX6240 x25 🌟324096 – 819252034yes4x (80)1x 122x 8ESP32📡
9Teensy 3.220 😡MK20DX256VLH772132M425664342048yes1x (30)2x 131x 12Teensy 3.2
10Teensy 4.0⏩20IMXRT1062DVL6A600 😱4 🌟32M719841024 (512)401080yes2x (60,80)2x 14Teensy 4.0⏩
_____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Notes

Prices with ~ are from AliExpress if available. I am using icons for few boards, to easier spot them around here.
I would recommend boards with my Rating having stars (3 or higher).
I marked with 😡 really bad things. Well, for me not having an EEPROM (or too little) or DAC is also bad.

The slowest 8 bit have 🐢 mark. They are really ancient history🏛️, compared to 32 bit ARM. But yeah, for some uses still enough.
Cortex M4F (and higher) has float type, M4 does not (also some info here). Cortex M7F has double type.
Meaning all below M4 have only integers.

Regarding memory it is good to know that constant program memory can also store data like fonts, images etc.
And differences between stack and heap, explained here or here.

Of course to really compare how fast MCUs compute you’ll need to check benchmark results, but CPU MHz is a good start.

USB yes in table means you can program it from USB.

SPI Mbit/s speed affects how fast a display could be updated (if display allows), but CPU MHz too (if not using DMA).

ESP32 has a lot of variants so it can have different values in table.


👉How to start / My Recommendations

Here are my recommendations on how to start a hobby with microcontrollers (or develop it further).

There a many factors here.
All depends on your knowledge, education or experience so far, free time and determination, age, money, expectations etc.
And lastly preferences, since you could already prefer some MCU.
(e.g. having already experience with Arduino, wanting WiFi present in ESP32📡, or Teensy boards which are quite popular for sound effects).

I’ve also put a section below with Showcase (projects and videos). It’s fun to watch and good to get inspired.
Just keep in mind that: the more time you watch, the less time you spend creating your own.

Beginner

For someone who does not know the topic of microcontrollers or electronics.

For beginning (especially alone), it is important to: not get stuck,
have easy steps to move forward and have fun with each step.
That is why recommend here the most popular boards and tools.

I would recommend buying an Arduino Nano🔺 (cheap clone on AliExpress)
and then installing and starting with Arduino IDE, to program it.

Then following a video tutorial exactly, like this slow one, or the better fast one.

Once you have a MCU and IDE working it’s up to you what to do next.
And I’d say doing what you find most interesting or fun.

I don’t recommend expensive boards at start. Loosing money on something that will just gather dust isn’t fun. This may happen if some step is too difficult (makes trouble) or other hobby (or addiction) takes over.

Medium

For those having some experience already and/or more determination, I would recommend starting with:

  • either STM32 boards (Bluepill🔵, Blackpill⚫️) with required programmer (STLink V2) as they are cheap on AliExpress,
    video guide e.g. here or here.
  • or even with ESP32📡 as it has USB (no programmer needed),
    website with guide e.g. here or official here.

And starting inside Arduino IDE (to get going quickly).
Once done and working, I would later recommend moving to VS Code (e.g. with Arduino extension).

Expert

As an expert I recommend using VS Code already for IDE (or other) and either using a Makefile or CMake.
This way build is just normal and makes it easy to have many files in your project (it does not limit you making bigger projects).
And you get a decent IDE with features that professional developers use too.
Also using Git for your projects will allow better history and changes managing.

For example: I am using Teensy boards and made a Makefile (based on other examples).
Then I’ve put together libraries (found on GitHub) for the components I needed (especially the optimized one for display, using DMA).

Sure, it is not that easy as using libraries from Arduino IDE.
But at least you don’t have just 1 .ino file and you can add many files, subdirs or libs in your project.
It is easy to navigate inside libraries and edit them too.

Professional

Well just for info. None of this matters for a hobby.
Given time constraints and requirements (someone else’s) this could be stressful and not fun at all.

As a professional you would likely: have product requirements, then pick closest / cost effective MCU chip for it (with needed speed and components). Having a chip you would manufacture a PCB (by yourself or from a PCB making company).
Then develop software for it to cover just the requirements, effectively.
You could maybe use some bigger (expensive) development boards first, if available for that MCU family.
It is a really long way, to later make profits, when mass producing your product (by a company).


🔗Links

📚Specifications

ESP32

ESP32 – with all ESP32📡 related (lots of links).
ESP32 Wiki

Teensy

Teensy 4.0⏩ – The fastest one now.
Teensy specs – table comparing all Teensy boards.

STM

Blackpill⚫️, Bluepill🔵, Nucleo L432KC⚪️, 8 bit: stm8s103f3

ATmega

ATmega328P🔺, ATtiny85 – the slowest.

📃Projects showcase blogs

Hackaday projects – lots of advanced projects.

Teensy blog – lots of advanced projects, based on Teensy boards only, Teensy forum.

▶️Showcase videos

educ8s.tv – many various projects and tutorials.
cbm80amiga – many projects with fast display
GreatScott projects – mainly Arduino

ESP32📡

How to add WiFi Control to any project || ESP32 Beginner’s Guide
ESP32 FTP Client, download files in SDCARD
ESP32 WiFi Weather Station – with Nextion display, old
ILI9341 TFT LCD to ESP32, SD card and Touch – with tutorial
Solar Weather Station, ESP32, SIM800L sending to WEB Server over WiFi/GSM

Teensy 4⏩

My demos on Teensy 4.0, with ILI9341 320×240 display – 45 Fps
My demos on Teensy 3.2, with ST7735 160×128 display – ~20 Fps
All my videos, Teensy with displays and keyboard related

3D graphics on Teensy 4.1 part 4 – wow
Teensy4.0 + ILI9341 running Atari 520ST emulator
Get better DSLR audio control with a Teensy-based mic monitor

STM32🔵

3D Filled Vector Graphics on STM32 Follow-up – ST7789 and new features
Smooth video playback on STM32 and ST7735

ATmega328🔺

Arduino Datalogger with GUI update, DS3231 support – great project, with Nokia 5110 LCDNokia 5110 LCD – the oldest LCD with tutorial
ILI9341 fast SPI library optimized for 16MHz AVR Arduino – amazing fast
SSD1306 Display Test – OLED – 8 Fps for I2C – 25 Fps for SPI, just comparison
ST7735 ATmega328 Intro – fast, demo
ILI9163/ST7735 – very old, but shows color modes (12,16,18 bits)

▶️Video Guides, Tutorials

Andreas Spiess – has many videos and playlists (for some reason playlist links are S̶t̶r̶i̶k̶e̶-̶t̶h̶r̶o̶u̶g̶h̶ here).
E.g. for ESP32 with Arduino, STM32, Bluetooth, LoRa and more.

#214 New: Easier ESP32 installation in Arduino IDE (How to)
#345 ESP32 vs STM32: Which one is better (Bluepill)

Kolban Technical Tutorials for ESP32 – with many modules.

BnBeClub – various projects and electronics tutorials.

GreatScott – Electronic Basics – general electronics tutorials.

Shawn Hymel Presents: Introduction to RTOS
a good advanced tutorial about RTOS (operating system, also used in ESP32).

🔋Battery related

#193 Comparison of 10 ESP32 Battery powered Boards without display (incl. deep-sleep)
How to power the 3.3V ESP32 from a 3.7V Li-ion battery
#351 10 Battery Power Boards for Raspberries and ESPs
ESP32 Deep Sleep Tutorial for Low Power Projects

🖥️Library links, for displays

ILI9341_T4 for Teensy 4
ILI9341_t3n
ILI9163C display, fast
ST7735_3d_filled_vector for STM32
ST7735 display, fast for Teensy

cbm80amiga – optimized for many displays
Nokia-5110-LCD-library
SSD1306 OLED
Adafruit-GFX-Library base drawing library


🖥️Displays

There are many others, I listed those which I recommend. (I already used 2 to 4 in my projects).

RowType🖥Controller chip💰Price $Size, InchSize, cmWidth, XHeight, YColors, bitBuffer size kB
1LCD B/W😡Nokia 5110, 33101.5-2.51.7?4.3?84481504 B
2OLED, I2C or SPISSD1306~20.96″-1.3″2.51286411
3LCD, SPIST77354-51.8″4.516012816 (12, 18)?40
4LCD, SPIILI93418-92.4″, 2.8″6.1, 7.132024016150
5LCD, SPIILI9486
ILI9481 IPS
10-123.5″8.948032016300

Prices are from AliExpress. No need to waste more money for same thing, if you are okay with waiting more.

Size – is the diagonal length (in inches and centimeters).

Resolution is simply width (X) by height (Y) in pixels (or other way if you prefer).

Colors – 1 bit means mono. OLEDs are available as blue, white or even part orange part blue.
For 16 bit (1 word) this means RGB565, so Red, Green, Blue color components use 5, 6, 5 bits respectively.

Updating

In my projects I always want smooth drawing without flickering, so full screen is always updated.

You don’t need this way, in fact, there are plenty of videos and projects where a bigger display is used and it is updated slowly and/or partly each time.
Personally I really don’t like the blinking and slow updates.
But if you’re okay with this you can skip the rest here.

Buffer size

The last column Buffer size is how much memory you would need to have whole display buffer on MCU (in SRAM).
This is computed as: width * height * bits / 8. For example (row 3 in table): 160 * 128 * 16 / 8 = 40960 B = 40 kB (k is 1024).

For this, I use a MCU that has more SRAM than this buffer size for chosen display.
For example the 160 x 128 display needs 40 kB and I used it with Teensy 3.2 which has 64 kB SRAM.

I also like to have at least double that. This way I can do double buffering:
meaning CPU draws in one buffer, while DMA reads the other buffer and sends to SPI as fast as possible.


📻Radio and network

LAN and WiFi allow local network or internet access for MCU.
The rest needs at least 2 modules (and 2 MCUs) to communicate with each other.

LAN

Internet or local network access is possible using Ethernet modules.
They use SPI on microcontroller and have a RJ45 connector which needs a cable plugged to a switch or router.
Seems complicated and less popular.

WiFi

Wi-Fi Is quite popular. ESP32📡 boards already have it, and use separate CPU core for it.
Other microcontrollers can access network with WiFi modules.

LoRa

For long range, but very slow transmission speeds. No paying, no need for SIM card makes it great.
Andreas Spiess has many videos on this topic.

Bluetooth

Bluetooth is short range (up to 10 meters), so likely for in house (in car) use only.
There are Bluetooth modules for it.
Many common devices already use it (e.g. for audio) and it has a big standard too.

Radio Frequency modules

RF modules are quite cheap and libraries for them are available.
For example: 433 MHz (need bigger antennas) or 2.4 GHz (already have small antennas) nRF24L01+.
I think they are best for custom remote controllers and sending data, when IR (infrared) is not enough.


📊IDEs (code/program editors)⌨️

An IDE (Integrated Development Environment) is the PC program where you spend time:
editing your program / code for MCU, building it, and best also uploading.

Naturally, it needs to be a nice experience.
So IDE should help you doing your thing, and not making it difficult to do something.

Of course you could do it all in separate programs but it needs more switching and is way more inconvenient
(e.g. I did edit code in VS 2008, build in cygwin and upload using Teensy loader app).

I only list 3 IDEs here.
Those which are Cross-Platform (i.e. will work on GNU/Linux, Windows or Mac)
and are (at least) free to use.

There are many more possible, and some only for Windows, which is bad especially if a MCU producer requires you to use it.

I wrote good and bad things for them, of course from my point of view and experience.

Arduino IDE

I mean the old 1 version. IMHO, this shouldn’t be really in this list, as it isn’t an actual IDE, for me it is just a better notepad.
But it is (still) really popular and quite easy to start.
Seems to be standard basic “IDE” for few MCUs (or only one supported).

✅Good

  • Very popular
  • Comes with many libraries and examples (mainly for Arduino boards).
  • Supports lots of boards with extensions.
  • It can find and install more libraries, boards and examples for them
  • Has serial monitor (console for printing) and even serial plotter for graph.
  • Plenty of documentation and guides e.g. how to start, official website.

❌Very Bad

  • No IDE features: jump to definition, code suggestions, find references…☠️
    So it doesn’t allow learning from code.
  • All source in 1 file (.ino)
  • Primitive / basic / ugly look. No skins / themes.
  • Has almost nothing in Preferences.
  • Needs Java.
  • Other reasons to not use it here or older here, e.g. no debugging support.

✔️Conclusion

So I’d say: it is okay to get you started fast. But I’d recommend going away from it, as soon as possible.
If your program is more than 100 lines or you want to enjoy and learn programming, then don’t use it (for long).

VS Code / VSCodium

This is my recommendation. At least for code editing.

Using Arduino extension in it, makes Arduino IDE obsolete. Well, if it works for you, since many complain about bugs.
Still it requires Arduino to be installed as is uses its tools, compiler etc.

✅Good

  • A really awesome editor, that can be turned into full IDE.
  • Fast Git committing and pushing.
  • Extremely fast search in files.
  • Integrated diff features all from editor when comparing.
  • Smooth layout display and themes.

❌Bad

  • Needs some effort to set up.
  • Needs many extensions to be great e.g. C/C++, Git.
  • Not much in main Menu and no icons in it.
  • Plenty of options in long scrollable “website like” form, easy to get lost.

Eclipse based

✅Good

  • Popular and it works (since a long time).
  • Has many variants, for specific MCU or language.
    E.g. Ac6 System Workbench for STM32 bluepill on openstm32 website (needs creating account to download).
  • Preferences with tree view like in Visual Studio (but it still doesn’t remember its size).

❌Bad

  • Slow
  • Rather old look
  • Needs Java
  • Somewhat complicated IDE (is also for Java, C++ with CDT, Python etc.)
  • Also no icons in main menu

Web based editors

I don’t recommend writing code for your MCU on a website. Honestly I can’t see it as a good life time solution.
The only reason I see for it, is that for some people, it could be easier to start coding and using MCUs on a website that already works (especially if shown by someone in video or IRL) instead of installing and configuring an IDE. But setting up an IDE is an investment that will pay off.

🧪Other developer topics

🐍Python

Lastly some MCU boards support coding in MicroPython. But it has high requirement for flash memory, and IMHO even if not interpreted (as Python), it has to be slower or bigger than C/C++ code.
But perhaps it is a way of doing some complex things faster (still, there could be some C libraries for them too).
Python is great for general PC scripts though (instead of bash or batch) where speed does not matter.

⚙️Debugging

I can say from my experience that this feature is not really needed, even for complex MCU code and projects.
I have developed K.C. and K.C.4 without it, on Teensy (it doesn’t support debugging).

If you do bad stuff in code, MCU crashes (stops). It is easy to tell, mostly right after start, and guess that what you added or changed was bad.
More trouble is when you don’t see anything. Then having a simple LEDs, Logic analyzer, or Oscilloscope (very expensive) can help understanding what happens on pins. And I also recommend adding some code to set pin for LED to light up, to know where you could go wrong in code.
Of course with working serial monitor and text prints it is easy too.

Still, debugging is a useful feature, especially for advanced topics.
STM32 allows simple SWD debugging (stepping and registers) with STLink v2.
Bigger, expensive boards have JTAG connector and allow full debugging.

🧵Threads, FreeRTOS

Normally you can do most programs on MCUs (especially older ones) without an RTOS / operating system (using just 1 main thread and interrupts).

For example: my keyboard firmwares K.C. and K.C.4 have main loop filling display buffer (then DMA sends it to display via SPI), and timer interrupt doing key matrix scans at 1kHz (can be changed) with a rare, slower 1-wire temperature sensor reading. It still works well on bare-metal, without FreeRTOS.

But if your project / program does many things at once, then it is probably time to use FreeRTOS. And get familiar with concepts of threads and synchronization, especially if you’re seeing issues. It is an advanced topic though.

I think a good video tutorial series for it is: Shawn Hymel Presents: Introduction to RTOS.
And also the big FreeRTOS documentation.