BL4S200 User’s Manual
64
4.2.4 D/A Converter Outputs
The following sample programs are found in the
SAMPLES\BLxS2xx\DAC
subdirectory.
NOTE:
The calibration sample programs will overwrite the calibration constants set at
the factory.
•
DAC_CAL_MA.C
—Demonstrates how to recalibrate a D/A converter channel using a
measured current to generate calibration constants, which are written into the reserved
user block.
Before you compile and run this sample program, connect pins 3–5 and 4–6 on header
JP5, and verify that jumpers are in place across pins 1–2 and 3–4 on both headers JP3
(AOUT0) and JP6 (AOUT1). Now compile and run the sample program, and follow the
instructions in the Dynamic C
STDIO
window.
•
DAC_CAL_VOLTS.C
—Demonstrates how to recalibrate a D/A converter channel using
a measured voltage to generate calibration constants, which are written into the
reserved user block.
Before you compile and run this sample program, connect pins 1–3 and 2–4 on header
JP5, then connect pins 1–2 and 3–4 on both headers JP3 and JP6 (unipolar), or connect
pins 5–6 on both headers JP3 and JP6 (bipolar). Now connect a voltmeter across one of
the D/A converter outputs, then compile and run the sample program, and follow the
instructions in the Dynamic C
STDIO
window.
•
DAC_MA_ASYNC.C
—Demonstrates how to output a current that can be read with an
ammeter. The output current is computed with using the calibration constants that are
stored in the reserved user block.
The D/A converter circuit is set up for asynchronous operation, which updates the D/A
converter output at the time it's being written via the
anaOut()
or
anaOutmAmps()
function calls.
Before you compile and run this sample program, connect pins 3–5 and 4–6 on header
JP5, and verify that jumpers are in place across pins 1–2 and 3–4 on both headers JP3
(AOUT0) and JP6 (AOUT1). Now set up an ammeter in series with the D/A converter
output and a resistor from 50
to 400
, then compile and run the sample program, and
follow the instructions in the Dynamic C
STDIO
window.
•
DAC_MA_SYNC.C
—Demonstrates how to output a current that can be read with an
ammeter. The output current is computed using the calibration constants that are stored
in the reserved user block.
The D/A converter circuit is set up for synchronous operation, which updates the D/A
converter output when the
anaOutStrobe()
function call executes. The outputs will be
updated with values previously written via the
anaOut()
or
anaOutmAmps()
function
calls.
Before you compile and run this sample program, connect pins 3–5 and 4–6 on header
JP5, and verify that jumpers are in place across pins 1–2 and 3–4 on both headers JP3
(AOUT0) and JP6 (AOUT1). Now set up an ammeter in series with the D/A converter
electronic components distributor