Remote-processing RPC-220 Manual de usuario Pagina 38

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 47
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 37
PWM AND ANALOG OUTPUT SECTION 12
PAGE 12-1
INTRODUCTION
PWM AND ANALOG OUTPUT SECTION 12
The RPC-220 has two program mable PW M outputs.
These outputs are the source for the two analog outputs.
Thus, when using an analog output, its corresponding
PWM outpu t may not be used. PWM frequen cy is
programm able for a pproxim ately 162 Hz to 43Khz. Duty
cycle is variable from 0 to 100% in 256 steps. The
frequency is set for both PW M outpu t channels w hile
each channel had independently pr ogram mable duty
cycles.
Analog output takes the PWM signal and filters it.
Output voltage range is programmable from 0 to about
5V in 256 steps. It is effectively an 8 bit D-A.
PROGRAMMING PWM
PWM output signals come directly from the CPU at port
J3. J3-22 is designated as PWM0 while J3-20 is PWM1.
There is no buffering. Drive levels are TTL compatible.
Lines must be buffered to directly drive opto modules.
Repetition frequency for both outputs is given by:
fpwm = 43369/(1+ PWMP)
Where:
PWM P is the prescaler frequency control
register value at special function register
address 0xfe. Its range is 0 to 255.
The duty cycle (in percent) for both outputs is given by:
Dcy = 100 * (1 - (PWM n/255))
Where:
PWMn is from 0 to 255. PWM0 is at special
function register address 0xfc and PWM1 is at
0xfd.
100% duty cycle is defined as always high while 0 % is
always low.
Quick PWM Program ming E xample
PWM outputs are at J3-22 for PWM0 and J3-20 for
PWM 1. To pr ogram them, use monitor command ' MS'
to modify the registers. For example type in the
following command.
MS fc
Address 0xfc is PWM 0 duty cycle register.
The board responds with
00FC 00
Type in a 40. This makes channel 0 a mostly high pulse.
Enter the data shown below. This programs PWM
outputs for 4.8 Khz repetition rate pulses. View the
outputs at J3-22 for PWM0 and J3-20 for PWM1.
00FC 00 40 00FD 00 c0 00FE FF 08 <cr>
Address 0xfd is PWM 1 duty cycle register and address
0xfe determines both channels r epetition rate
(frequency).
Example program PWM.C under directory PWM
generates a ram p at the analog outputs by continuously
varying the duty cycle.
ANALOG OUTPUTS
Output voltage is propor tional to the PW M channel' s
duty cycle. Thus, the output voltage changes in steps of
1/255, or approximately 20 mv/ step. This makes the
analog output act like an 8 bit D-A converter. Accuracy
depends upon the 5V supply. The analog outputs are
proportional to the PWM duty cycle.
Using on card regulators, maximum output voltage can
be 0.25 from the ideal 5.0V. Thus, the output can be as
much as 5% off.
When analog output is used as part of a system w ith
feedback, absolute accu racy is ge nerally no t critical.
This is because the output changes according to demand
requirements. When the output is used as a reference
(i.e. 2. 5V = 1/2 speed) and there is no feedback, then
accuracy can suffer. In situations wh ere acc uracy is
important, it is better to use a card with accurate analog
output (such as the RPC-210), or adjust the output by
reading the input.
The output may be " adjusted" by bringing the outputs to
one of the A-D's on board. (The A-D uses a fixed
reference so accuracy is higher. ) Simply read the analog
output and adjust the duty cycle as necessary to bring the
voltage to the correct level.
Response Time
Since the analog outputs are der ived from digital pulses,
there ar e a couple of things you have to take into
account. First, there is some ripple on the output. The
amount of ripple depends upon the PWM frequency.
Generally, the higher the frequency, the better. The
CPU PWM P register should be program med for 0x10 or
less. Lower PW M frequencies increase ripple.
Vista de pagina 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 46 47

Comentarios a estos manuales

Sin comentarios