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

Bouncing issue on Kitten Paw firmware #7

Open
sagamusix opened this issue Jul 20, 2016 · 6 comments
Open

Bouncing issue on Kitten Paw firmware #7

sagamusix opened this issue Jul 20, 2016 · 6 comments

Comments

@sagamusix
Copy link

I've been using a Filco Majestouch 2 with a Kitten Paw (rev 20130602) controller for about three months now, and recently some keys (most notably Return) started to bounce, i.e. being registered twice instead of just once. Using the original controller, or the costar_keyboard firmware by BathroomEpiphanies, this does not happen (but I'd like to keep my custom layout, of course :).
Please let me know if you need any further details.

@sagamusix
Copy link
Author

Note: I have set the debouncing time to 20ms which almost eliminates the problem (occasionally I am still getting double keys), but that seems very suspcious given that Bathroom Epiphanies told me that his firmware - which does not have the issue - has a debounce time of 6ms, while the hardware specs of the switches are around 5ms bounce time.

@tmk
Copy link

tmk commented Jul 22, 2016

The Bpiphany's controller has decorders or multiplexers to strobe matrix, unlike other simple plain keyboards.
https://deskthority.net/w/images/7/71/Kitten_Paw_Schematics.pdf

I guess with this fact you need more time to settle signal on matrix before probing. EasyAVR delays just 5 cycles(312.5ns) by default, it seem to be enough for plain matrix driven by MCU I/O directly but not for the controller with decorders.
https://github.com/dhowland/EasyAVR/blob/master/firmware/src/matrix.c#L140

#define DEFAULT_MATRIX_SETUP_WAIT (5)

You will have to count into decoder's propagation and transition time too, in addition to settling time of MCU I/O pin.
http://www.nxp.com/documents/data_sheet/74HC_HCT42_CNV.pdf

Meanwhile costar_keyboard uses 1us(1000ns) delay.
https://github.com/BathroomEpiphanies/costar_keyboard/blob/master/libraries/hw_interface.c#L45

I guess that 500ns is enough from datasheet but 1us is safer, of course. Try both 8(for 500ns) or 16(for 1us) for DEFAULT_MATRIX_SETUP_WAIT and let me know your result.

@dhowland
Copy link
Owner

You don't have to rebuild the software with a different DEFAULT MATRIX SETUP WAIT. That value is configurable in the online config console and stored in EEPROM. Try bumping the setup time.

There have been a few people in the GH support forum that have had similar problems with their bpiphany controllers. The most recent that I dealt with did not ever find a fix, but when he get a replacement controller the problem disappeared. I'm not saying it's the controller, because obviously the OG firmware works, but that it is a complex problem that could require some work.

If changing the setup time doesn't work, leave another message. I have some ideas to try.

@sagamusix
Copy link
Author

Sadly, it doesn't seem like either values actually result in an improvement or change in behaviour.

@dhowland
Copy link
Owner

I created a test build: https://www.dropbox.com/s/10bb3wri2m8o5na/test_build_sagamusix.zip?dl=0

It changes the USB rate. let me know if this has any effect.

thanks.

@sagamusix
Copy link
Author

Sadly the problem appears to persist.

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

No branches or pull requests

3 participants