Analog i/o chapter 8, Calibration, Assembly language access – Remote Processing RPC-2300 User Manual

Page 26: Analog output

Advertising
background image

ANALOG I/O

CHAPTER 8

Page 24

RPC-2300

Converting analog measureme nts

Inputs can be converted to engineering units of
measurem ent by performing scaling calculations in the
progr am. The A IN func tion retur ns values fr om 0 to
4095. To change these numbers into something more
meaningful, use the following formula:

var = K * AI N (n)

n is the analog channel to read. K is the scaling
constant. K is obtained by dividing the highest number
in the range of units by the maximum AIN count (4095).

E x am p le 1 : T o m ea su r e t he r es ul ts of an A / D
conversion in volts and the voltage range is 0 to 5V,
divided 5 by 4095 to obtain K.

K = 5/4095
K = .001221

Your program could look something like:

1000 C = .001221 * AIN(N)

Example 2: Y ou want to measure a 0 to 200 PSI
pressure transducer w ith a 0 to + 5V output. Divide 200
by 4095 to obtain the constant K.

K = 200 / 4095
K = .0488

The code can then look like:

1000 B = .0488*AIN(0)

CALIBRATION

The A/D converter is calibrated using an external
voltmeter. For 12 bit accuracy, you must use a
voltmeter with an accuracy of 0.02% or better.

To calibrate the SBS-2300:

1.

Connect the digital voltmeter ground to U10,
pin 11.

2.

Connect the digital voltmeter '+ ' lead to U10,
pin 14.

3.

A d ju s t t r im p o t R 7 fo r 5 . 00 0 V D C .

You may increase the reference voltage to a higher

value, up to 5.12V. This will allow you to detect if an
input device is at or above its output range (5V).

ASSEMBLY LANGUAGE ACCESS

The A/D converter is serially accessed. The routines
used to initialize, read and w rite to this chip are a part of
CAM BASIC II and are not available for distribution.
Ther e are no externa l assembly la nguage ac cesses (calls
or jumps) available.

ANALOG OUTPUT

Two optional analog output channels can be
independently configure d for three vo ltage ranges.
These ranges are jum pered in hardwar e. Refer to the
following table for jum per settings.

Range

J7-17

J7-19

(AOT 0)

(AOT 1)

0 - + 5

W2[2-4]

W2[1-3]

0 - + 10

W2[8-10]

W2[7-9]

±5V

W2[6-8]

W2[5-7]

W3 is alw ays set [1-2] an d [5-6]. Channe l 0 output is
pin 17 and channel 1 is pin 19.

Programming voltage output

The AOT command is used to send data to an analog
output. T he syntax is:

AOT channel, value

Where:

channel specifies the an alog channe l to write da ta to
and can be either 0 or 1. channel 0 is on pin 17 and
1 is on pin 19.

value is the value to output from 0 to 4095.

Use the following table to convert from a desired voltage
to a value.

Range

For mula

0 - 5

value= V * 819

Advertising