30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADC_INT_PRI_5<br />

ADC_INT_PRI_6<br />

ADC_INT_PRI_7<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: ConfigIntADC12.c<br />

Code Example: ConfigIntADC12(ADC_INT_PRI_6 &<br />

ADC_INT_ENABLE);<br />

ConvertADC12<br />

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

Include: adc12.h<br />

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

Arguments: None<br />

Return Value: None<br />

Remarks: This function clears the ADCON1 bit 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: ConvertADC12.c<br />

Code Example: ConvertADC12();<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 />

OpenADC12 (Tiếp theo)<br />

dsPIC<br />

®<br />

Thư viện Công cụ Ngôn ngữ<br />

OpenADC12<br />

DS51456B trang 98<br />

2004 Microchip Technology Inc<br />

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

Include: adc12.h<br />

Prototype: void OpenADC12(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 />

Module On/Off<br />

ADC_MODULE_ON<br />

ADC_MODULE_OFF<br />

Idle mode operation<br />

ADC_IDLE_CONTINUE<br />

ADC_IDLE_STOP<br />

ConfigIntADC12 (Continued)<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 />

configport này chứa pin chọn được cấu hình vào<br />

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

ENABLE_ALL_ANA<br />

ENABLE_ALL_DIG<br />

ENABLE_AN0_ANA<br />

ENABLE_AN1_ANA<br />

ENABLE_AN2_ANA<br />

.....<br />

ENABLE_AN15_ANA<br />

configscan này bao gồm các lựa chọn tham số quét là

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

Saved successfully!

Ooh no, something went wrong!