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

Support inverted backlight and xd60 with PWM fix #2661

Closed
wants to merge 4 commits into from
Closed

Support inverted backlight and xd60 with PWM fix #2661

wants to merge 4 commits into from

Conversation

brettinman
Copy link
Contributor

Hi there! This PR fixes a couple issues with the xd60 v2.

  1. The PCB has the backlight MOSFET connected to a pin that does not support hardware PWM. This means the backlight will frequently flicker when pressing keys. Documented here: https://www.reddit.com/r/MechanicalKeyboards/comments/6xsd5c/modification_discovered_the_org60_pcb_has_a/. The "xd60_fix_pwm" keyboard I've added has the column and and backlight pins swapped to fix this. This assumes you have cut the traces and made the correct connections, documented in the readme for this keyboard.

  2. The MOSFET on the PCB is connected as a source rather than a sink. This means the PWM needs to be inverted to work as expected. This is addressed with a bool BACKLIGHT_INVERT set in config.h and with corresponding code in quantum.c to handle this. This change should work for any board with an "inverted" backlight though I don't have any other boards to test with. I believe this does not break "non-inverted" boards but I (again) don't have one to test with so would be very grateful if someone confirmed.

And I've added a couple keymaps for this "new" board - the default taken from the regular xd60 board, and one with my preferences.

Let me know if there is a better way to refactor this!

@brettinman
Copy link
Contributor Author

Refactored to make pwm_fix a version of the existing xd60.

@drashna
Copy link
Member

drashna commented Jul 10, 2018

This has some conflicts that need resolving. If you wanted to do that?

@masterzen
Copy link
Contributor

I know you modded your hardware, but you might want to check my software only patch available in PR #3615 to remove the flickering when typing on keyboards with software PWM.

@drashna
Copy link
Member

drashna commented Oct 22, 2018

Just wanted to touch base here.

It looks like you have some merge conflicts that need to be resolved.

And I think that @masterzen's solution may be the better option in the long run.

@drashna
Copy link
Member

drashna commented May 1, 2019

Looks like merge conflicts have popped up.

Also, there have been some changes to the backlight code, is this still needed?

@masterzen
Copy link
Contributor

@drashna this isn't needed anymore with a standard xd60 thanks to #3615.

What the OP proposed is a modified xd60 keyboard where they reroute the backlight to a hardware PWM pin on the MCU to have full hardware backlighting. I'm not sure there are a lot of xd60 users that have done this modification.

The patch also contains a core modification that we already have (called BACKLIGHT_ON_STATE in core), and thus which is not needed anymore.

@drashna
Copy link
Member

drashna commented May 4, 2019

Thanks!

The backlight is one of the features I'm not as familiar with, so I wasn't sure.

That said, I think I'll close this, for now. If needed, reopen this, or open a new PR with just the specific changes needed.

@drashna drashna closed this May 4, 2019
@fauxpark fauxpark mentioned this pull request Jul 17, 2019
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants