Skip to content

Repository files navigation

Macro Microcontroller 2

A macropad and RP2040 microcontroller development board that allows you to control GPIOs with keyboard keys combined on a single PCB, with a custom BASIC interpreter.

Documentation: https://nicholaslim.me/macro-microcontroller-2

View hardware demonstration at https://nicholaslim.me/macro-microcontroller-2/assets/hardware-demo.mp4!

What's New?

  1. Microcontroller unit directly soldered on board!
  2. More output devices with speed and volume adjustments (Buzzer and motor).
  3. More ways to power the board (Barrel jack, USB, GPIO pins).

What Does it Do?

Macro Microcontroller 2 allows you to control GPIO pins using macropad-like keys and from the serial terminal using the built-in Macro Microcontroller BASIC Interpreter. It offers more ways to control GPIOs by having builtin keys that can be programmed to your own needs.

Enclosure

Firmware

Macro Microcontroller BIOS

A basic BIOS-like firmware, which performs basic POST routines and reports information on the device. Source code.

 _  _
| \/ | Macro Microcontroller BIOS Version 0.0.1.
|_\/_| Copyright (C) 2025-2026 Nicholas Lim.

Device: Macro Microcontroller 2 (RP2040 @ 125MHz)
Serial Number: E465B8F41B502E30
RAM Free: 254K OK
Serial Status: Connected

Press SW1 to enter Macro Microcontroller BASIC.
Press SW2 to enter BOOTSEL mode.

Booting system...

Macro Microcontroller Disk Operating System (work in progress)

A simple DOS-like environment that boots from the BIOS. Source code.

Available commands:

  1. HELP: Launches the help guide.
  2. ECHO: Echoes text.
  3. LS: Show directory listing.
  4. SYSTEM: Starts another Macro Microcontroller DOS console.
  5. EXIT: Stops all processes for power off.

Macro Microcontroller BASIC Interpreter

A BASIC interpreter written in C for Macro Microcontroller, providing a simple coding environment via a serial terminal. You may view a demo at Assets/firmware-demo.mp4. Currently available statements:

  1. PRINT: Outputs text to the serial terminal.
  2. LET: Assigns a value (integer, float or string) to a variable (Only one variable is allowed for now).
  3. INPUT: Assigns a value (integer, float or string) to a variable via user input.
  4. GPIO: Turns on a specified GPIO pin for 1 second.
  5. LSVAR: Outputs variable name and their value to the serial terminal.
  6. END: Clears variable and reset line numbers.
  7. EXIT: Puts the device into sleep/power off mode.
  8. KEY: Pass GPIO controls to the macropad.
  9. REM: Add comments to your program.

For example programs, see Firmware Files/example.bas.

Schematics

View PCB file at https://kicanvas.org/?repo=https%3A%2F%2Fgithub.com%2FNicholas1023%2Fmacro-microcontroller-2%2Fblob%2Fmain%2FPCB%20Files%2Fmacro-microcontroller-2.kicad_pcb!

Repository Structure

main
 ├── /docs ← Documentation website and datasheet files are here
 ├── /Assets ← Images and videos are here
 │     └── /Journal ← Images for JOURNAL.md
 ├── /PCB Files ← .kicad_ files are here
 ├── /Production Files ← Gerber and BOM files are here
 ├── /Printing Files ← STLs are here
 ├── /Firmware Files ← Firmware files are here
 ├── JOURNAL.md ← Devlogs
 ├── README.md ← This file
 ├── LICENSE.txt ← License
 └── schematics.pdf ← Schematics

Bill of Materials (Excluding DNP)

Component Ref Designator Qty Footprint
HMB1206-03 BZ1 1 Buzzer_12x9.5RM7.6
Capacitor 0.1uF C1, C2, C3, C4, C5, C6, C7, C10, C11 9 0402
Capacitor 8pF C8, C9 2 0402
THT LED D1, D2, D3 3 LED_D5.0mm
SMD LED D4 1 0603
USB-B Micro Port J1 1 USB_Micro-B_Molex_47346-0001
Barrel Jack J3 1 BarrelJack_Horizontal
2.54 1x05 Pin J4 1 PinHeader_1x05_P2.54mm_Vertical
2.54 1x02 Pin M1 1 PinHeader_1x02_P2.54mm_Vertical
Resistor 27ohm R1, R6 2 0402
Resistor 220ohm R2, R4, R5, R7 4 0402
Resistor 5kohm R3, R8, R9 3 0402
Potentiometer RV1, RV2 2 Potentiometer_Vishay_T73YP_Vertical
Cherry MX Keys SW1, SW2, SW3 3 SW_Cherry_MX_1.00u_PCB
Reset & Boot Button SW4, SW6 2 SW_Push_SPST_NO_Alps_SKRK
DIP Switch SW5 1 SW_DIP_SPSTx02_Slide_9.78x7.26mm_W7.62mm_P2.54mm
RP2040 U1 1 QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mm
TLV71311PDBVR U2 1 SOT-23-5
XC6206P332MR U3 1 SOT-23-3
W25Q128JVP U4 1 WSON-8-1EP_6x5mm_P1.27mm_EP3.4x4.3mm
TPS76350 U6 1 SOT-23-5
NX3225SA-12MHz Y1 1 Crystal_SMD_3225-4Pin_3.2x2.5mm

Legal

Hardware files ("PCB Files", "Printing Files", "Production Files", "schematics.pdf") are licensed under the terms of the CERN-OHL-P-2.0 License. See LICENSE.txt.

Documentation files ("docs", "Assets", "JOURNAL.md") are licensed under the terms of the MIT License. See docs/LICENSE.txt.

For firmware files ("Firmware Files"), please refer to the respective file headers for licensing and copyright information.

Macro Microcontroller BIOS, Macro Microcontroller DOS and Macro Microcontroller BASIC compiles source code from the Pico SDK. See Firmware Files/pico_sdk_import.cmake for the Pico SDK license and copyright notice.

About

Macro Microcontroller 2, a macropad + microcontroller that controls GPIO pin output using keys with a custom BASIC interpreter firmware.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages