PCDIDE COMPILER Custom Computer Services Inc (CCS), PCDIDE COMPILER Datasheet - Page 69

PCD C-COMPILER PIC24, DSPIC

PCDIDE COMPILER

Manufacturer Part Number
PCDIDE COMPILER
Description
PCD C-COMPILER PIC24, DSPIC
Manufacturer
Custom Computer Services Inc (CCS)
Type
Compilerr
Datasheet

Specifications of PCDIDE COMPILER

For Use With/related Products
Microchip PIC24/dsPIC®
Lead Free Status / RoHS Status
Not applicable / Not applicable
Other names
429-1008
Relevant Interrupts:
INT_AD
INT_ADOF
Relevant Include Files:
None, all functions built-in
Relevant getenv() parameters:
ADC_CHANNELS
ADC_RESOLUTION
Example Code:
#DEVICE ADC=10
...
long value;
...
setup_adc(ADC_CLOCK_INTERNA
L);
setup_adc_ports(ALL_ANALOG);
set_adc_channel(0);
delay_us(10);
value=read_adc();
read_adc(ADC_START_ONLY);
value=read_adc(ADC_READ_ONLY
);
Interrupt fires when a/d conversion is complete
Interrupt fires when a/d conversion has timed out
Number of A/D channels
Number of bits returned by read_adc
//enables the a/d module
//and sets the clock to internal adc clock
//sets all the adc pins to analog
//the next read_adc call will read channel 0
//a small delay is required after setting the channel
//and before read
//starts the conversion and reads the result
//and store it in value
//only starts the conversion
//reads the result of the last conversion and store it in value.
Assuming the device hat a 10bit ADC module, value will
range between 0-3FF. If #DEVICE ADC=8 had been used
instead the result will yield 0-FF. If #DEVICE ADC=16 had
been used instead the result will yield 0-FFC0
55

Related parts for PCDIDE COMPILER