Star Tech Journal

Issue: 1987-December - Vol 9 Issue 10

STAR*TECH Journal
December 1987
(6)
An Inside
Look At Switch Matrixes
By Jarnes Beck
Greater Southern Distributing Co.
BAM Engineering
Atlanta, Georgia
SWITCH MATRIXFS: 'Why and How
switch matrixes have been around for a
long time, and roost of us have had to
trouble shoot one at some point or
another, but why are they used and how do
they work? Well, hopefully after you read
this you will know the answers to these
burning questions.
of sixteen switches.
'lbe chips most frequently used to drive a
matrix are the 6821 PIA and the 6532 RIOT.
Each of these have two 8--bit ports that
can be configured as inputs or outputs.
'lhat means one chip can form an 8 by 8
matrix, which can access up to 64
switches. That is, one chip that needs to
be addressed, and it even has its own
output buffers, although external
buffering is sometimes added.
F,~i.
Sw i
WHY?
tc..~
ffic...Tr,)(
'Why they are used is pretty easy.
A switch matrix allows the logic to check
the status of a large nunber of switches,
while using a minimum of support
corrponents.
The roost corranon type of switch interface,
used on video garnes, consists of a
tri-state buffer, that has its own
distinct address to enable it, and is tied
to the CPU's data bus. This is fine for
situations where there is a small nurrber
of switches to keep track of, but when you
get into the realm of pinball, there is a
whole playfield loaded with switches, not
to mention tilts and coin inputs!
To interface these directly to the data
bus would require a whole load of support
circuitry. Since every pin I know of uses
a CPU with an 8--bit data bus, for every 8
switches you would need a tri-state
buffer, its address decoding chip/chips,
pull up resistors on every input, and
maybe even some debounce capacitors. 'lbe
parts count could get rather high.
So, along comes the switch matrix. A
switch matrix uses two sets of control
lines, strobes and returns (columns and
rows if you prefer), and the nunber of
switches it can handle is equal to the
nurrber of strobes times the nunber of
returns.
Figure 1 shows a 4 by 4 matrix. That means
eight control lines can check the status
HCW?
How a matrix works is direct enough.
Let's take a look at figure 1 and we will
put it into operation. The strobes are
outputs and the returns are inputs. 'lbe
strobes do just what their name implies,
they strobe from high to low in sequence.
Figure 2 show the timing relationship of
the strobes used in our matrix. Every time
a strobe goes low the status of the
switches connected to it is checked.
'When a strobe goes low, and one of the
-
switches connected to it is closed, it
pulls the apsociated return low. The CPU
then reads the returns and recognizes the
low as a closed switch. The diodes are
STAR*TECH Journal

used as signal blockers so that closed
switches on inactive strobe lines don't
conflict with the switches actually being
polled.
December 1987
(7)
Now let's cause a failure:
Short the diode at (0,1). Strobe 0 still
pulls return O low, but it now also pulls
strobe 1 low -which forward-biases the
diode at (1,1). It conducts and pulls
return 1 low. Now the board thinks (0,0)
and (1,0) are closed, even though (1,0)
isn't really.
If a return fails and gets stuck low the
logic will think every switch connected to
it is always closed, or if it gets stuck
high the logic will think all of the
switches connected to it are always open.
0
j_
2..
TROUBLF.sHOOI'ING
Sometimes trouble shooting a faulty matrix
can get a little confusing, so let's cause
some failures in our 4 by 4 matrix and see
what happens.
First let's examine normal operation.
let's assume the following conditions:
Strobe O is low and the switches at (0,0),
(0,1), and (1,1) are closed.
A strobe that is stuck high will do the
same thing. The logic will think every
switch connected to that strobe is open.
A strobe that gets stuck low can cause all
kinds of wierd things to happen. Let's
assUIIE the same switches that we used in
the first exanple are still closed, and
strobe 1 is stuck low. As the strobes are
sequenced, return O is always going to be
pulled low by the stuck strobe, therefore
the CPU "sees" every switch on return Oas
being closed. Not only that, the closed
switch at (1,1) is going to pull return 1
low also. This means the CPU also assUIIEs
every switch connected to return 1 is
closed also.
In an actual game this can cause a switch,
or corrbination of switches, to do things
like add credits, tilt the game, or score
incorrectly, depending on the strobe and
switches involved.
switch matrixes are something irost of us
will have to fool with sooner or later,
and even the irost bizarre problem can be
corrected with a little understanding, and
sometimes, a lot of patience.
Until next ironth, have fun!
Note: The format used is (return,strobe).
.
'!be diode at (0,0) is forward-biased so it
conducts, pulling return O low. The diode
at (0,1) is reversed-biased so it is
cutoff, and the diode at (1,1) has highs
on both sides so there is no current flow
there either.
Murphy's Law #910
People who love sausage and respect the
law should never watch either one being
made.

Download Page 6: PDF File | Image

Download Page 7 PDF File | Image

Future scanning projects are planned by the International Arcade Museum Library (IAML).

Pro Tip: You can flip pages on the issue easily by using the left and right arrow keys on your keyboard.