Closed KarlK90 closed 7 months ago
That is awesome! Thanks so much for the help!
I'll check it out in detail after the weekend. I just tested it on the full size keyboard where it can reach ~1250Hz now. Compared to 500Hz previously. On the numpad module it goes from ~2350Hz to ~5750Hz.
That is awesome! Thanks so much for the help!
You're welcome.
I'll check it out in detail after the weekend. I just tested it on the full size keyboard where it can reach ~1250Hz now. Compared to 500Hz previously. On the numpad module it goes from ~2350Hz to ~5750Hz.
That is a nice gain, I suspect that the fall and rise times on real hardware are longer (because of the capacitance of the wires/matrix) than on my Pico protoboard and therefore the scan rate is lower as the pin/port waiting functions have to wait longer.
Hey, sorry, I will get back to this. It's a really great improvement that we definitely want in one way or another. But it's not working well in the current implementation. Some keys don't work and n-key rollover is worse.
No problem, I don't have access to real hardware so verification and bug fixing wasn't possible on my side.
Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug
, awaiting review
, breaking_change
, in progress
, or on hold
to prevent the issue from being re-flagged.
Rebased and fixed merge conflicts.
Maybe that the FW16 has been opened for preorders this can be worked on again?
@JohnAZoidberg could you remove the stale label, I still want to work on this.
Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug
, awaiting review
, breaking_change
, in progress
, or on hold
to prevent the issue from being re-flagged.
Thank you for your contribution! This pull request has been automatically closed because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. // [stale-action-closed]
Description
Hi @JohnAZoidberg and Framework :wave:,
QMK maintainer and author of the RP2040 port here. I've followed your announcement of the Framework 16 and was pretty much blown away, such a cool product/project. As I heard that the input modules would be based on QMK and the RP2040 I naturally had to take a look. Reading through the issues I stumbled upon https://github.com/FrameworkComputer/qmk_firmware/issues/8 which kinda scratched an itch :wink:. So here is an PR with a refactoring of the matrix scanning implementation.
I've tested it as best a possible on a RPi Pico as I don't have a Framework 16 (yet?)
Details
The former matrix scan implementation (for the ISO variant) caped at around ~500Hz which is around half of the USB full speed bandwidth. As QMK is one big busy loop the faster the matrix scanning is done, the more cycles are available for further QMK shenanigans. This refactored implementation is around 4x faster and sits at ~2.1kHz on a pico proto board which gives good headroom.
The following changes brought the biggest wins:
pico-sdk
ADC reading implementation as it uses busy waiting which has much less overhead compared to the current ChibiOS implementation that has context switching overhead.For correctness the scanning now dynamically waits for all IO pins/ports to reach their expected target level before attempting to read matrix changes.
Types of Changes
Issues Fixed or Closed by This PR
Checklist