
CHAPTER 6 DIGITAL AND OPTO PORTS
RPC-30 Page 23
Interfacing to switches and other devices
The STB-26 terminal board provides a convenient way
of interfacing switches or other digital I/O devices.
Lines at J3 are connected to the STB-26 with a CMA-26
cable. Digital devices are then connected to the screw
terminals on the STB-26.
Switches may be connected directly to a line. When
jumper W6 configures the resistors as pull ups, a switch
closure to ground at a line is read as a 0.
When W6 configures the input resistors as pull downs,
one end of the switch must be tied to + 5 volts. If this is
not possible or convenient, a 1K resistor can be tied
between an input and + 5 volts to force it high when a
switch is open.
Configuring digital I/O lines
Lines are configured during program execution using the
CONF IG PIO command. On power up or reset, all lines
are inputs.
When a line is configured as an output, it can sink a
maximum of 2. 5 mA at 0. 4V and can source a minimum
of 2.5 ma at 2. 4V. W hen driving opto modules, the
outputs sink 15 mA at 1.0V.
Digital I/ O prog ramm ing exam ple
The follow ing exam ple reads a switch at port A, bit 3
(J3-25), reads an opto module at channel 1 and writes an
opto module at channel 5. A LE D is controlled through
the high current port at J3-10 (port B, bit 0).
200 D = BIT(0,3) :'Read switch status, port A
210 F = OPTO(1) :'read opto module, channel 1
220 OPTO 3,ON :'write module, channel 3
230 BIT 1,0,1 :'turn on led at J3-10
240 BIT 1,0,0 :'turn off led at J3-10
250 A = LINE(3) :'Reads pin 3 at J3
Conne ctor pinou t - J3
Pin # 82C55 Description Opto
Channel
19 Port A, line 0 8
21 Port A, line 1 9
23 Port A, line 2 10
25 Port A, line 3 11
24 Port A, line 4 12
22 Port A, line 5 13
20 Port A, line 6 14
18 Port A, line 7 15
10 Port B, line 0 High current 16
8 Port B, line 1 High current 17
4 Port B, line 2 High current 18
6 Port B, line 3 High current 19
1 Port B, line 4 High current 20
3 Port B, line 5 High current 21
5 Port B, line 6 High current 22
7 Port B, line 7 High current 23
13 Port C, line 0 Lower C 0
16 Port C, line 1 Lower C 1
15 Port C, line 2 Lower C 2
17 Port C, line 3 Lower C 3
14 Port C, line 4 Upper C 4
11 Port C, line 5 Upper C 5
12 Port C, line 6 Upper C 6
9 Port C, line 7 Upper C 7
26 Ground
2 +5V
Comentarios a estos manuales