PCD
...
setup_adc(ADC_CLOCK_INTERNAL); //enables the a/d module
//and sets the clock to internal adc clock
setup_adc_ports(ALL_ANALOG);
set_adc_channel(0);
delay_us(10);
value=read_adc();
read_adc(ADC_START_ONLY);
//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
value=read_adc(ADC_READ_ONLY); //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
Analog Comparator
These functions set up the analog comparator module. Only available in some devices.
Relevant Functions:
Enables and sets the analog comparator module. The options
setup_comparator(mode)
vary depending on the chip. Refer to the header file for
details.
Relevant Preprocessor:
None
Relevant Interrupts:
INT_COMP
Relevant Include Files:
None, all functions built-in
Relevant getenv() Parameters:
Returns 1 if the device has a
comparator
Example Code:
setup_comparator(A4_A5_NC_NC);
if(C1OUT)
output_low(PIN_D0);
else
output_high(PIN_D1);
32
Interrupt fires on comparator detect. Some chips have more
than one comparator unit, and thus, more interrupts.
COMP
相关PDF资料
PCI-EXP-T42G5-N1 IP CORE PCI EXPRESS ORCA 4
PCM18XH2 PROCESSOR MODULE MPLAB-ICE 2000
PCM18XN0 PROCESSOR MODULE FOR ICE2000
PDA-B-24-615-E-2B1-1-C CIRCUIT BREAKER MAG 1P 15A
PFMF.260.2 PFMF PTC FUSE SMT 2.6A 1812
PFNF.200.2 PFNF PTC FUSE SMT 2A 1206
PFRY.375 PTC-FUSE RADIAL 72 VDC
PFSM.150.33.2 FUSE PTC 8A 15V FST-TRIP SMD
相关代理商/技术参数
PCD_09 制造商:MACOM 制造商全称:Tyco Electronics 功能描述:Low Profile PCB Relay PCD
PCD-00173-0C 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00173-0E 制造商:Molex 功能描述:Ethernet Cable Assembly
PCD-00173-0H 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00173-0K 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00174-0C 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY; Cable Length - Imperial:3ft; Cable Length - Metric:914.4mm; Connector Type A:RJ45 Plug; Connector Type B:RJ45 Plug; Jacket Color:Red; Approval Bodies:CSA / UL; Body Material:PVC; Cable Assembly Type:Ethernet ;RoHS Compliant: NA
PCD-00174-0E 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY; Cable Length - Imperial:3ft; Cable Length - Metric:914.4mm; Connector Type A:RJ45 Plug; Connector Type B:RJ45 Plug; Jacket Color:Grey; Approval Bodies:CSA / UL; Body Material:PVC; Cable Assembly Type:Ethernet;RoHS Compliant: NA
PCD-00174-0H 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY