news

Early Release Key Bounce

January 05, 2016 Scott Urueta

When a keyswitch makes contact, it has a tendency to bounce open and closed repeatedly in a few milliseconds as it settles into place. When this is uncontrolled by software or hardware, it can cause keystrokes to be pressed multiple times.

The firmware currently being used with the early release version (based on StenoFW, originally for Stenoboard) has a section of code specifically to counter this issue by placing a tiny gap of time between when the switch first connects and when it can be pressed again to allow it to settle down into position over those first few milliseconds. The setting is at 20 ms by default, which should be more than enough for any typical mechanical keyswitch to function well. However, I have a report of issues with some keyswitches recording multiple keypresses per hit after about a week of use.

I have four keyboards in the second batch being assembled (and three more keyboards in a third batch printed and waiting to be assembled), so I am going to put these on hold for a short time (days, not weeks) and focus some time on rooting out what the issue is. I am temporarily removing assembled keyboard availability from the storefront until this is solved, since it is an issue that directly affects functionality.

If you encounter any bounce on your keyboard, please let me know and detail if it occurs intermittently on all keys, consistently on a specific set of keys, etc.

Thanks for sticking with the project!


4 comments

  • Carl Hauser

    Sep 05, 2016

    Scott and Charles,
    I’m also using the Stenoboard StenoFW with a homemade keyboard. For my second build I switched to a Teensy LC from a Teensy 2++ and saw much greater amounts of multiple keystrokes. Looking at the debounce code I spotted what appears to be an error in the line: if (debouncingKeys[i][j] == true && micros() – debouncingMicros[i][j])/ 1000 > debounceMillis)
    — there need to be parens around the subtraction:
    if (debouncingKeys[i][j] == true && (micros() – debouncingMicros[i][j]) / 1000 > debounceMillis)
    if this is to make sense. I put them in and all multiple-keypresses went away.

    Interestingly, two switches were much more prone to bounce than others — I’m using Matias Quiet Linear switches. I can’t explain why some switches would be more likely to bounce but it does seem to be the case. Once the debounce code was fixed, though, it was no longer an issue so I guess it’s nothing to worry about. Given the per-switch differences it may be that the change from the Teensy 2++ to the LC really had nothing to do with observing the problem and that it is all due to differences between switches in the two builds.

  • Scott Urueta

    Jan 23, 2016

    Perhaps there is a silly mistake in the firmware I am using as well. I should check my code more thoroughly.

  • Charles Shattuck

    Jan 23, 2016

    Scott, please disregard my last comment. I looked at my debug code and found what I think is a bone head error. It looks like I was never actually debouncing at all! It’s fixed now I think. Sorry to have wasted your time. When you find out what your problem is I hope you’ll post something about it. I’m very curious.

  • Charley Shattuck

    Jan 23, 2016

    Hi Scott. I’m using a homemade steno keyboard with firmware I wrote myself. The keys are cherry MX red. When I was first learning to use it I seemed to get a lot of these multiple key presses, but as I got better and crisper at stroking they pretty much stopped happening. I’m wondering if we’re seeing the same thing? I debounce for about about 5ms. I still get “are” a lot by resting my right index finger on the key. Maybe it’s operator error to some extent.


Leave a comment

Please note, comments must be approved before they are published