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.

Return Value: If the value of DONE is ‘0’, then ‘1’ is returned, indicating that<br />

the ADC<br />

is busy in conversion.<br />

If the value of DONE is ‘1’, then ‘0’ is returned, indicating that the ADC<br />

has completed conversion.<br />

Remarks: This function returns the complement of the ADCON1 bit<br />

status which indicates whether the ADC is busy in conversion.<br />

Source File: BusyADC12.c<br />

Code Example: while(BusyADC12());<br />

CloseADC12<br />

Description: This function turns off the ADC module and disables the ADC<br />

interrupts.<br />

Include: adc12.h<br />

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

Arguments: None<br />

Return Value: None<br />

Remarks: This function first disables the ADC interrupt and then turns off the<br />

ADC<br />

module.The Interrupt Flag bit (ADIF) is also cleared.<br />

Source File: CloseADC12.c<br />

Code Example: CloseADC12();<br />

ConfigIntADC12<br />

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

Include: adc12.h<br />

Prototype: void ConfigIntADC12(unsigned int config);<br />

Arguments: config ADC interrupt priority and enable/disable information as<br />

defined below:<br />

ADC Interrupt enable/disable<br />

ADC_INT_ENABLE<br />

ADC_INT_DISABLE<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

DS51456B-page 96<br />

ADC Interrupt priority<br />

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 />

2004 Microchip Technology Inc.<br />

ADC_MODULE_ON<br />

ADC_MODULE_OFF<br />

Hoạt động chế độ nhàn rỗi<br />

ADC_IDLE_CONTINUE<br />

ADC_IDLE_STOP<br />

ConfigIntADC12 (Tiếp theo)<br />

dsPIC Thư viện ngoại vi<br />

2004 Microchip Technology Inc DS51456B trang 97<br />

Định dạng đầu ra kết quả<br />

ADC_FORMAT_SIGN_FRACT<br />

ADC_FORMAT_FRACT<br />

ADC_FORMAT_SIGN_INT<br />

ADC_FORMAT_INTG<br />

Chuyển đổi nguồn kích hoạt<br />

ADC_CLK_AUTO<br />

ADC_CLK_TMR<br />

ADC_CLK_INT0<br />

ADC_CLK_MANUAL<br />

Tự động lấy mẫu chọn<br />

ADC_AUTO_SAMPLING_ON<br />

ADC_AUTO_SAMPLING_OFF<br />

Mẫu cho phép<br />

ADC_SAMP_ON<br />

ADC_SAMP_OFF<br />

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

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

Điện áp tham khảo<br />

ADC_VREF_AVDD_AVSS<br />

ADC_VREF_EXT_AVSS<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 />

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

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

Saved successfully!

Ooh no, something went wrong!