3.4 Performing a DA Conversion

Description

When you perform a D/A conversion, you are essentially taking a digital value and converting it to a voltage value that you send out to the specified analog output. This output code can be translated to an output voltage using one of the equations described in the hardware manual.

The Universal Driver function for performing a D/A conversion is dscDAConvert.

Step-By-Step Instructions

Call dscDAConvert and pass it BYTE and DSCDACODE values for the channel and output code - this will generate a D/A conversion on the selected channel that will output the new voltage that you set with the output code.

NOTE: Once you generate a D/A conversion on a specific output channel, that channel will continue to maintain the specified voltage until another conversion is done on the same channel or the board is reset or powered down. For a 12 bit DAC, the range of output code is from 0 to 4095. For a 16-bit DAC, the range of output code is from 0 to 65535.

Example of Usage for D/A Conversion

... 

DSCB dscb; 
BYTE channel; 
DSCDACODE output_code; 

... 

/* Step 1 */ 

channel = 0; 
output_code = 4095; 

if ((result = dscDAConvert(dscb, channel, output_code)) != DE_NONE) 
    return result; 

...

Last updated