Open hansemro opened 1 year ago
Mainline port of QMK: https://github.com/hansemro/qmk_firmware/tree/pok3r_rgb_dev
MBIA043 driver is not yet included but is being worked on.
Also, this port disables watchdog timer to prevent the keyboard from resetting. Related change: https://github.com/hansemro/qmk_firmware/blob/4c39e29d7b4b4e1340ff32ab6d9630b5812aadcd/keyboards/vortex/pok3r_rgb/boards/CYKB167_D_V03/board.c#L114-L115
Dev branch with partially working MBIA043 driver: https://github.com/hansemro/qmk_firmware/tree/pok3r_rgb_mbia043_dev
The main issue I am facing is that the 2nd MBIA043 (U8) is not functioning. I checked that it is receiving 5V and the pins appear connected correctly, but it is not driving LEDs or shifting data out of SDO. I don't have a scope or logic analyzer currently, so I cannot check the pins clearly or easily.
DCLK, GCLK, LE, and SDI pins are okay.
However, U8's SDO appears stuck on low when shifting 1 and 0s.
while (1) {
mbia043_shift_data(1U << 15, 1);
wait_ms(2000);
mbia043_shift_data(0, 1);
wait_ms(2000);
}
Update:
Fixed in https://github.com/hansemro/qmk_firmware/commit/7db2a0dfe801f16947066011bd57a37c5a937a10. Issue was related to bad GPIO configuration (opendrain should be used since there are pull-up resistors to 5V).
MBIA043 demo on POK3R RGB:
I need to fixup a few things, but RGB lighting is working!
Caps Lock RGB LED at (row 6, col 2) in LED matrix.
Space's Left RGB LED at (row8, col 2).
Space's Right RGB LED at (row 9, col 3).
Although currently unstable, SPI flash support can be enabled by uncommenting these lines in rules.mk: https://github.com/hansemro/qmk_firmware/blob/537444b853d7ce7aa7e83920365927ac4f1200bb/keyboards/vortex/pok3r_rgb/rules.mk#L11-L12
From limited testing, I found this branch to help improve SPI flash reliability (when rapidly changing RGB effects): https://github.com/hansemro/ChibiOS-Contrib/tree/ht32-spi-tx-wc-fix
This is very cool, great work! Sorry for sleeping on this, I've been super busy lately. I'll find some time to try this on mine this week!
I am currently investigating conditions that cause LEDs to flicker. I started noticing this when my PC shuts down but is still delivering some power to the keyboard.
Updated tasks with upstreaming plans with the goal to reduce tool requirements and steps by:
ht32-dfu-tool
for unlocking and flashing while in ISP
ISO support included in the following branches:
~Don't have pok3r RGB keyboard, but~ wanted to help out with the RE effort and create a starting point for support in QMK. (Update: got the keyboard).
Pok3r RGB has 2 MBIA043 LED Drivers in a chain. Stock firmware uses GPTM1 to drive GCLK PWM signal and uses BFTM1 for time-multiplexing.
GPTM1 PWM frequency: 14.4 MHz
BFMT1 compare value: 60,000 ticks (where input frequency is 72 MHz)
Pin Mapping (identical to Pro S RGB): MBIA043 GCLK: C0 MBIA043 DCLK: A14 MBIA043 LE: A15 MBIA043 SDI: C2 MBIA043 SDO: B0 MBIA043 Power: C1 (power is enabled when C1 is low)
LED (Column) GPIO Pins (gpio_map_3 in pok3r_rgb/v140 disassembly): C8, C7, B5, B4, B3, B2, C6, C5
MBIA043 Configuration (same as Pro S RGB):
0xc
for both driversTasks:
mbi
driver: https://github.com/hansemro/qmk_firmware/commits/mbi_driver_devmbi
driver and making any necessary driver changes