Manual 104-AIO16A and 104-AIO16E
37
1.2 Gain
Adjust
1.2.1 Apply a known voltage to the A/D Input. When adjusting the gain, a known voltage very near the
maximum input of the A/D converter will result in a good reading across the entire range.
Alternately, calibrating the A/D to a voltage near the actual application voltage you’ll be expecting
in your system results in perfect readings in your specific system. In the vast majority of cases,
either calibration method will result in correct data. Continuing our example from above, when
calibrating the 0-10V range a voltage near 10 Volts is recommended: we’ll use 9.95 Volts as our
Known Voltage. Using a calibrated voltage source apply your known voltage to the inputs of at
least one A/D channel. The other channels should not have signals connected, or should be
grounded. To connect a known voltage to channel 0, connect the voltage to P2 Pin 1, and use P2
Pin 3 as the reference ground.
1.2.2 Acquire the voltage using the A/D converter. See step 1.1.2
1.2.3 Adjust the value in the digital calibration potentiometer for the A/D until the voltage read by the
A/D matches the input voltage. 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 the Known Voltage. To convert from counts to voltage use the
following equation: Volts=Span*Counts/MaxCounts-Offset. MaxCounts on a 16-bit A/D is 65536,
and Span and Offset vary with the selected range. In any unipolar range, Offset is zero, and the
Span is equal to the maximum voltage. In any bipolar range the Span is equal to the maximum
input voltage minus the minimum input voltage, and Offset is half of this value. For example,
±5Volt range has a Span of 10V and an Offset of 5V. If the A/D reads FFE9 counts on a 0-10V
range, the voltage being indicated is 10*FAE9/FFFF-0, or 9.801 Volts.
1.2.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 Gain of the 0-10 Volts Single-Ended setting of the board, we
recommend you write the calibration potentiometer value into the “D" location of the EEPROM.