Initial version of firmware on git

A project log for RGB macropad custom firmware

Custom firmware for the CH552 found in those USB RGB macropads with a rotaty knob

biemsterbiemster 03/20/2023 at 15:550 Comments

The linked github repository now has a very early version of the firmware. It should be compiled with ch55xduino, just like the other code snippets in the other logs. It is not possible yet to configure which keys are send, it his hardcoded (but straightforward to change) like this:

Next up is to make this easily configurable, without reprogramming the firmware. I'm planning to have the values on the internal eeprom, with an easy way to change them.

A couple things that came up when creating this:

  1. The USB HID code disables the automatic jump-to-bootloader in ch55xduino, so every time you want to reflash the ch552, you'll have to open up the keypad and connect the testpads connected to P3.6.
  2. The ch55xduino IDE changed the bootloader access method from P1.5 to GND, to P3.6 to 3v3. This is unfortunate, because programming the chip using P1.5 would be possible without opening up the pad since the right key is connected to the pin adjacent to P1.5, and pulls that to GND when pressed.
  3. Ch55xduino has examples where you can use both USB CDC and USB HID together (comport + keyboard), but that does not seem to work on my ch552. Only the HID shows up when I connect it to my linux machine.
  4. The jump-to-bootloader function does not seem to work, which is odd because I use exactly the same code as the USB CDC of ch55xduino, which does work properly also on my chip. So more research is needed here.
  5. Bootloader access is also needed to write to the EEPROM, which will be used to reconfigure which characters are returned on keypress.
  6. Debounce is not yet implemented, although I did not notice any bouncing yet.

Concluded, there are some loose ends still in need of wrapup, but the code in is already quite usable.