On supported boards (-AT boards, Helios,AthenaII,HerculesII,Poseidon,Neptune CPU boards ), the user may auto-calibrate the board's A/D circuit in software, rather than undergoing a tedious process of manual calibration. Each A/D range has its own set of calibration settings for maximum accuracy. This function enables you to calibrate a single range or all ranges. To calibrate a single range, specify the range in the function call. To calibrate all ranges, specify 255 for the range.
When auto calibrating, the UD programs the EEProm memory with the calibrated values for TrimDACs. The values present in the TrimDAC registers provide additional reference voltages to the AD circuit to enable precision calibration.
The auto calibration routines calibrate the offset at the zero point and gain at the full scale point.
Create and initialize an A/D auto-calibration settings structure (DSCADCALPARAMS).
Select the A/D range to calibrate. For an individual range, select 0-15. For all ranges, select 255.
Select the booot range. This is the range whose calibration settings will be recalled upon power-up.
Call dscADAutoCal() and pass it a pointer to this structure in order to calibrate the A/D circuit on the board for the selected range(s).
NOTE: Performing an A/D auto-calibration will take about 1-3 seconds per range, depending on the board type and the range.
... DSCB dscb; DSCADCALPARAMS dscadcalparams; BYTE result; ... /* Step 1 */ dscadcalparams.adrange = 255; // calibrate all A/D modes dscadcalparams.boot_adrange = 8; // set power-up A/D mode to +/-10V /* Step 2 */ if ((result = dscADAutoCal(dscb, &dscadcalparams)) != DE_NONE) return result; ...
This page was last modified 22:27, 17 Aug 2009.
Copyright (c) 2004 Diamond Systems. All Rights Reserved.