Instruction manual

Table Of Contents
Page
21
PC215E
4.2.11 Switch Matrix
The high number of digital I/O channels available on the PC215E board lends itself to a switch
matrix scanner implementation. The status of a matrix of switches can be obtained by sending
test patterns into the matrix, and then reading status patterns back from the matrix.
Section 6.6.11 describes functions which allows either PPIX, or both PPIX and PPIY to be used
as such a device. Using only PPIX up to 144 switches can be scanned, and using both PPIX
and PPIY up to 576 switches can be scanned. Group A ports of the 82C55 device(s) - Port A
and Port C-upper - are set for output to send test patterns to the matrix, and group B ports - Port
B and Port C-lower - are set for input to read the switch status information. The user must
ensure that the switch matrix is wired as detailed below.
GND GND
1N4448
1N4448
SPST SPST
10k
10k
SPST SPST
PPI X A0
PPI X A1
PPI X B0 PPI X B1
etc., up to PPI X A7,
then C4 to C7, then
onto PPI Y, and PPI Z.
etc., up to PPI X B7,
then C0 to C3, then
onto PPI Y, and PPI Z.
Figure 7 - Switch Matrix Configuration
Function
DIOsetSwitchMatrix
allows you to setup the matrix, specifying the matrix order. For
the PC215E, this can be 12 X 12 or 24 X 24 switches. The function also registers the PPIs used
as being 'in use' and unavailable for use by other programs. Function DIOgetSwitchStatus
returns the status of a given switch in the matrix, and function
DIOfreeSwitchMatrix
frees the
PPIs so they can be used by other programs when the switch matrix is no longer required.