Browsing this Thread:
1 Anonymous Users
|
在18F1320 ADC 轉問疑問
|
|
中級會員
Joined
: 2006/7/25 9:50 最後登入時間
: 2010/4/10 10:42
Group:
註冊會員
Level : 5 HP : 0 / 120 MP : 16 / 6421 EXP : 82
|
想要請教各位大大 我使用MCC18的COMPLIER來做ADC轉換 很奇怪電壓明明有出現 可是就是轉換不過去 以下是我的程式片斷 還請各位大大幫忙一下 看看有哪邊需要更改的 我使用的是內部的XTAL 沒有接外部的參考電壓
主程式 AD_SENSOR=GetADCValueFromArg(ADCSensor); //呼叫RA1輸入後的判斷程式
副程式 unsigned int GetADCValueFromArg(unsigned char Channel) { unsigned int AD_CHECK; OpenADC(ADC_FOSC_RC & ADC_RIGHT_JUST & ADC_2_TAD, Channel & ADC_INT_OFF ,0b11111000); while(ADCON0bits.GO);//判斷AD轉換是否結束 AD_CHECK=ReadADC();//將讀到值丟給AD_TEMP CloseADC(); return AD_CHECK; }
發表於: 2006/11/21 16:01
|
|
You can view topic.
你 不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.