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

[Feature request] Would it be possible to add Keyscan to the library? HT16K33 has Keyscan function #79

Open
rtek1000 opened this issue Dec 3, 2023 · 1 comment

Comments

@rtek1000
Copy link

rtek1000 commented Dec 3, 2023

Hi, the HT16K33 used in the Quad Alphanumeric breakout board has Keyscan function (up to 39 keys)

  • The keyscan logic uses one, two or three of the KS0, KS1and KS2 logic outputs. An interrupt output that flags a key press is optional. The INT flag can be read (polled) through the serial interface, allowing INT/ROW15 to be used as a general purpose logic output or as a ROW open-drain driver.
  • One small-signal diode is required per key switch when more than one key is connected to KS0, KS1 or KS2. The diodes prevent two simultaneous key switch depressions from shorting the COM drivers together. For example, if SW1 and SW14 were pressed together and the diodes were not fitted, COM1/KS0 and COM2/KS1 would be shorted together and the LED multiplexing would be incorrect.
  • The keyscanning circuit utilises the COM1/KS0 to COM3/KS2 outputs high as the keyscan output drivers. The outputs COM0 to COM7 pulse low sequentially as the displays are multiplexed. The actual low time varies from 64μs to 1024μs due to pulse width modulation from 1/16th to 16/16th for dimming control. The LED drive mode waveforms and scanning shows the typical situation when all eight LED cathode drivers are used.
  • The maximum of thirty-nine keys can only be scanned if the scan-limit register is set to scan the maximum KS0 to KS2.
  • The keyscan cycle loops continuously over time, with all thirty-nine keys experiencing a full keyscanning debounce over 20ms. A key press is debounced and an interrupt issued if at least one key that was not pressed in a previous cycle is found to be pressed during both sampling periods.
  • The keyscan circuit detects any combination of keys pressed during each debounce cycle (n-key rollover)
  • The INT output is active-low when the “act” bit of ROW/INT setup register is set to “0”
  • The INT output is active-high when the “act” bit of ROW/INT setup register is set to “1”.

Source: HT16K33 datasheet

It would be very interesting to be able to use this type of membrane keypad 3x4 with the Quad Alphanumeric board:
(Unfortunately with only 3 common scanning lines, it shouldn't be possible to use the 4x4 keypad)
img

Ref.:
Adafruit 0.54" Quad Alphanumeric FeatherWing Display - Green
Product ID: 3129
https://www.adafruit.com/product/3129

Membrane 3x4 Matrix Keypad + extras - 3x4
Product ID: 419
https://www.adafruit.com/product/419

@phd0
Copy link

phd0 commented Jan 22, 2024

hello,
there is a possibility with the library https://github.com/adafruit/Adafruit_Trellis_Library. I'm currently working on it. After my tests I would post it in the requests, but not at all sure that they take it into account, since there are no keys in their products.
Philip

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

No branches or pull requests

2 participants