
DIGITAL AND OPTO PORTS SECTION 6
Page 6-3 RPC-320
digital I/O lines 8 bits at a time. T he address for port A
is 0, B is 1, and C is 2. J3 I/O bank number is 3.
Address for lines L0-L7 at P6 is 2 and I/O bank number
is 5.
LINE # function and statement accesses lines according
to the pin number at J3. J3 lines are numbered from 101
to 125. The line number used in this com mand is
computed by adding 100 to the connector pin number.
Line 102 is not allowed as it is the + 5V supply. See
table 6-1 to correspond a pin number to a port and opto
rack position.
P6 lines are numbered 0 to 7, and correspond to the
terminal number on the board. The LINE function and
command are used to access these lines. L8 at P2 is a
high current output and is accessed using LINE 8. The
status of ISOA/B is returned using LINE 8 function.
LINE, LINE B and LINE # return a ' true' logic level.
A ' 1' indicates + 5 volts or high and a '0' is low or
ground. LINE B and LINE # output true logic levels.
LINE, however, outputs inverted logic. In order to turn
on an opto module, a line must go low. However, to
turn on a module using LINE, specify '1' or ON. High
current output chip U 12 inverts control signals sent to it,
regardless of command.
100 LINE 118,1 :REM Turn opto 118 ON
110 LINE 118,ON :REM Turns opto 118 ON
120 LINE#104,0 :REM also turns 118 ON
ON LIN E is a multitasking command. When active, the
RPBASIC operating system checks the specified line
every 5 ms. If the line changed state from the previous
scan, a software interrupt is set. Upon completion of the
current BASIC command (and assuming no other
interrupts are active), program execution branches to a
specified subroutine. This command is useful for
monitoring lines, such as limit or door switches, that
may not change often or when the program structure
make it unwieldy to check lines frequently.
Another multitasking command, ON COUNT, causes the
operating system to check the specified line every 5 ms.
Up to 8 lines are monitored. If the line changed from a
high-to-low state, a counter is incremented. M aximum
counting rate is effectively 95 Hz. This command has
two variations. One causes a software interrupt when a
specified num ber of counts is reached. Another simply
counts pulses at a line. The C OUNT function returns
the number of pulses since ON COUNT was initiated.
See Appendix A for command information.
ON C OUNT and ON LIN E do not necessarily have to
be input lines. They can be outputs controlled by
another part of the program.
High Current Output
Eight lines at J3 can be used as high current drivers.
These outputs will switch loads to ground. Outputs are
controlled by Port B on the 82C55.
Logic outputs are inverted. That is, when a 1 is written
to the high current port, the output is switched on and
goes low.
The output driver chip, U 12, can be replaced with a DIP
shunt jumper so it is like the other lines at J3. To do
this, remove U12. Install a DIP shunt so pin 1 goes to
pin 18. Pins 9 & 10 are open.
NOTE: Outputs at the high current lines are not
compatible with TTL logic levels and should not
be used to drive other logic devices.
Each of the high current outputs can sink 500 ma at 50V.
However, package dissipation will be exceeded if all
outputs are used at the maximum rating. The following
conservative guidelines assume the number of outputs
are on simultaneously:
# of outputs Maximum current
on per output
1 500 ma
2 400 ma
3 275 ma
4 200 ma
5 160 ma
6 135 ma
7 120 ma
8 100 ma
The ther mal time constant of the package is very short,
so the number of outputs that are on at any one time
should include those that overlap even for a few
milliseconds.
Incandescent lamps have a "cold" current of 11 times its
operating current. Lamps requiring more than 50 ma
should not be used unless a series resistor is installed.