Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 07:11 12 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Diodes? Protection on a Keyboard Matrix?

Author Message
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 09:24am 09 Feb 2015
Copy link to clipboard 
Print this post

On page 20, Geoff outlines the connection of a 4x4 (or 4x3) keypad by connecting the matrix directly to the digital input lines of the Micromite.

I'm working on an expanded version of this to allow connection of a much larger keyboard matrix. (around 8x8) Naturally, I know I can't use Geoff's KEYPAD command for this (as much as I'd love to) so I'm working on some code with a lookup table. --

The Question:
In the past with project like this, I've use signal diodes to prevent potential short circuits if someone press more than one key down at once.

Shouldn't this be a good idea with the Micromite as well, or is this unnecessary with the PIC chip?

Thanks!
Jeff

My Propeller/Micromite mini-computer project.
 
factus10
Regular Member

Joined: 30/12/2014
Location: United States
Posts: 45
Posted: 10:04am 09 Feb 2015
Copy link to clipboard 
Print this post

Hi Jeff,

I just read a bunch about this recently. The diodes are necessary in any circuit where you want to prevent ghost keys (and short circuits).

Here's a good reference
keyboard matrices and diodes

Best,
David
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2292
Posted: 04:07pm 10 Feb 2015
Copy link to clipboard 
Print this post

it depends how clever you want to be. how many keys will your keyboard have?

1. if you only want to allow a single key to be pressed at once, then upon registering a key simply suspend input until you see all keys released. this is very simple to do in code and requires no diodes in the matrix. the paradigm will also work nicely with a 1-wire (analog) keyboard arrangement. if your keyboard will not be used by a touch-typist, then this approach is likely to be fine.

2. allow for 2-key rollover: again, no diodes required, though you need to do a bit of interpretation of the results of scanning the keyboard. single-key-press is easily identified. 2-key-press can have several variations (common row, common column, independent column and row). upon seeing a 2-key-press situation always suspend further input until return to either of 1-key-press or all keys up situation.

3. 3-key or higher rollover: this requires diodes, but is highly unlikely to occur on any normal keyboard used for 'qwerty' or numeric input. while such an approach used to be taken for ASCII keyboards 'back in the olden days', it has long ago been abandoned as 'over the top' and unnecessary.


the vast majority of keyboards attached to computers these days use no diodes and only allow for 2-key rollover. in fact, i can't see how diodes could be incorporated in the average laptop keyboard.


cheers,
rob :-)
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024