BL4S200 User’s Manual
62
4.2.3 A/D Converter Inputs
The following sample programs are found in the
SAMPLES\BLxS2xx\ADC
subdirectory.
You will need a separate power supply and a multimeter to use with these sample programs.
NOTE:
The calibration sample programs will overwrite the calibration constants set at
the factory. Before you run these sample programs, run
USERBLOCK_READ_
WRITE.C
in the
SAMPLES\UserBlock
folder to save the factory calibration con-
stants in case you inadvertently write over them while running other sample programs.
•
ADC_CAL_DIFF.C
—Demonstrates how to recalibrate a differential A/D converter
channel using two measured voltages to generate two coefficients, gain and offset,
which are rewritten into the user block. The voltage that is being monitored is displayed
continuously.
Once you compile and run this sample program, connect the power supply across a dif-
ferential channel pair, then follow the instructions in the Dynamic C
STDIO
window.
•
ADC_CAL_MA.C
—Demonstrates how to recalibrate a milli-amp A/D converter channel
using two measured currents to generate two coefficients, gain and offset, which are
rewritten into the reserved user block. The current that is being monitored is displayed
continuously.
Before you compile and run this sample program, jumper pins 1–2, 3–4, 5–6, and 7–8
on header JP4. Then connect a current meter in series with the power supply connected
to one of pins AIN0–AIN3 and AGND, then compile and run the sample program, and
follow the instructions in the Dynamic C
STDIO
window.
•
ADC_CAL_SE_BIPOLAR.C
—Demonstrates how to recalibrate a single-ended bipolar
A/D converter channel using two measured voltages to generate two coefficients, gain
and offset, which are rewritten into the reserved user block. The voltage that is being
monitored is displayed continuously.
Before you compile and run this sample program, connect the power supply (which
should be OFF) to one of pins AIN0–AIN3 and AGND, then compile and run the
sample program, and follow the instructions in the Dynamic C
STDIO
window.
•
ADC_CAL_SE_UNIPOLAR.C
—Demonstrates how to recalibrate a single-ended unipolar
A/D converter channel using two measured voltages to generate two coefficients, gain
and offset, which are rewritten into the reserved user block. The voltage that is being
monitored is displayed continuously.
Before you compile and run this sample program, connect the power supply (which
should be OFF) between the pin (AIN0–AIN7) of the channel you are calibrating and
AGND, then compile and run the sample program, and follow the instructions in the
Dynamic C
STDIO
window.
•
ADC_RD_CALDATA.C
—Demonstrates how to display the two calibration coefficients,
gain and offset, in the Dynamic C
STDIO
window for each channel and mode of
operation.
electronic components distributor