core: improve timing in ps2_host_send to fix caps/num LEDs consistency#563
Open
bruce33 wants to merge 1 commit intotmk:masterfrom
Open
core: improve timing in ps2_host_send to fix caps/num LEDs consistency#563bruce33 wants to merge 1 commit intotmk:masterfrom
bruce33 wants to merge 1 commit intotmk:masterfrom
Conversation
Owner
|
I think I added those waits to make signal form clean and recognizable when examining with scope. So would prefer to leave those waits if possble, 15us may be too long if keyboard with very fast clocking exists. I guess 5us is safe but not sure. When you built the firmware did you change setting for 8MHZ, btw? I believe you did but it doesn't hurt to ask. And did you try with 16MHz pro micro? |
Owner
|
And anyway sending signal for LED setting(converter->keyboard) is best-effort basis(with polling, not interrupt) and could fail in the end when other code with priority like USB task or other interrupts block it. I would think LED indicator is not critical and good enough if it works like 95% of the time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for the great project. Typing this on a QPAD MK-80 over USB having both lost their PS/2 to USB adapter and failed to be happy with cheap active adapters not working on both Linux and Mac.
Anyway, I had a problem with the Caps Lock, Number Lock LEDs not being set correctly and the keyboard resetting itself when running on an 8MHz avr pro micro (32u4). Changing the pull-up resistors helped, but given what is said here: http://www.burtonsys.com/ps2_chapweske.htm that the data from host->keyboard is sampled on the rising CLK edge (cf falling edge) then removing the delay would seem appropriate. It could even be done differently, setting the data up just after the WAIT(clock_hi...) ?
I'll own up and say I've only tested this in interrupt mode (pro micro) and only on two PS/2 keyboards - the QPAD MK-80 and an old Chicony KB-5916. The Chicony would also lose some setting of the LEDs before, now both are solid.