HP 15c CE - New firmware update officially available!
|
08-07-2024, 02:58 AM
(This post was last modified: 08-07-2024 03:09 AM by brouhaha.)
Post: #76
|
|||
|
|||
RE: HP 15c CE - New firmware update officially available!
I have not disassembled the ARM code in the 15C CE, but I suspect that it may be only debouncing the keyboard when the Nut processor simulation code executes a keyboard-related instruction. (But perhaps not.)
In embedded systems I develop, I normally do all of my key scanning and debounce on a timer interrupt, though when the keyboard is in a quiescent state, I stop the timer, and put things into a lower-power state. There are a few refinements to the most rudimentary key scanning code that improve reliability. Code:
There is a way, even on 8-bit micros, to somewhat parallelize the debounce algorithm across multiple keys, by using "vertical counters", which may have been invented by, but certainly were popularized by Scott Dattalo: https://web.archive.org/web/201408290353...ounce.html A typical timer frequency might be between 50 and 100 Hz. The power consumption will typically be higher for higher timer frequencies, but I wouldn't recommend going much below 50 Hz. Note that the press threshold and release threshold can be different. The thresolds are set to ceil(debounce_time / timer_interval), or slightly higher. The debounce time should be a little higher than the maximum bounce time specified for the actual switch. For isntance Cherry MX keys, commonly used for high-end computer keyboards, have a specified maximum bounce time of 5ms, assuming 16 inch per second actuation speed. (Third-party MX-compatible keys might not be as good.) Ad-hoc dome-and-contact buttons can have much longer maximum bounce times. If the keys each have diodes, or the keys are of some other type that doesn't provide bidirectional conductivity, this can provide n-key rollover. Otherwise, it's OK for 2KRO. I apologize in advance if there are any errors in my algorithm descriptions, as this is just off the top of my head. The general outline of this algorithm derives from a 1977 Mostek application note by Dan Hammond for the F8 microprocessor and MK3870 microcontroller, "Using Mostek's F8 in a Scanned Keyboard Application". The application note can be found starting at page 290 (PDF page 393) of the Mostek Microcomputer 3870/F8 Data Book, 1978 edition. My main changes are the active deassertion of scan lines, and the quiescent state for more power savings. I have no idea what the maximum bounce time of the HP 15C CE keys is, and am not going to measure it. Perhaps HP has. But from personal experience, simply increasing the debounce time without having a good debounce algorithm does not produce great results. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 18 Guest(s)