Browsing this Thread:
1 Anonymous Users
|
Re: 在PIC18f85j10中使用AD0遇到的一些問題,多謝大家能够幫幫我
|
|
新會員
Joined
: 2007/12/7 14:13 最後登入時間
: 2008/1/23 8:35
Group:
註冊會員
Level : 1 HP : 0 / 18 MP : 2 / 905 EXP : 73
|
問題已經解决了.
發表於: 2007/12/27 11:32
|
|
|
在PIC18f85j10中使用AD0遇到的一些問題,多謝大家能够幫幫我
|
|
新會員
Joined
: 2007/12/7 14:13 最後登入時間
: 2008/1/23 8:35
Group:
註冊會員
Level : 1 HP : 0 / 18 MP : 2 / 905 EXP : 73
|
在PIC18f85j10中使用AD0遇到的一些問題 在PIC18F85J10中使用AD0做AD變換,我的程序這樣: void PortInit(void) { TRISA = 0x1d; TRISB=0xfe; TRISC=0x91; TRISD=0x00; TRISE=0x00; TRISF=0x02; TRISH=0x00; TRISG=0x00; TRISJ=0xf0;
} void CVPinit(void) { INTCON=0x20; PIR1=0x13; PIE1=0x23; CMCON=0x07; CVRCON=0x00; ADCON0 = 0x01; ADCON1 = 0x0c; ADCON2 = 0xBE; //40MHZ晶振 } unsigned int FADCDone(void) { unsigned int FADCtemp; FADCdat = 0; ADCON0 = 0x01; ADCON0bits.GO_DONE = 1; while(!PIR1bits.ADIF); PIR1bits.ADIF = 0; ADCON0bits.GO_DONE = 0; FADCtemp = ADRESH; FADCtemp <<= 8; FADCtemp += ADRESL; return FADCtemp; } void main(void) { unsigned int tdata; PortInit(); CVPinit(): tdata= FADCDone(); } AD變換得到的AD值總是一部分值是實際轉換出來的AD值,時不時的冒出一個AD值是0x200,我就不清楚0x200是怎麽得出來的,也不知我這軟件編寫的有什么錯誤?硬件上是采用3.3V基準,多謝大家能够幫幫我啊
發表於: 2007/12/26 14:48
|
|
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.