ANAVI Macro Pad 10 & Knobs

Small, programmable, open source input devices with clickable rotary encoders

Oct 26, 2022

Project update 5 of 11

Why is CircuitPython Good for Mechanical Keyboards?

by ANAVI Technology

1991 was a remarkable year for computer science and the open source movement. On February 20th, Guido van Rossum released the first version of Python and then, several months later on August 25th, then 21-year old Linus Torvalds announced the first version of what would become Linux. Now, 31 years later, both projects are more popular than ever!

Python is a general-purpose programming language. It supports both object-oriented programming and structured programming which makes Python suitable for a broad range of tasks. MicroPython and CircuitPython are Python 3 variants optimized for constrained devices, primarily microcontrollers. MicroPython appeared in 2014. Three years later, in July 2017, MicroPython was forked into another open source project called CircuitPython. There are some differences, most notably that each of them supports a different set of hardware devices.

CircuitPython is very simple to use. The idea is for it to be accessible to students and beginners. Its development is supported by Adafruit Industries. CircuitPython runs on Raspberry Pi RP2040 microcontrollers and, as you know from our previous update, ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1 all rely on the XIAO module from Seeed Studio with RP2040.

A classical mechanical keyboard consists of keys (mechanical switches with keycaps) wired to a microcontoller. There are a huge variety of models, variants, and manufacturers of mechanical switches. For example, the ANAVI Macro Pad 10 comes with Gateron red mechanical switches, but the hot-swap sockets allow you to actually use any other kind of Cherry MX compatible switch. Firmware on the microcontroller maps the keys to specific characters.

In general, a microcontoller has a limited number of GPIO (general-purpose input/output) pins, so the keya are most commonly organized in a matrix. For example, ANAVI Macro Pad 10 is designed with a three-by-three matrix which only requires six GPIO pins instead of nine. The role of the firmware is to detect when a key is pressed and then send a specific character or sequence of characters (i.e., a macro) to the computer.

In the previous update, we announced that QMK is being ported to ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1. However, out of the box we will ship all these keyboards with KMK firmware written in CircuitPython.

Ease of use combined with the power of the RP2040 makes CircuitPython a very good programming framework for implementing mechanical keyboard firmware. Of course CircuitPython is not as fast as C, but the RP2040 is a dual-core Arm Cortex-M0+ processor with a clock running up to 133 MHz. Furthermore it has 264kB on-chip SRAM which is more than enough for keyboard firmware. Thanks to the powerful microcontoller, it’s easy to get started and customize keyboard behavior directly by altering the CircuitPython source code. There’s no need to install complex toolchains or to cross-compile the source code. With KMK, it is easy to edit CircuitPython on pretty much any operating system, no matter if you are a Windows, MacOS or a Linux user.

Of course, since ANAVI Macro Pad 10, ANAVI Knobs 3 and ANAVI Knob 1 are entirely open source projects, you have the freedom to replace the default firmware with whatever you like, no matter if it is KMK, QMK or anything else!

Thanks,

Leon


Sign up to receive future updates for ANAVI Macro Pad 10 & Knobs.

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects