You've drawn your circuit in Fusion 360 Electronics. Now someone has to look at the schematic and carefully type out which pin the LED is on, which pins the sensor uses, and so on — and re-do it every time the design changes. One typo and the firmware talks to the wrong pin.
PinmapGen does that step for you. It reads your schematic and writes the pin definitions automatically:
Your schematic says: PinmapGen writes for you:
───────────────────── ─────────────────────────────
LED_STATUS → pin GP15 → LED_STATUS = 15 (MicroPython)
BUTTON_1 → pin GP5 → #define BUTTON_1 5 (Arduino)
...plus a readable pinout document
It also checks your design while it works — it warns you if two signals share a pin, if you used a special pin (like a boot or debug pin) by accident, or if a USB data pair is missing its partner.
Every time you run PinmapGen, it creates a folder containing:
| File | What it's for |
|---|---|
pinmap_micropython.py |
Drop onto your board — pin names ready to use in MicroPython |
pinmap_arduino.h |
Include in your Arduino / PlatformIO project |
PINOUT.md |
A human-readable table of every pin — great for sharing with your team |
pinout.mmd |
A wiring diagram you can view with any Mermaid viewer |
pinmap.json |
Machine-readable data, for scripts and automation |
The fastest way to see PinmapGen work — no Fusion, no install:
-
Get the code — Download ZIP or
git clone https://github.com/zcohen-nerd/PinmapGen.git, then open a terminal in the folder. (Tagged versions are on the Releases page.) -
Supported input — a CSV netlist with
Net,Pin,RefDescolumns (Componentoptional). A ready-made one ships in the repo. -
Run it against the bundled example:
python -m tools.pinmapgen.cli --csv examples/simple_led/netlist.csv \ --mcu rp2040 --mcu-ref U1 --out-root out --mermaid
Python 3.11+ is the only requirement — PinmapGen is standard-library only, nothing to
pip install. -
Expected outputs —
out/now containspinmaps/pinmap.json,firmware/micropython/pinmap_micropython.py,firmware/include/pinmap_arduino.h,firmware/docs/PINOUT.md, andfirmware/docs/pinout.mmd. -
Validation warnings — PinmapGen prints advisories to the terminal (special/strapping pins, lonely differential-pair halves, bare-number pin names, …) and mirrors them into
pinmap.jsonundermetadata.validation_warnings. Warnings never block generation; add--strictto turn real errors (pin conflicts, dropped pins) into a non-zero exit for CI. -
See a full example —
examples/simple_led/has the input and every generated file committed, so you can diff yourout/against it.
The guided Fusion (Electronics workspace) workflow is below.
- Windows PC with Fusion 360 (the Electronics workspace). On Mac or Linux? The command line works there too.
- Python 3.11 or newer — a free download, installed once (steps below).
- This project's files — also a one-time download.
No programming experience needed for the Fusion workflow.
- Go to python.org/downloads and click the big Download Python button.
- Run the installer. Important: on the first screen, tick the box that says "Add python.exe to PATH" before clicking Install. (If you miss it, just run the installer again — it's the checkbox at the bottom.)
- That's it. You never have to touch Python directly — Fusion will use it behind the scenes.
- On this page, click the green
<> Codebutton (top right), then Download ZIP. - Right-click the downloaded ZIP → Extract All.
- Put the extracted
PinmapGenfolder somewhere easy to find and permanent, for exampleDocuments\PinmapGen. Remember this location — you'll point Fusion at it in Step 4.
(If you're comfortable with git: git clone https://github.com/zcohen-nerd/PinmapGen.git does the same thing.)
A ULP is a small script that runs inside Fusion's Electronics workspace.
- Open File Explorer, click in the address bar, paste this, and press Enter:
%APPDATA%\Autodesk\Autodesk Fusion 360\API\ULPs - Copy
PinmapGen.ulpfrom thefusion_addinfolder of your PinmapGen download into that window. - Restart Fusion 360.
- Open your design in the Electronics workspace (schematic view).
- Go to Automation → Run ULP and pick PinmapGen.
- In the dialog:
- PinmapGen repository — enter the folder from Step 2, e.g.
C:\Users\YourName\Documents\PinmapGen. You only do this once; it's remembered for next time. - MCU Type — click the button for your chip (RP2040 for a Pico, ATmega328P for an Uno, and so on — see the chip list).
- MCU Reference — the name of your microcontroller in the schematic,
usually
U1. Not sure? Click your MCU in the schematic and check its name, or use the Analyze button in the dialog. - Output directory — where the generated files should go (a sensible default is filled in).
- PinmapGen repository — enter the folder from Step 2, e.g.
- Click Generate Pinmap. When it finishes, the output folder opens in File Explorer with your files ready to use.
From now on, whenever the schematic changes, just run the ULP again — everything is remembered, so it's two clicks.
MicroPython (Raspberry Pi Pico and similar): copy
pinmap_micropython.py onto your board alongside your code, then:
from pinmap_micropython import *
from machine import Pin
led = Pin(LED_STATUS, Pin.OUT) # no pin numbers to look up — just names
led.on()Arduino / PlatformIO: copy pinmap_arduino.h into your sketch or
project's include folder, then:
#include "pinmap_arduino.h"
void setup() {
pinMode(LED_STATUS, OUTPUT);
digitalWrite(LED_STATUS, HIGH);
}For your team: PINOUT.md is a plain document listing every net, its
pin, and any warnings — perfect to attach to a design review.
Read about every output in docs/output-formats.md.
PinmapGen knows the pin rules for 13 microcontrollers out of the box:
| If your board is a… | Choose this MCU type |
|---|---|
| Raspberry Pi Pico / Pico W | rp2040 |
| Raspberry Pi Pico 2 | rp2350 |
| ESP32 dev board (WROOM) | esp32 |
| ESP32-S3 board | esp32s3 |
| ESP32-C3 board | esp32c3 |
| STM32 Nucleo / custom STM32G0 | stm32g0 |
| "BlackPill" (STM32F411) | stm32f411 |
| STM32H743 board | stm32h743 |
| nRF52840 (Feather nRF52840, DK) | nrf52840 |
| Arduino Uno / Nano | atmega328p |
| Arduino Mega 2560 | atmega2560 |
| Arduino Zero / Adafruit M0 | atsamd21 |
| Adafruit M4 boards | atsamd51 |
Using a chip that isn't listed? You can add one by writing a small text file — no programming required. See docs/extending.md.
"No entries found for MCU reference 'U1'" — the reference name doesn't
match your schematic. The error lists the reference designators the export
does contain — click your microcontroller in Fusion and check its name
(it might be IC1 or U2), then enter that instead.
"Python not found" — Python isn't installed, or the "Add to PATH" box wasn't ticked. Re-run the Python installer from Step 1 and tick the box.
The ULP doesn't appear in Fusion — make sure PinmapGen.ulp is in the
ULPs folder from Step 3, then restart Fusion completely.
"does not look like the PinmapGen repository" — the repository path in
the dialog should point at the folder that contains tools and README.md
(if you extracted a ZIP, watch out for a doubled folder like
PinmapGen-main\PinmapGen-main).
Warnings about strapping / boot / debug pins — not errors! PinmapGen is telling you a pin has a special job on your chip. Double-check those pins are safe to use for your signal, or move the signal to another pin.
Anything else from the ULP — every run writes pinmapgen_log.txt into
the output folder with the full details, and the result dialog shows it
when something needs your attention. That file is the first thing to
attach to a bug report.
More answers: docs/troubleshooting.md and docs/faq.md.
If you're comfortable in a terminal (or you're on Mac/Linux), you can skip the main ULP entirely. To get the input CSV:
- From Fusion 360 (Windows or macOS): run the bundled
fusion_addin/export_netlist.ulp— it only writes the CSV (no Windows tooling involved), so it's the Mac-friendly path: export in Fusion, then run the CLI in Terminal. - By hand or from another tool: any CSV with
Net,Pin, andRefDescolumns works (Componentis optional; headers are matched case-insensitively and common aliases likeDesignatorare accepted; comma, semicolon, or tab delimited).
Then from the PinmapGen folder:
The
Pincolumn must hold the chip's logical pin name (GP15,GPIO4,PA0) — not the physical package pad number. A bare number like2is read as GPIO 2, and PinmapGen prints a warning when it makes that assumption, because pad 2 of an RP2040 is actually GPIO 0.
python -m tools.pinmapgen.cli --csv my_netlist.csv --mcu rp2040 --mcu-ref U1 --out-root output --mermaidHandy extras:
python -m tools.pinmapgen.cli --list-mcus # see every supported chip
python -m tools.pinmapgen.cli ... --strict # fail (exit code 2) on validation errors (pin conflicts, dropped pins) — great for CI
python -m tools.pinmapgen.watch hardware/exports/ # auto-regenerate whenever a CSV changesTip for Windows: open the PinmapGen folder in File Explorer, click the
address bar, type cmd, and press Enter — that opens a terminal already in
the right place.
Full reference: docs/usage.md. Team workflows and CI recipes: docs/workflows.md.
Three complete worked examples live in examples/ — each has
the input netlist and every generated file, so you can see exactly what you'll
get before installing anything:
simple_led— LEDs and buttons (beginner)sensor_hub— I²C/SPI sensors (intermediate)communication_module— UART/CAN/USB (advanced)
- Maturity: early / alpha.
pyproject.tomlis at 0.1.0; the source is stable enough for personal, classroom, and small-team use, and the full test suite (388 tests) plus example-drift checks run on every push across Linux / Windows / macOS and Python 3.11–3.14. Check the Releases page for tagged builds; if a tag andpyproject.tomldisagree,mainis the source of truth and the CLI's--versionreports the packaged value. - Supported Fusion Electronics: the bundled scripts are ULPs (the
EAGLE-heritage scripting mechanism Autodesk Fusion's Electronics workspace
still runs via Automation → Run ULP). There is no version lock — they are
developed against current Fusion.
export_netlist.ulp(the CSV export) works on Windows and macOS; the fullPinmapGen.ulpshells out to a system-installed Python, so it is effectively Windows-first (the CLI covers macOS/Linux). Continued ULP support is Autodesk's decision, not this project's — the CLI path is the stable long-term interface. - Input: CSV (
Net,Pin,RefDes;Componentoptional) and legacy EAGLE.sch. No native KiCad.net/ Altium parser — export a CSV instead. - Coverage: 13 built-in MCU profiles (
--list-mcus); others via a TOML file, no code (docs/extending.md). - Not a schematic checker or DRC tool — it validates pin assignment (conflicts, roles, special pins), not electrical correctness. Outputs are overwritten in place on regeneration; there is no merge step.
normalize.py'sRP2040Profileshim is deprecated and slated for removal in a future release; useprofile_registryfor new code.
Bug reports and pull requests are welcome — start with
CONTRIBUTING.md. Run the test suite with
python -m unittest discover -s tests before submitting (no extra
packages needed).
PinmapGen is released under the PinmapGen Community License:
- Free for personal projects, education, and open source
- Commercial license required for business use, client work, and commercial products
See LICENSE for the complete terms.