The MacroPad plus is a versatile extension for your keyboard that has six programmable keys and a rotary encoder knob. These buttons and the knob can be configured to perform a variety of actions, such as triggering specific key combinations, mouse movements, and game controller inputs. You can easily modify the firmware used to operate the MacroPad to suit your needs.
Each button and knob on the MacroPad also has addressable LEDs (NeoPixels), which can be programmed in the same way as the keys. This lets you customize the colors, patterns, or animations of your device.
Connecting the MacroPad to your PC is easy - simply plug it in via USB. It's immediately recognized by your PC as an HID composite device, so no special drivers are needed. This makes the MacroPad a user-friendly and accessible option for anyone looking to enhance their keyboard's capabilities.
The CH552G is a low-cost, enhanced E8051 core microcontroller compatible with the MCS51 instruction set. It has an integrated USB 2.0 controller with full-speed data transfer (12 Mbit/s) and supports up to 64 byte data packets with integrated FIFO and direct memory access (DMA). The CH552G has a factory built-in bootloader so firmware can be uploaded directly via USB without the need for an additional programming device.
The definition of the macros and their assignment to individual key events is done by adjusting the firmware accordingly, which allows maximum freedom and flexibility. To do this, open the macropad_plus.c file and edit the section with the macro functions. The source code is commented in such a way that it should be possible to make adjustments even with basic programming skills.
If you're using Linux, you don't need to install a driver. However, Linux may not give you enough permission by default to upload your code with the USB bootloader. To resolve this issue, you can open a terminal and enter the following commands:
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="4348", ATTR{idProduct}=="55e0", MODE="666"' | sudo tee /etc/udev/rules.d/99-ch55x.rules
sudo service udev restart
If you're using Windows, you'll need to install the CH372 driver, which you can download from this link. Alternatively, you can use the Zadig Tool to install the correct driver. Simply click on "Options" and "List All Devices" to select the USB module, and then install the libusb-win32 driver. To do this, make sure the board is connected and the CH55x is in bootloader mode.
When you connect a brand new chip to your PC via USB, it automatically starts in bootloader mode. However, after firmware has been uploaded, the bootloader must be started manually for new uploads. To do this, you need to disconnect the board from the USB port and all voltage sources, then press and hold the BOOT button while reconnecting the board to the USB port of your PC. The chip will start again in bootloader mode, and you can release the BOOT button and upload new firmware within a few seconds.
Once the MacroPad firmware is installed, you can enter the bootloader by holding down the rotary encoder switch while connecting the device to the USB port. This way, you don't need to open the case to install new firmware. All NeoPixels will light up white while the device is in bootloader mode, which lasts for about 10 seconds.
Install the SDCC Compiler. In order for the programming tool to work, Python3 must be installed on your system. To do this, follow these instructions. In addition pyusb must be installed. On Linux (Debian-based), all of this can be done with the following commands:
sudo apt install build-essential sdcc python3 python3-pip
sudo pip install pyusb
make flash
to compile and upload the firmware. python3 ./tools/chprog.py macropad_plus.bin
.Install the Arduino IDE if you haven't already. Install the CH55xduino package by following the instructions on the website.
This work is licensed under Creative Commons Attribution-ShareAlike 3.0 Unported License. (http://creativecommons.org/licenses/by-sa/3.0/)