
DIGITAL AND OPTO PORTS
SECTION 6
Page 6-5 RPC -320
100 CON FIG LIN E 100,13, 1,1, 1
200 D = LINE #(125)
210 F = LINE (1)
220 LINE 105, 1
230 LINE #110,1 :REM Turn on LED
2 4 0 L I N E #1 1 0, 0 : R E M T u rn o ff L E D
Line 100 configured the 82C55 so ports A and C are
inputs while B is the o utput.
Note that the LINE statement is us ed to contr ol both opto
modules and individual lines.
Lines can also be re ad or co ntrolled in the imme diate
mode.
PRINT LINE#(125)
returns the status at J3-25. Notice that even when a line
is configured as an output, its status can be read back.
Execute the following to control L7.
LINE 7,OFF
sets L7 low. E xecuting
LINE 7,ON
sets the line high.
LINEB is used to read and write a byte at a time.
LINEB 3,1,128
sets port B, bit 7 high and bits 0-6 are low.
P u ls e W i d th M o du la ti on ( PW M )
Any line accessible by the L INE com mand m ay be pulse
width modulated. PW M comm and parameters determ ine
high and low time (to 5 ms resolution) and, optionally,
number of pulses.
Use PW M to control the brightness of a display (via line
8), control the speed of a motor, or output a number of
pulses to a stepper controller. Brightness control using
LED ' s is best achieved when
htime
or
ltime
are less than
5 (25 ms). O ne of the parameters should be 1.
Noticeable flicker occurs when
htime
and
ltime
sum to
more than 6 (30 ms).
See the PWM comm and in the
Software Supplement
for
more inform ation. Use Table 6-1 to use an output
directly from J3.