Truncated match.
PICList
Thread
'key matrix scanning'
1997\08\15@145117
by
Ravindra Divekar
somebody please tell me whether a
X-Y key matrix is efficient, if i
am checking for key combinations
rather than single-key presses.
i ask because the 16c84 has only 1k
of code space, and key matrix
scanning consumes a lot of space.
--Ravindra
1997\08\15@161340
by
John Payson
|
> somebody please tell me whether a
> X-Y key matrix is efficient, if i
> am checking for key combinations
> rather than single-key presses.
> i ask because the 16c84 has only 1k
> of code space, and key matrix
> scanning consumes a lot of space.
Matrix scanning doesn't have to use a lot of space; it depends what you're
looking for. If you have, e.g., a full 4x8 matrix and you want to look for
all possible key combinations (and you've put in diodes as needed) your best
bet is probably do do something like this:
movlw 1
movwf PORTA
call Delay
movf PORTB,w
movwf ROW0
movlw 2
movwf PORTA
call Delay
movf PORTB,w
movwf ROW1
movlw 4
movwf PORTA
call Delay
movf PORTB,w
movwf ROW2
movlw 8
movwf PORTA
call Delay
movf PORTB,w
movwf ROW3
Twenty words of code space (plus the delay routine); 4 bytes of registers.
Doing a decent debounce would probably require another 4 bytes; a better
debounce (if you're calling the routine often enough to require one) would
probably take 8 to 16 bytes. Note, btw, that you can replace the "delays"
above with debounce code if desired (which will take a few microseconds to
execute, giving the next keyboard row time to settle).
Is the above approach too register-hungry for you, or are you looking for
something else?
1997\08\15@162115
by
unknown667
At 11:18 AM 8/15/97 -0700, Ravindra Divekar wrote:
>somebody please tell me whether a
>X-Y key matrix is efficient, if i
>am checking for key combinations
>rather than single-key presses.
>i ask because the 16c84 has only 1k
>of code space, and key matrix
>scanning consumes a lot of space.
I would go with a bitfield instead. Like 'set of byte' in Pascal, so if
you have say 12 keys to deal with like on a numeric keypad for a phone
(0-9,#,*) then it would take 12 bits. One bit per key pressed.
123456789*0#
110110100001
would translate to 1,2,4,5,7,#
You see what I mean?
---
Unknown
1997\08\16@003718
by
Jens.Madsen
Ravindra Divekar wrote:
>
> somebody please tell me whether a
> X-Y key matrix is efficient, if i
> am checking for key combinations
> rather than single-key presses.
> i ask because the 16c84 has only 1k
> of code space, and key matrix
> scanning consumes a lot of space.
>
> --Ravindra
You should be aware that people may not leave the previos key before
pressing next key.
1997\08\16@023623
by
Jens.Madsen
Ravindra Divekar wrote:
>
> somebody please tell me whether a
> X-Y key matrix is efficient, if i
> am checking for key combinations
> rather than single-key presses.
> i ask because the 16c84 has only 1k
> of code space, and key matrix
> scanning consumes a lot of space.
>
> --Ravindra
Instead of using diodes try to use transistors.
*---------------*
I I
/-------\ I
I I I
I u-Amp I I
I I I
\-------/ I
I - I
I BC547 I
plate /--I--\ /-------\
I I I I I I I
*--I I----*--I--I--I I Vdd I
I I I I I \I/ I I I
I I \--I--/ \-------/
I III I I -
I 1kI I I I
I III I I
I I I I
I *-----* I
I I pulses I
I /-------\ I
I I --- I I
I I I I I I
I I -- -- I I
I \-------/ I
I I I
*---------------*---------------*
Try to messure the distance between the plates with varios
frequences and Amp's.
Rgds,
1997\08\16@024908
by
Steve Smith
If you use a xy matrix then diodes are required for each switch to check for
multiple key presses otherwise it works ok (fell in to that one myself when
reading personality jumpers)
If you do the code in a loop then the scan code can be quite small it only
requires a single decrement counter (for the colums) and the FSR to store the
rows in consecutive memory locations. Go round the loop onece for each colum.
Steve.....
1997\08\17@050905
by
Jens.Madsen
> Try to messure the distance between the plates with varios
> frequences and Amp's.
I forgot to mension the risetime. Try with more transistors too.
The voltage on Vdd is higher than the pulses. Else you will got a single
transistor memory cell.
Rgds,
Jens Dyekjaer Madsen
1997\08\18@010049
by
tjaart
|
Ravindra Divekar wrote:
>
> somebody please tell me whether a
> X-Y key matrix is efficient, if i
> am checking for key combinations
> rather than single-key presses.
> i ask because the 16c84 has only 1k
> of code space, and key matrix
> scanning consumes a lot of space.
>
> --Ravindra
It is perfect for the job. If, for instance you have a 4X4
keypad, you can use 4 inputs and 4 outputs on the same port.
The port value will be unique for *any* combination of keys.
Moreover, if your debounce routine validates the key(s) upon
leaving the key, you can also have special meanings attached
to keys that are pressed for longer than, say, a second.
--
Friendly Regards
Tjaart van der Walt
spam_OUTtjaartTakeThisOuT
wasp.co.za
________________________________________________________
| WASP International http://wasp.co.za |
| R&D Engineer : GSM peripheral services development |
|Vehicle tracking | Telemetry systems | GSM data transfer|
|Voice : +27-(0)11-622-8686 | Fax : +27-(0)11-622-8973 |
| WGS-84 : 26010.52'S 28006.19'E |
|________________________________________________________|
1997\08\18@015039
by
Pasi T Mustalahti
|
On Fri, 15 Aug 1997, Ravindra Divekar wrote:
> somebody please tell me whether a
> X-Y key matrix is efficient, if i
> am checking for key combinations
> rather than single-key presses.
> i ask because the 16c84 has only 1k
> of code space, and key matrix
> scanning consumes a lot of space.
>
PTM: Good guestion !
I have been after a cheap chip for scanning keyboard. Preferably I2C to
make keyboard scanning. There is this 74xx922, 74xx923, but it is
expensive and for only 16 or 20 keys. So far I'm going to use 74xx137 for
scanning. The same chip can be used to scan the LED-display too.
1:5 MUX for the display works fine if you use Hi-Bright LED's.
PIC's lack of indexed addressing makes thins a bit difficult.
________ _______
| |....| | 5 ___________
|PIC |....|73137|-------/------|5x6 keyb |
| |....| |- | |
| | | |- | |
-------- ------ - -----------
| 5 |||||
-----/--------------------------|||||
« | |||||<-transistors here
| 5 ______ 7 ___________
----/----|4511 |------/------|LED-displ |
------ -----------
(use about 10k resistors to Vcc in the keyboard)
Another thing is that I have not found a cheap LED-display controller that
can show the wild codes (hex 0x0A..0x0F) too or full ASCII. I prefer I2C
but everything goes.
--------------------------------------------------------------------------
PTM, .....pasi.mustalahtiKILLspam
@spam@utu.fi, ptmusta
KILLspamutu.fi, http://www.utu.fi/~ptmusta
Lab.ins. (mikrotuki) ATK-keskus/Mat.Luon.Tdk OH1HEK
Lab.engineer (PC support) Computer Center OI7234
Mail: Turun Yliopisto / Fysla, Vesilinnantie 5, 20014
Pt 02-3336669, FAX 02-3335632 (Pk 02-2387010, NMT 049-555577)
--------------------------------------------------------------------------
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- Today
- New search...