17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Built-in Functions<br />

setup_sd_adc_calibration( )<br />

Syntax:<br />

setup_sd_adc_calibration(model);<br />

Parameters: mode- selects whether to enable or disable calibration mode for the SD ADC<br />

module. The following defines are made in the device's .h file:<br />

SDADC_START_CALIBRATION_MODE<br />

SDADC_END_CALIBRATION_MODE<br />

Returns:<br />

Function:<br />

Availability:<br />

Examples:<br />

Nothing<br />

To enable or disable calibration mode on the Sigma-Delta Analog to<br />

Digital Converter (SD ADC) module. This can be used to determine<br />

the offset error of the module, which then can be subtracted from<br />

future readings.<br />

Only devices with a SD ADC module.<br />

signed int 32 result, calibration;<br />

set_sd_adc_calibration(SDADC_START_CALIBRATION_MODE);<br />

calibration = read_sd_adc();<br />

set_sd_adc_calibration(SDADC_END_CALIBRATION_MODE);<br />

result = read_sd_adc() - calibration;<br />

Example<br />

Files:<br />

Also See:<br />

None<br />

setup_sd_adc(), read_sd_adc(), set_sd_adc_channel()<br />

set_sd_adc_channel( )<br />

Syntax:<br />

setup_sd_adc(channel);<br />

Parameters: channel- sets the SD ADC channel to read. Channel can be 0 to read the<br />

difference between CH0+ and CH0-, 1 to read the difference between CH1+<br />

and CH1-, or one of the following:<br />

SDADC_CH1SE_SVSS<br />

SDADC_REFERENCE<br />

Returns:<br />

Function:<br />

Nothing<br />

To select the channel that the Sigma-Delta Analog to Digital Converter (SD<br />

275

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!