Remote-processing RPC-330 Manual de usuario Pagina 26

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 48
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 25
DIGITAL I/O SECTION 6
Page 6-5 RPC-330
Maximum continuous current is 2 amper es at 60 volts @
25 C. ON resistance is 0.5 ohm s. Cur rent capability of
this FET is higher. However, if you draw more than 2
amperes, consider attaching a heat sink to Q2.
This port is accessed using the LINE #8 command. Line
100 turns on the FET while line 200 turns it off.
100 LINE#8,1
200 LINE#8,0
Use the circuit in figure 6-2 when switching inductive
loads.
Digital I/ O prog ramm ing exam ple
The follow ing exam ple read s a switch at po rt A, bit 3
(J3-25) (program line 200), reads L1 at P6 (program line
210) and turns on opto module at channel 5 (program
line 220). A LED is controlled through the high current
port at J3-10 (port B, bit 0) (program lines 230 and 240).
For testing, a 100 ohm resistor from J3-10 to + 5 volts
can be substituted.
100 CONFIG 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
240 LINE #110,0 :REM Turn off LED
300 G = LINE B(3,0) :RE M Re turns data a t port A
310 LIN EB 3, 1,5 :RE M w rites 5 to por t B
Line 100 configured the 82C55 so ports A and C are
inputs while B is the output.
Note that the LINE statement is used to control both opto
modules and individual lines.
Lines can also be read or controlled 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. Executing
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.
Pulse Width Modulation (PWM)
A line accessible by the LIN E comm and may 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 PWM 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). One of the parameters should be 1.
Noticeable flicker occurs when htime and ltime sum to
more than 6 (30 ms).
See the PWM command in the Software Supplement for
more information. Use Table 6-1 to use an output
directly from J3.
LINE MONITORING COMMANDS
ON LIN E and ON C OUNT are used to monitor any 8
lines while program execution continues. Use ON LINE
to monitor any change in state of a line. ON C OUN T is
used to count relatively slow (less than 95 H z) pulses.
ON COUNT can be used to generate an interrupt every
time a line goes low. Simply set the count param eter to
a 1.
Lines are m onitored by the oper ating system every 5 ms.
ON LINE generates an interrupt when a line changes
from the last monitored state. At the end of the current
BASIC statement a software interrupt is generated.
ON COUNT can generate a software interrupt when the
number of counts at a line reaches a preset number. It
can also count the number of pulses at a line.
Both of these interrupts are lower priority than ONTICK
or ONITR. Refer to Appendix A, INTERRUPTS
section under the ONITR com mand for operating and
priority information.
Vista de pagina 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 47 48

Comentarios a estos manuales

Sin comentarios