International Arcade Museum Library

***** DEVELOPMENT & TESTING SITE (development) *****

Star Tech Journal

Issue: 1987-December - Vol 9 Issue 10 - Page 6

PDF File Only

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

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