Remote-processing RPC-330 Manuel d'utilisateur Page 36

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 48
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 35
ANALOG INPUT SECTION 10
Page 10-2 RPC-330
When channel = even
Pol. + - + - + - + -
CH # 0 1 2 3 4 5 6 7
channel 0 2 4 6
When range = 0, the input is ±2.5 volts and a 1 = 0 to
5 volts.
Differential Mode
When differential m ode is specified, inputs are actually
pseudo-differential. What this means is that a ground
reference is needed. For example, you cannot place a
battery between channel 0 and 1 and get an accurate
reading. The (-) input must be referenced to ground.
An example of where pseudo-differential works is an
output from a bridge network.
A pseudo-differential input subtracts the DC component
from an input. The IC maker recommends the (-) input
remain stable within 1 count with respect to ground for
best results. Connecting a 0.1 uF capacitor from the (-)
input to ground works well.
When operating in differential mode, relative + and -
voltages must be connected to specific inputs. When
inputs are reversed, a conversion returns a 0. When the
relative voltage changes, perform a conversion on the
alternate channel. CONFIG AIN must be perfor med on
both channels to be valid.
Pairs of channels can be differ ential while others single
ended. Thus, if channel 0 and 1 are differ ential inputs,
channels 2-7 may be single ended.
Examples u sing CON FIG AIN
Below are sample syntaxes for CONFIG AIN
Differential, 0 to + 5V input
CONFIG AIN 0,0, 1
CONFIG AIN 1,0, 1
Perform a conversion as normal:
A = AIN(0)
The difference between channel 0 and 1 is returned.
When channel 1 is more positive than channel 0, the
result is zer o. T he difference can be read on channel 1
by performing:
A = AIN(1)
Single-ended, ±2.5V input
CONFIG AIN channel,1,0
The result is 0 for -2.500V input, 2048 for 0.000V, and
4095 for + 2.4988V.
Acquiring Analog Data
Analog data is accessed with the AIN function. The
syntax is:
A = AIN(channel)
This function assigns the analog value of a channel to the
variable; A in this case. The value returned is alway s in
the 0 to 4095 range because the converter is 12 bits.
Power up or reset default configures inputs to the 0-5V
range, single ended.
To view the result of a conversion in the command
mode, type:
print ain(0)
The result at channel 0 is returned. The returned value
will always be in the 0 to 4095 range. When using a
channel in the ±2. 5V ra nge, the value returned is
interpreted differently. Zero count is now -2.500V,
4095 is + 4.9988, and 2048 is 0.000V.
Use the following formulas to convert a returned number
to a voltage:
0 - 5V A = .001221 * AIN(channel)
±2.5V A = .001221 * ain(channel) - 2.5
The AIN function requires about 1.5 ms to convert the
data. Additional time is needed to store the data. The
example below takes 255 data samples and stores them
into an array which requires 6 bytes per entry. The
second example takes only two byes per entry, can save
to extended m emor y, but requir es a longer time to get a
data point.
The program below takes about 1. 5 ms per data point.
10 DIM A(254)
20 FOR X=0 TO 254
30 A(X) = AIN(0)
Vue de la page 35
1 2 ... 31 32 33 34 35 36 37 38 39 40 41 ... 47 48

Commentaires sur ces manuels

Pas de commentaire