Manual 104-AIO16A and 104-AIO16E
36
Step-By-Step: Calibrating the A/D
Step 1.
Determine the Calibration Constants for the A/D
1.1 Offset
Adjust
1.1.1 Apply Ground to the A/D input. For best results, all channels should be grounded. Any single
channel would also work. To ground a single channel in single-ended mode, connect its input pin
on connector P2 to a ground pin on P2. For example, to ground Channel 0, connect P2 Pin 1 to
P2 Pin 3. To “ground” a channel in Differential mode, connect the channel’s pin, and the
8's pin together (and preferably to ground.) For example, to “ground” channel 0 in
differential mode, connect Channel 0 (P2 Pin 1) to Channel 8 (P2 Pin 2) (and preferably to
ground, P2 Pin 3 as well).
1.1.2 Acquire the voltage using the A/D converter. The simplest way is using the Software Mode.
Software mode is described in Chapter 5: Programming. In essence it consists of five steps: Set
Channel, Set Gain, Start Conversion, Wait for End of Conversion, Read Data. For calibration
purposes the Channel should be whichever channel is grounded. The Channel Scan Limits
register at Base +2 should contain only that one channel. Read the data using the EMPTY bit to
indicate when data is available. Software gain at Base +4 should be configured for whichever
range you’ll actually be using, or the Gain x1 setting. The software gain amplifier is a laser-
trimmed part and does not need separate calibration per setting. For optimum results data should
be heavily averaged to eliminate any noise from the computations.
1.1.3 Adjust the value in the digital calibration potentiometer for the A/D until the voltage read by the
A/D indicates 1 count. Many methods of determining values for the digital calibration
potentiometer exist. One possible method: Set the Pot to “0" and take a reading. If the result is
off-scale (reading 0000 or FFFF counts) set the Pot to “FF” and take another reading. One of
these two readings will not be “railed” off-scale. Increment or decrement the Pot load value until
the data read from the A/D reads 0001. For the most accurate results, continue decrementing or
incrementing the Pot until the reading first becomes 0000.
1.1.4 Store the value from the digital calibration potentiometer into a spot in the EEPROM for use on
the next and subsequent board initializations. The correct spot in EEPROM varies with the A/D
range and single-ended/differential selection being calibrated. We recommend you use the same
locations as our provided Calibration program, drivers, and samples, as shown in
Table B-1
,
below. Write the value using the procedure outlined in the description of Base + 19 in Chapter 5.
For example, if calibrating the Offset of the 0-10 Volts Single-Ended setting of the board, we
recommend you write the calibration Potentiometer value into the “5" location of the EEPROM.