Omar Jenkins wrote:
> On Thu, 28 May 1998, Mark Willis wrote:
> > Omar, consider a multiplexer or some other means of scanning keys.
> > You can use 4 Output pins to scan 16 keys (or just use 1 as a clock &
> > one as a reset, and scan n keys <G>) With 18 keys, each RC network
> > de-bounced and scanned through the multiplexer at 100 Hz or faster, you
> > should catch "most" typing...
>
> I've never had any experience using multiplexers so I'm not sure how they
> work but I will look them up. My other idea for how to shrink the number
> of buttons is to assign each button per row a different voltage: left =
> .5v, middle = 1v, and right = 2v. The three buttons would then be
> connected so that if the left and right ones were pressed it would give
> off a total voltage of 2.5v The stamop would read that in and say "The
> only way I could be getting a voltage of 2.5 from row 3 is if the left and
> right buttons were pressed. It would then "depress" those buttons in an
> array in memory and use the array to determine what to output. With that
> method the Input from the "fiddler" would be 6 pins leaving 10 I/O pins
> for interfacing with the keyboard port and maybe even the seriel port if
> the fiddle has a built in mouse. Any opinions on this idea?
Multiplexing's EASY, IMHO. You run a counter in the Stamp, the
counter would drive the appropriate O pin high, to drive successive
button rows, and then on a button press you detect it: Assuming 18
buttons total (3 special thumb, 3 regular thumb, plus 3 per finger):
Attach the 3 O pins, to the left side of each row below, maybe feed the
switch arrays with a Zener for luck (& ESD) <G>:
Count=0, set O1 to drive: Spcl1 Thumb1 Index1 Mid1 Rng1 Ltl1
Count=1, set O2 to drive: Spcl2 Thumb2 Index2 Mid2 Rng2 Ltl2
Count=2, set O3 to drive: Spcl3 Thumb3 Index3 Mid3 Rng3 Ltl3
Input pins: I1 I2 I3 I4 I5 I6
(1 I pin attaches to each of the columns (Spcl, Thumb, Etc.) with
another Zener (paranoid? Or experience <G>)). Use a connector, for
convenience, 10-pin polarized IDC's are cheap <G>.
So if Spcl1, Thumb2, and Mid2 are pressed, and you scan - when count=0
your software drives the top row (set O1 = High, O2 = O3 = Low), and
you'll see I1 = High, I2 = I3 = I4 = I5 = I6 = Low, when count = 1 you
drive the second row (set O1 = Low, O2 = High, O3 = Low), and you'll see
I1 = Low, I2 = High, I3 = Low, I4 = High, I5 = I6 = Low,
when count = 3 you drive the third row (set O1 = O2 = Low, O3 = High),
and you'll see I1 = I2 = I3 = I4 = I5 = I6 = Low. You could then
re-scan and if you see the same thing twice or three times (de-bouncing,
remember you can scan this way QUICKLY, like 100+ Hz) you'd look this up
in an (E)EPRom to determine that the twiddler was to emit (could be your
home address, or the girlfriend's phone number <G>)
Different Voltages: That'd slow down your scanning, I'd think, a LOT.
(I use 16C622 PICs, dunno how fast a Basic Stamp A/D conversion is;
You'd have to do two at least to make sure you caught rollover versus
ramp-up, (i.e. 3/4 of the way through the charge cycle, the right button
gets pressed - it could look the same as a left button press!) and it's
just plain easier to do a "Mux" than A/D (but then, I admit I'm quite
biased towards digital solutions over analog, maybe you're better at
Analog than I.)
> > <snip>
>
> {Omar Jenkins class of 1998 |"The more you study, the more you know, }
> {SystemAdministrator & WebMaster| the more you know, the more you forget, }
> {Montgomery Blair High School | the more you forget, the less you know."}
> {<
> | ??So Why Study?? }
From Wear-Hard Mailing list Archive (WH)
Maintained by R. Paul McCarty
Archive created with babymail