Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pok3r RGB] RGB matrix in QMK #38

Open
6 of 13 tasks
hansemro opened this issue Dec 15, 2022 · 11 comments
Open
6 of 13 tasks

[Pok3r RGB] RGB matrix in QMK #38

hansemro opened this issue Dec 15, 2022 · 11 comments

Comments

@hansemro
Copy link

hansemro commented Dec 15, 2022

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 drivers

Tasks:

@hansemro
Copy link
Author

hansemro commented Jan 15, 2023

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

@hansemro

This comment was marked as resolved.

@hansemro
Copy link
Author

hansemro commented Jan 15, 2023

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 hansemro/qmk_firmware@7db2a0d. Issue was related to bad GPIO configuration (opendrain should be used since there are pull-up resistors to 5V).

@hansemro
Copy link
Author

MBIA043 demo on POK3R RGB:

pok3r_rgb_mbia043.mp4

I need to fixup a few things, but RGB lighting is working!

@hansemro
Copy link
Author

Fixed LED Matrix in hansemro/qmk_firmware@f83ebf3

@hansemro
Copy link
Author

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).

@hansemro
Copy link
Author

hansemro commented Jan 16, 2023

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

@ChaoticEnigma
Copy link
Member

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!

@hansemro

This comment was marked as resolved.

@hansemro
Copy link
Author

hansemro commented May 24, 2024

Updated tasks with upstreaming plans with the goal to reduce tool requirements and steps by:

@hansemro
Copy link
Author

ISO support included in the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants