Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-cad-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '**'
pull_request:
branches:
- master
- main

jobs:
generate_3d_model:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-diff-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Build PCB Diff
on:
push:
branches-ignore:
- master
- main

pull_request:
branches:
- master
- main

jobs:
generate_diff:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-images-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '**'
pull_request:
branches:
- master
- main

jobs:
generate_2d_images:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-panel-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '**'
pull_request:
branches:
- master
- main

jobs:
generate_panel:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-pcb-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '**'
pull_request:
branches:
- master
- main

jobs:
generate_pcb:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-video-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Generate Video Frames
on:
push:
branches:
- master
- main
# pull_request:
# branches:
# - master
# - main

jobs:
generate_video:
Expand Down
5 changes: 4 additions & 1 deletion Mad_RP2040.kicad_dru
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
# Inner diameter of pad should be 0.4-0.5 mm larger than NPTH drill diameter.
# JLCPCB: "We make NPTH via dry sealing film process, if customer would like a NPTH but around with pad/copper, our engineer will dig out around pad/copper about 0.2mm-0.25mm, otherwise the metal potion will be flowed into the hole and it becomes a PTH. (there will be no copper dig out optimization for single board)."

# TODO: new rule for plated slots: min diameter/width 0.5mm
# JLCPCB: "The minimum plated slot width is 0.5mm, which is drawn with a pad."
(rule "Plated Slot Width"
(condition "A.Type == 'Pad' && A.Pad_Type == 'Through-hole' && A.isPlated() && A.Hole_Size_X != A.Hole_Size_Y")
(constraint hole_size (min 0.5mm))
)

# TODO new rule: non-plated slots: min diameter/width 1.0mm
# JLCPCB: "The minimum Non-Plated Slot Width is 1.0mm, please draw the slot outline in the mechanical layer(GML or GKO)""
Expand Down
32 changes: 16 additions & 16 deletions Mad_RP2040.kicad_pcb
Original file line number Diff line number Diff line change
Expand Up @@ -4355,7 +4355,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -7694,7 +7694,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -10876,7 +10876,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -13622,7 +13622,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -14880,7 +14880,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -18427,7 +18427,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -20282,7 +20282,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -23190,7 +23190,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -24805,7 +24805,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -30322,7 +30322,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -30764,7 +30764,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -32023,7 +32023,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -32804,7 +32804,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -34319,7 +34319,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -35438,7 +35438,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down Expand Up @@ -43589,7 +43589,7 @@
(xyz 0 180 0)
)
)
(model "${KIPRJMOD}/localLib.pretty/minspaced-choc-keycap.step"
(model "${KIPRJMOD}/3dmodels/minspaced-choc-keycap.step"
(offset
(xyz 0 0 -9.6)
)
Expand Down
88 changes: 87 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,90 @@
# Mad_RP2040

The Mad RP2040 is a a minimal 2 key keyboard. It's sole purpose is to build up my confidence in the RP2040 before doing a full sized keyboard.
A small RP2040-based keypad PCB. Originally a minimal 2-key board to build confidence with the RP2040 ahead of a full-size keyboard, it has since grown into a 4x4 "anything" keypad with a rotary encoder and per-key RGB.

**Status:** Rev B (4x4) — fabricated November 2025; controller, USB and SK6812MINI-E chain verified, but a matrix wiring error past row 1 / col 1 needs cut-and-bodge to fix on existing units. The fix is not yet in `main`, so fabbing from `main` today reproduces the same bodge. Rev A (2-key) was fabricated and tested; archived under [`resources/rev_a/`](resources/rev_a/).

The encoder footprint is on the board but has not yet been populated/tested.

![MadRP2040 top, 3/4 view, with keycaps](resources/images/Mad_RP2040-3D_blender_top.png)

## Hardware

- **MCU:** Raspberry Pi RP2040 (QFN-56)
- **Flash:** W25Q128JV (16 MB QSPI)
- **Clock:** 12 MHz ECS-2520MV SMD oscillator
- **Power:** USB-C input, NCP1117-3.3 LDO, ECMF02-2 common-mode filter / ESD protection
- **Switches:** 16x Kailh Choc v2 hotswap (12 mm) in a 4x4 matrix with 1N4148W diodes
- **Encoder:** 1x EC12 rotary encoder with switch
- **Lighting:** Per-key SK6812MINI / SK6812MINI-E RGB LEDs
- **Split support:** TRS interlink (JST-SHL/GH connectors) plus a solder-jumper hand-detect selector
- **Programming:** ARM SWD via Tag-Connect TC2030-NL footprint

Datasheets for the major parts live in [`resources/datasheets/`](resources/datasheets/).

## Repository layout

```
Mad_RP2040.kicad_pro # KiCad project
Mad_RP2040.kicad_sch # Top-level schematic
Mad_RP2040.kicad_pcb # Board layout
Mad_RP2040.kicad_dru # Design rules
Controller_RP2040.kicad_sch
MCU_RP2040.kicad_sch
Switches.kicad_sch # Hierarchical sheets
localLib.pretty/ # Project-local footprints
mad_lib/ # Submodule with shared symbols/footprints
resources/ # Datasheets, enclosure STEP, fabrication outputs
build-panel.yaml # KiBot panel config (1x2)
options.yaml # KiBot global options
```

The repo uses a git submodule for `mad_lib`; clone with:

```sh
git clone --recurse-submodules https://github.com/Cimos/Mad_RP2040.git
```

## Build & CI

GitHub Actions in [`.github/workflows/`](.github/workflows/) drive the build via [Cimos/kibot-config](https://github.com/Cimos/kibot-config):

- `build-pcb-action.yaml` — fabrication outputs (gerbers, drills, BOM, position files)
- `build-images-action.yaml` — 2D top/bottom renders
- `build-cad-action.yaml` — STEP / 3D CAD export
- `build-panel-action.yaml` — KiKit panelization (2 cols x 1 row, see `build-panel.yaml`)
- `build-diff-action.yaml` — visual diff against the base branch
- `build-video-action.yaml` — turntable / fly-through video

Each workflow uploads its results as a GitHub Actions artifact on every push.

## Firmware

Keymap and configuration are kept in separate repos:

- [`Cimos/qmk_config`](https://github.com/Cimos/qmk_config) — [QMK](https://qmk.fm/) keymap
- [`Cimos/zmk-config`](https://github.com/Cimos/zmk-config) — [ZMK](https://zmk.dev/) keymap

## Enclosure

FreeCAD-exported cases live in [`resources/enclosures/`](resources/enclosures/):

- `MadRP2040 2-Key Case.step` — Rev A test board
- `MadRP2040 Anything Case.stl` — Rev B 4x4 anything keypad

Released board CAD (STEP) snapshots live under [`resources/rev_a/`](resources/rev_a/).

## Renders

Generated by the `build-images`, `build-cad` and `build-panel` workflows from the latest `main`.

| | |
|---|---|
| ![Top, 3/4](resources/images/Mad_RP2040-3D_blender_top.png) | ![Bottom, 3/4](resources/images/Mad_RP2040-3D_blender_bottom.png) |
| ![Top, straight-on](resources/images/Mad_RP2040-3D_blender_top_straight.png) | ![Bottom, straight-on](resources/images/Mad_RP2040-3D_blender_bottom_straight.png) |

![1x2 panel](resources/images/Mad_RP2040-panel.png)

## License

Released under the [MIT License](LICENSE). Copyright (c) 2023 Simon Maddison.
Binary file added resources/enclosures/MadRP2040 Anything Case.stl
Binary file not shown.
Binary file added resources/images/Mad_RP2040-3D_blender_bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/Mad_RP2040-3D_blender_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/Mad_RP2040-panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading