Searching \ for 'different approach to keyboard scanning?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=different+approach
Search entire site for: 'different approach to keyboard scanning?'.

Truncated match.
PICList Thread
'different approach to keyboard scanning?'
2003\04\09@201200 by Patrick J

flavicon
face
> But note: any sneak current paths from line 0 to line 1 (say) will go
> through more than one diode; only if the switch at column 0, row 1 is
closed
> will there be a path with just one diode.  If only there were some way to
> distinguish between the one-diode case and the more-than-one-diode case...
>
> So my crazy idea was to drive line 0 high and line 1 low, then read the
> state of line 0 (which, on the PIC, is supposed to reflect the actual
> voltage on the pin, IIUC).  My hope was that the input thresholds would be
> such that with one diode, line 0 would be about 0.7V and would read 0,
while
> with two (or more) diodes, line 0 would be 1.4V (or more) and would read
1.
>
> Unfortunately, it didn't work.  Even with just one diode, I couldn't get
> line 0 to read 0.  Sigh.

Use the A/D inputs of the PIC instead ?
(then you can define your own 0 and 1 voltage levels in software)

Tho I am not sure why you want to do this in the first place. It is quite
common
to read keyboards in X-Y fashion. Just not with diodes in the juncions as
you do.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\04\11@165623 by Michael Park

picon face
>From: Patrick J <spam_OUTinfoTakeThisOuTspamDATECH.SE>
>Reply-To: pic microcontroller discussion list <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
>To: PICLISTspamKILLspamMITVMA.MIT.EDU
>Subject: Re: different approach to keyboard scanning?
>Date: Thu, 10 Apr 2003 02:11:28 +0200
>
>
>Use the A/D inputs of the PIC instead ?
>(then you can define your own 0 and 1 voltage levels in software)

Unfortunately, the PIC I use doesn't have A/D, and besides, the number of
A/D inputs would be impractical.

>
>Tho I am not sure why you want to do this in the first place. It is quite
>common
>to read keyboards in X-Y fashion. Just not with diodes in the juncions as
>you do.

Well, to read a 3x4 keyboard you normally need 7 I/O lines (unless you add
external chips).  The way I want to do it would only need 4 lines.

I also need n-key rollover, so diodes are going to be necessary at the
junctions in any case.  I just wanted to see if I could get by with just
those diodes and a little cleverness.


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu>

2003\04\11@174744 by Scott Dattalo

face
flavicon
face
On Fri, 11 Apr 2003, Michael Park wrote:

{Quote hidden}

If you use only the upper (or lower) triangle then you can get rid of the
diodes. The downside is that the number of switches that you can scan is
cut in half. However, that is still greater than the general X-Y scanning:

for n lines

the maximum switches that the X-Y scanning method can scan is (n/2)*(n/2)
= (n^2)/4 (if n is even).

the maximum switches that can be scanned by using this 3-state logic is:
n*(n-1)/2 = (n^2)/2 - n/2
         = (n^2)/4 + (n^2)/4 - n/2
         = (n^2)/4 + n*(n/2-1)/2

In other words, the 3-state logic will scan n*(n/2-1)/2 more switches.

If n is not even then the most you can scan with the X-Y approach is:

  (n-1)/2 * (n+1)/2 = (n^2 -1)/4


Putting into a table:

     #  scanned
 n   X-Y  3 state
------------------
 4    4     6
 5    6     10
 6    9     15
 7    12    21
 8    16    28
 9    20    37
 10   25    45
 11   30    55
 12   36    66
 13   42    79
 14   49    91
 15   56    105
 16   64    120

(if I did this table correctly).

Scott

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu>

2003\04\12@003936 by Eric Bohlman

picon face
4/11/03 3:50:34 PM, Michael Park <RemoveMEmp__TakeThisOuTspamHOTMAIL.COM> wrote:
>Well, to read a 3x4 keyboard you normally need 7 I/O lines (unless you add
>external chips).  The way I want to do it would only need 4 lines.

Actually 6.  Assuming (without loss of generality) that you're driving the columns and reading the
rows, you can tie one column low; if you see a low on the rows when you aren't driving any of the
columns, it's a keypress on the tied-low column.

This doesn't work too well if the row inputs are used for other purposes besides keyboard scanning,
though sometimes you can get around it by tying the column low through a high-value resistor.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...