DIGITAL AND OPTO PORTS

100CON FIG LIN E 100,13, 1,1, 1

200D = LINE #(125)

210F = LINE (1)

220LINE 105, 1

230LINE #110,1 :REM Turn on LED

240LINE #110,0 :REM Turn off LED

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 Width Modulation (PWM)

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.

SECTION 6

Page 6-5 RPC -320

Page 27
Image 27
Remote Technologies RPC-320 manual Ls e Width Modulation PWM