Skip to content
Back to skills

Microcontrollers

ASecurity

This skill should be used when the user chooses or designs around a microcontroller, module, dev board or FPGA, for example "which MCU should I use", "ESP32 vs STM32", "minimum circuit for an RP2040", "STM32 boot pins", "ESP32-C3 strapping pins" or "dev board to custom PCB". It covers selection, power, clocks, reset, boot and programming pins for ESP32, STM32, AVR, RP2040 / RP2350, nRF52, SAMD, CH32 and common FPGAs. Load it before recommending or wiring a part, even for a short question, bec...

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentspythonrustgodebugginggitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 14 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add gkochievi/boulder-hardware-skills --skill microcontrollers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Microcontrollers?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Microcontrollers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gkochievi-microcontrollers/badge)](https://www.skillsdirectory.com/skills/gkochievi-microcontrollers)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: microcontrollers
description: This skill should be used when the user chooses or designs around a microcontroller, module, dev board or FPGA, for example "which MCU should I use", "ESP32 vs STM32", "minimum circuit for an RP2040", "STM32 boot pins", "ESP32-C3 strapping pins" or "dev board to custom PCB". It covers selection, power, clocks, reset, boot and programming pins for ESP32, STM32, AVR, RP2040 / RP2350, nRF52, SAMD, CH32 and common FPGAs. Load it before recommending or wiring a part, even for a short question, because its tables carry the pins and limits from the makers' documents.
user-invocable: false
---

# Microcontrollers, modules and dev boards

Choose the controller and draw its minimum circuit correctly. Each family has its own traps (strapping pins, boot modes, crystals, flash, 5 V tolerance, debug pins); the references hold them per family with sources. Firmware, toolchains and flashing are in `embedded-firmware`; the board layout is in `pcb-design` and `kicad-generator`.

## Choose

1. **Radio first:** Wi-Fi, BLE, Thread / Zigbee / Matter, LoRa, cellular or none. It narrows the vendors most (`references/mcu-selection.md` section 2).
2. **Count I/O by type** (digital in / out, ADC, PWM, UART, I2C, SPI, CAN, USB device or host, Ethernet) and add 25 % spare. Slow I/O can go on I2C expanders.
3. **MCU or Linux:** a display UI with a browser, a camera pipeline, a full network stack with many protocols or several GB of storage points to an MPU running Linux (`embedded-linux`, section 1 of its SKILL.md); otherwise stay on an MCU.
4. **Supply and logic level:** 5 V logic → AVR or CH32V003 (or an STM32 with FT pins); battery → sleep current with RTC and RAM retained.
5. **Form:** certified radio module (default) > bare chip (volume only) > dev board on a carrier (prototypes, under about 100 units, or when the client wants replaceable boards).
6. **Availability and cost:** LCSC stock, JLCPCB library class (most MCUs are Extended), whole-BOM cost (RP2040 needs flash and a crystal; an ESP32 without native USB needs a USB-UART bridge).
7. Record the choice with the two runners-up and why in the decision log (`/engineering:architecture` if the Engineering plugin is installed).

Default picks (`references/mcu-selection.md` has the full table):

| Need | Default | Also consider |
|---|---|---|
| Wi-Fi, small and cheap | ESP32-C3 module | ESP32-C2, ESP32-C6 (Wi-Fi 6, Thread) |
| Wi-Fi, many pins, PSRAM, USB OTG, displays | ESP32-S3 module | ESP32-P4 + radio for camera / MIPI |
| Bluetooth Classic (audio, SPP) | classic ESP32 | |
| BLE with USB, Thread / Matter, Arduino / CircuitPython support | nRF52840 module (Raytac MDBT50Q or Ebyte E73-2G4M08S1C; check stock) | nRF5340 |
| BLE, lowest power, no USB | nRF54L15 (nRF Connect SDK) | nRF52832 module for cost-down |
| Thread / Zigbee / Matter | ESP32-C6 (mains), ESP32-H2, nRF52840 / nRF54L15 | EFR32MG24 |
| Cheap 32-bit control | STM32C0 / G0, CH32V003 | GD32, Artery AT32 (check tooling) |
| Motor control, precision analog | STM32G4 | SAMD51, external ADC |
| USB device (HID, MIDI, MSC), PIO, easy 32-bit | RP2040 / RP2350 | STM32F072 (crystal-less USB), SAMD21, ATmega32U4 |
| 5 V 8-bit | AVR DA / DB or tinyAVR 1-series (UPDI) | ATmega328P only for existing Arduino code and shields |
| Fast DSP and audio | Teensy 4.x (i.MX RT1062) | STM32H7 |

## Minimum circuit checklist (every family)

- **Power:** every VDD pin decoupled per datasheet (typically 100 nF each plus bulk), analog supply filtered, core regulator parts (VCAP, VREG, DC/DC inductor) exactly as the reference design.
- **Reset:** pull-up plus capacitor where the datasheet asks, wired to the debug header; a reset key or pads.
- **Boot / strapping:** the boot pin of the chip in hand with its firm pull and a key; nothing else on strapping pins that could change the level at reset.
- **Clock:** crystal or oscillator where required (USB on many parts, RP2040's 12 MHz, BLE's 32 MHz), load capacitors computed, routed short.
- **Program and debug:** a way to flash a blank chip on every board (USB ROM bootloader, UART, SWD, ISP, UPDI, SWIO) on a header, pads or Tag-Connect, even when a bootloader is planned.
- **USB:** ESD array at the connector, 5.1 kΩ per CC pin on a USB-C device, series resistors only where the chip's guide asks (RP2040 27 Ω; ESP32 native USB 22–33 Ω footprints near the chip; STM32 none).
- **Pins:** check 5 V tolerance, current per pin and per port, ADC channels that stop working with the radio on (ESP32 ADC2), input-only and flash / PSRAM pins. For ESP32 parts run `scripts/esp32_pincheck.py --chip <chip> [--module <module>] config.h` before freezing the schematic or `config.h`: it flags strapping, flash / PSRAM, input-only, USB, JTAG and ADC2 conflicts from Espressif's datasheets.

## Boot and programming per family

| Family | Program a blank chip | Boot / bootloader entry | Traps |
|---|---|---|---|
| ESP32 / S2 / S3 | USB (S2 / S3 native) or UART0 | GPIO0 low at reset | S3: GPIO45 / 46 straps, octal PSRAM takes GPIO35–37; classic ESP32: GPIO12 must not be high at reset (3.3 V flash) |
| ESP32-C2 / C3 / C6 / H2 | USB-Serial/JTAG (C3 / C6 / H2) or UART0 | GPIO9 low at reset | GPIO8 must be high for download; C3 GPIO2 does not select the boot mode but Espressif recommends a pull-up, so 10 kΩ pull-ups on GPIO2 / GPIO8; native USB is console / JTAG only, not a general USB device |
| ESP32-C5 | USB-Serial/JTAG or UART0 | GPIO28 low at reset | GPIO27 must be high; several strapping pins float by default: define their reset level |
| ESP32-P4 | USB-Serial/JTAG or UART0 | GPIO35 low at reset | GPIO36 must be high; no radio (pair it with an ESP32-C6 or similar) |
| STM32 | SWD (SWDIO, SWCLK, NRST, GND, VDD) | BOOT0 high (or option bytes on G0 / C0 / G4) → ROM bootloader (UART; USB DFU on many USB parts, not the F103: check AN2606) | read option bytes before trusting BOOT0; RDP level 2 is permanent |
| ATmega / classic AVR | ISP 2×3 header | Optiboot over UART after reset (DTR auto-reset) | new chips run at 1 MHz (8 MHz RC ÷ 8) without bootloader, so ISP clock below 250 kHz; never set RSTDISBL |
| tinyAVR 0/1/2, megaAVR 0, AVR Dx | UPDI (USB-UART + Schottky + 470 Ω) | optional serial bootloader | tinyAVR / megaAVR 0: UPDI shares the reset pin; do not reconfigure it without an HV programmer |
| RP2040 / RP2350 | USB ROM bootloader (UF2 drive) or SWD | BOOTSEL (QSPI_SS low through 1 kΩ) at reset | needs a 12 MHz crystal for the USB bootloader; external QSPI flash |
| nRF52 / nRF54 | SWD (Tag-Connect or 10-pin 1.27 mm) | UF2 / serial DFU bootloader if flashed | firmware expecting a 32 kHz crystal hangs without one; DC/DC enabled without its inductor leaves the core without supply |
| SAMD21 / SAMD51 | SWD | UF2 bootloader by double-tap reset | blank chips have no bootloader |
| CH32V003 | SWIO on PD1 with WCH-LinkE | — | never reuse PD1; SOP-8 version bonds pins together |

## From dev board to custom PCB

1. Read the dev board's schematic: which pins are taken by LEDs, buttons, auto-program circuits, PSRAM, USB bridges or RF switches.
2. Move to the module the dev board uses (same pin numbering, same certification) rather than the bare chip.
3. Keep the dev board's boot and reset circuit, its USB protection and its programming path; drop its high-quiescent LDO on a battery design.
4. Write the pin map once in `netlist.py` and the firmware `config.h`, with D-pin labels translated to GPIO numbers.
5. Start from the matching `kicad-generator` template when one exists (below).

## Templates in kicad-generator

| Template | Chip | Shows |
|---|---|---|
| `kicad-generator/templates/esp32-s3` | ESP32-S3-WROOM-1 | buck + LDO, USB-C native USB, EN / BOOT, I2C port, MOSFET output, 2 or 4 layers |
| `kicad-generator/templates/esp32-c3` | ESP32-C3-WROOM-02 | USB-C native USB-Serial/JTAG, strapping pulls on GPIO2 / 8 / 9, antenna at the edge |
| `kicad-generator/templates/stm32f072` | STM32F072CBT6 | crystal-less USB, BOOT0 key for the ROM bootloader, NRST, SWD Tag-Connect |
| `kicad-generator/templates/atmega328p-nano` | ATmega328P-AU | Arduino Nano pin order (rows 1.0 in apart), CH340C, 16 MHz crystal, ISP header, auto-reset with RESET clamp |
| `kicad-generator/templates/atmega328p-nano-dropin` | ATmega328P-AU | true drop-in Nano: 18 × 43.2 mm, rows 0.6 in apart, parts on both sides, VIN buck, ISP through the header pins |
| `kicad-generator/templates/rp2040` | RP2040 | W25Q128 QSPI flash, 12 MHz crystal with 1 kΩ, BOOTSEL / RUN keys, 27 Ω USB, SWD |
| `kicad-generator/templates/nrf52840` | Raytac MDBT50Q-1MV2 | module in normal-voltage mode, native USB, SWD Tag-Connect, reset and LED; an E73-2G4M08S1C version waits for Ebyte's land-pattern drawing |
| `kicad-generator/templates/ch32v003` | CH32V003F4U6 | 3.3 V from USB-C power, SWIO pads, key and LED, smallest board |

Each template's README lists its parts and what was checked; all except `esp32-s3` also have a "Not verified" section (stock, datasheet details), and the `esp32-s3` README asks you to verify every LCSC number in `parts.json`.

## References

| File | Use for |
|---|---|
| `references/mcu-selection.md` | decision procedure, wireless and USB shortlist, comparison table, chip vs module vs dev board, power numbers, radio certification, dev boards per family, worked example |
| `references/esp-family.md` | every ESP chip, which one to pick, boot and strapping pins per chip, minimum circuit, auto-program circuit, download mode, power classes, modules and certification, dev kits and their quirks |
| `references/stm32.md` | families, power and VCAP, NRST, boot and option bytes, clocks, crystal-less USB, SWD header, 5 V tolerance, ADC, read protection, programming, toolchains, Nucleo and Black Pill, CubeMX pin planning, minimum BOM |
| `references/avr-and-arduino.md` | ATmega328P / 2560 / 32U4, ATtiny85 / 84, tinyAVR and AVR Dx with UPDI, fuses and avrdude, USB-UART bridges, Arduino boards, prototype to PCB, shields, 5 V / 3.3 V pitfalls |
| `references/rp2040-rp2350.md` | power, QSPI flash, 12 MHz crystal, USB, RUN / SWD, GPIO, ADC, PIO, RP2350 differences, boards, toolchains, programming, pitfalls, minimum BOM |
| `references/nrf52-nrf54.md` | chip comparison, module or chip, power modes (VDDH), clocks, antenna, USB, debug and NFC pins, current, certification, DKs, nRF Connect SDK, bootloaders, programmers, bare-chip checklist |
| `references/fpga-and-cpld.md` | when an FPGA / CPLD beats an MCU, configuration, power and sequencing, I/O banks, clocking, PCB notes, MCU + FPGA partitioning, soft cores, HDL workflow, CPLDs, a beginner path |
| `references/fpga-families-and-toolchains.md` | FPGA families and part status (Lattice, Gowin, AMD, Altera, Microchip, Efinix), vendor tools and licences, the open-source flow (Yosys, nextpnr, IceStorm, Apicula, OSS CAD Suite) |
| `references/samd-ch32-and-others.md` | SAMD21 / 51, CH32V003 / V203 / V307 / CH552 / CH58x, GD32, Renesas RA4M1, i.MX RT (Teensy), EFM8 / EFR32, PIC, MSP430, AT32, cheap-MCU comparison |

## Scripts

| Script | Use for |
|---|---|
| `scripts/esp32_pincheck.py` | check an ESP32 / S2 / S3 / C3 / C6 / H2 pin map (header `#define`s, JSON / YAML / TOML or `--pin` flags) against strapping, flash / PSRAM, input-only, USB, JTAG and ADC rules; `--module` for module-reserved pins; data with sources in `scripts/data/esp32_pins.json`; `--json` output |

## Related skills

- `embedded-firmware`: toolchains (Arduino, PlatformIO, vendor SDKs, Zephyr, MicroPython), flashing and debugging, production firmware rules.
- `electronics-fundamentals`: the circuits around the MCU (level shifting, drivers, power, ADC front ends).
- `peripherals`: displays, sensors, radios, storage and audio parts on the MCU's buses.
- `pcb-design/references/esp32-hardware.md`: ESP32-S3 layout details (antenna, USB-C, EN, decoupling).
- `embedded-linux`: when the product needs an MPU and Linux instead of an MCU.
- `iot-systems`: radios and protocols once the MCU is chosen (MQTT, BLE, LoRaWAN, cellular, Thread / Matter).

## Next step

When this is done, say what comes next: `peripherals` and `interfaces-and-protocols` for what connects to the MCU, `kicad-generator` for the template with this MCU, `embedded-firmware` for the code.

Files in this skill

  • SKILL.md12 KB
  • references/avr-and-arduino.md29.9 KB
  • references/esp-family.md31.1 KB
  • references/fpga-and-cpld.md34.7 KB
  • references/fpga-families-and-toolchains.md17 KB
  • references/mcu-selection.md35.3 KB
  • references/nrf52-nrf54.md35.3 KB
  • references/rp2040-rp2350.md24.4 KB
  • references/samd-ch32-and-others.md26.1 KB
  • references/stm32.md28.9 KB
  • scripts/data/esp32_pins.json43.8 KB
  • scripts/esp32_pincheck.py36.4 KB
  • scripts/tests/fixtures/field_controller_config.h1.9 KB
  • scripts/tests/test_esp32_pincheck.py20.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.