Remote Processing RPC-220 User Manual
Page 39

PWM AND ANALOG OUTPUT
SECTION 12
PAGE 12-2
Second is step response time. Pulses are filtered through
a 1 po le f il te r . T h is m e an s th e r e i s s o m e d e la y ti m e
from when the duty cycle changes to output change.
Generally, this is about 100 ms for small steps and 200
ms for lar ger (1/ 2 scale) steps.
Analog ou tputs are at J1 . J1- 17 is analog outp ut 0 while
J1-19 is analog output 1. Output channels are controlled
by their co rres ponding P WM channel.
E x am p le p ro g ra m P W M . C un d er d ir e ct or y P W M
genera tes a ram p on the analog outputs by contin uously
varying the duty cycle.
Measuring outputs using on card A-D
The analog outputs can be set to a more precise level by
reading them at the A-D input. D ue to interactions
between the analog output and A-D circuits, a 20K ohm
or greater r esistor should be placed between A-D input
and output. If the resistor is not installed, A-D
conversions intermittently read full scale (1023 counts).
Output leve ls and noise
The ope rational am plifier used to buffer o utputs gets its
power from the RS-232 generator. If you turn of the
RS-232 output, its quite probable analog output will be
affected.
Ther e is some no ise (ripple) o n the analog ou tputs. This
noise comes from two sources: First is the PWM signal
it self. If the CPU PWMP register is programmed for a
low frequency, there will be ripple on the output. To
corr ect this prob lem, decrea se the value w ritten to
PWMP to 0x10 or lower.
The second noise source is the RS-232 generator. The
RS-232 chip U9 generates both + and - voltages in the 8
volt range. The positive voltage is somewhat filtered.
The negative is not. To clean up the negative voltage,
put a 10 micro-farad or larger capacitor on the -V pin at
J1-20. Capacitor voltage should be 16 volts or higher.
PIN OUTS AND REGISTER
INFORMATION
The following tables are partial pin outs for J1 and J3.
Full pin out fo r J1 is in SE CTI ON 1 1 and J3 in
SECT ION 6.
Pin outs
Conn
Function
J1-17
Analog ou tput, c hannel 0
J1-19
Analog ou tput, c hannel 1
J3-22
PW M outpu t, ch annel 0
J3-20
PW M outpu t, ch annel 1
PWM registers
Register
Address
Function
(in special
function area)
PWMP
0xfe
Prescaler
PWM 0
0xfc
Duty cyc le
PWM 1
0xfd
Duty cyc le
APPLICATION PROGRAM
The following program is in the PWM directory. A
brief description follow s:
F i le n am e
Description
P W M . C
Initializes PWM prescaler and varies
duty cycle from 0 to 100% . U sed also
to view voltage ramp from analog
outputs.