30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ADC_INT_PRI_0<br />

ADC_INT_PRI_1<br />

ADC_INT_PRI_2<br />

ADC_INT_PRI_3<br />

ADC_INT_PRI_4<br />

ADC_INT_PRI_5<br />

ADC_INT_PRI_6<br />

ADC_INT_PRI_7<br />

dsPIC Peripheral Libraries<br />

2004 Microchip Technology Inc. DS51456B-page 103<br />

Return Value: None<br />

Remarks: This function clears the Interrupt Flag (ADIF) bit and then sets the<br />

interrupt priority and enables/disables the interrupt.<br />

Source File: ConfigIntADC10.c<br />

Code Example: ConfigIntADC10(ADC_INT_PRI_3 &<br />

ADC_INT_DISABLE);<br />

ConvertADC10<br />

Description: This function starts the A/D conversion.<br />

Include: adc10.h<br />

Prototype: void ConvertADC10(void);<br />

Arguments: None<br />

Return Value: None<br />

Remarks: This function clears the ADCON1bit and thus stops<br />

sampling<br />

and starts conversion.<br />

This happens only when trigger source for the A/D conversion is<br />

selected as Manual, by clearing the ADCON1 bits.<br />

Source File: ConvertADC10.c<br />

Code Example: ConvertADC10();<br />

OpenADC10<br />

Description: This function configures the ADC.<br />

Include: adc10.h<br />

Prototype: void OpenADC10(unsigned int config1,<br />

unsigned int config2,<br />

unsigned int config3,<br />

unsigned int configport,<br />

unsigned int configscan)<br />

Arguments: config1 This contains the parameters to be configured in the<br />

ADCON1 register as defined below:<br />

ADC_VREF_AVDD_EXT<br />

ADC_VREF_EXT_EXT<br />

Lựa chọn quét<br />

ADC_SCAN_ON<br />

ADC_SCAN_OFF<br />

Kênh A / D sử dụng<br />

ADC_CONVERT_CH0123<br />

ADC_CONVERT_CH01<br />

ADC_CONVERT_CH0<br />

Số mẫu giữa ngắt<br />

ADC_SAMPLES_PER_INT_1<br />

ADC_SAMPLES_PER_INT_2<br />

.....<br />

ADC_SAMPLES_PER_INT_15<br />

ADC_SAMPLES_PER_INT_16<br />

Chế độ đệm chọn<br />

ADC_ALT_BUF_ON<br />

ADC_ALT_BUF_OFF<br />

Chế độ mẫu thay thế đầu vào chọn<br />

ADC_ALT_INPUT_ON<br />

ADC_ALT_INPUT_OFF<br />

config3 này chứa các thông số phải được cấu hình trong<br />

ADCON3 đăng ký theo quy định dưới đây:<br />

Bit Thời gian tự động mẫu<br />

ADC_SAMPLE_TIME_0<br />

ADC_SAMPLE_TIME_1<br />

.....<br />

ADC_SAMPLE_TIME_30<br />

ADC_SAMPLE_TIME_31<br />

Chuyển đổi đồng hồ Nguồn chọn<br />

ADC_CONV_CLK_INTERNAL_RC<br />

ADC_CONV_CLK_SYSTEM<br />

Đồng hồ chuyển đổi chọn<br />

ADC_CONV_CLK_Tcy2<br />

ADC_CONV_CLK_Tcy<br />

ADC_CONV_CLK_3Tcy2<br />

.....<br />

ADC_CONV_CLK_32Tcy<br />

OpenADC10 (Tiếp theo)

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

Saved successfully!

Ooh no, something went wrong!