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

PCWHD PIC10,16,18,24, DSPIC

PCWHD IDE COMPILER

Manufacturer Part Number
PCWHD IDE COMPILER
Description
PCWHD PIC10,16,18,24, DSPIC
Manufacturer
Custom Computer Services Inc (CCS)
Type
Compilerr
Datasheet

Specifications of PCWHD IDE COMPILER

For Use With/related Products
Microchip PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC MCUs
Lead Free Status / RoHS Status
Not applicable / Not applicable
Other names
429-1009
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 PCWHD IDE COMPILER