DPRG
DPRG List  



[DPRG] Re: 1-wire keypad

Subject: [DPRG] Re: 1-wire keypad
From: Sluggy slugmusk at linuxlegend.com
Date: Mon Jul 2 17:53:28 CDT 2001

On Mon, 2 Jul 2001, montgomery f. tidwell wrote:

>> is this (a) the nature of keypads, (b) an indication that my keypad
>> is not the best, (c) or there is something that i should be doing
>> to "clean" up the output, if so what?

In my meager experience with using keypad buttons on FleaBot indicates
some type of debouncing is a good idea, even with low bounce silicone
membrane keypads. In the case of FleaBot, the debouncing is part of the
way the keys are scanned.

The keypad is set up as a 3x5 matix. Three I/O lines of one port are
connected to the columns of buttons. The five remaining are connected to
the rows with pullup resistors. In scanning, a 1 millisecond timer
interrupt is set. There is a cycling bit advanced at the start of the
routine. Every "even" time through, the lines connected to the the rows
are read and every "odd" time through, a sequential column is asserted
low and the others high. The data is flagged valid if a given column's
row data is a single bit low for two "even" cycle reads in a row, about
10 milliseconds in real life.

Not sure those specifics really help here except to say that debouncing
can be done in the software. Only several identical values over a period
of a few 10s of milliseconds in a row should be considered a valid
keypress, then a flag set waiting for the "no key pressed" value to
return before another value should be considered.

Sluggy!

More information about the DPRG mailing list