3.6 Performing an AD Autocalibration

Description

On supported boards (-AT 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.

Step-By-Step Instructions

Create and initialize an A/D auto-calibration settings structure (DSCAUTOCAL).

Select the A/D range to calibrate. For an individual range, select 0-15. For all ranges, select 255.

Select the boot 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.

Example of Usage for A/D Autocalibration

... 

DSCAUTOCAL dscautocal = new DSCAUTOCAL(); 
DSCUD_Class DSCUD_class = new DSCUD_Library.DSCUD_Class();

BYTE result; 

... 

/* Step 1 */

dscautocal.adrange = 255;          // calibrate all A/D modes 
dscautocal.boot_adrange = 8;       // set power-up A/D mode to +/-10V 

/* Step 2 */

if ((result = DSCUD_Library.DSCUD_Class.dscADAutoCal(DSCUD_class.dscb, ref dscautocal)) != DSCUD_class.DE_NONE)
 return result; 

...

Last updated