Re: 如何同時使用兩組 ADC ?
|
||||
---|---|---|---|---|
初級會員
|
請問一下
所以這樣的意思是 如果我給他的電壓 VDD/VSS 是 +5V/0V 我沒有辦法讓我的 Vref- 是負的嗎? 謝謝回答
發表於: 2008/11/24 14:21
|
|||
|
Re: 如何同時使用兩組 ADC ?
|
||||
---|---|---|---|---|
資深會員
|
Vref+/Vref- 的最大電壓範圍就是電源電壓 VDD/VSS
發表於: 2008/11/18 18:33
|
|||
|
Re: 如何同時使用兩組 ADC ?
|
||||
---|---|---|---|---|
初級會員
|
了解
謝謝你 另外,如果我想要設定我的 Vref+ (AN3) 和 Vref- (AN2) 可以問一下 Vref+/Vref- 的最大電壓可以給多少?
發表於: 2008/11/18 17:35
|
|||
|
Re: 如何同時使用兩組 ADC ?
|
||||
---|---|---|---|---|
資深會員
|
有好幾組 AD 通道,但只有一組Sample/Hold 與一組轉換器。
因此,兩組 I/O 要先設成 Analog,先選一組通道,轉完再切換另一通道。 更換通道後,應先等待一小段時間 (Datasheet 上的 Sample/Hold Time),讓取樣電容重新取樣(充電)完成,才不會有誤差。 ※ 要有 2 組或以上 Sample/Hold 與/或 轉換器,真正“同時”抓資料來轉換的話,dsPIC 裡有,PIC24 不太確定‧‧‧
發表於: 2008/11/18 17:22
|
|||
|
如何同時使用兩組 ADC ?
|
||||
---|---|---|---|---|
初級會員
|
各位好
我這邊需要同時用到兩個 AD 例如: AN0, AN1 我的程式簡單來說是如以下: void main (void) { PORTD = 0x00; TRISD = 0; ADCON0=0x01; // 選擇AN0通道轉換,開啟ADC模組 ADCON1=0x0E; // 使用VDD,VSS為參考電壓,設定AN0為類比輸入 ADCON2=0x3A; // 結果向左靠齊並設定轉換時間為Fosc/32,採樣時間為20TAD while(1) { Delay10TCYx(5); //時間延遲以完成採樣 ConvertADC() ; //進行訊號轉換 while(BusyADC()); //等待轉換完成 adcvalue = ReadADC()>>6; delay_ms(1000); } } 我以上程式是設定可以讓 AN0 當作我的 analog input 然後武可以直接去讀他的值是多少 如果我現在希望可以把 AN0 和 AN1 兩支腳 的值都讀進來 要如何去寫? 可以直接改我的 ADCON1 讓 AN0 和 AN1 的腳都是 analog 可是這樣 我用 ReadADC 它會讀到的資料是什麼 那我 ADCON0 該如何設定? 謝謝回答! edit: 我希望可以在同一個時間讀/存這兩支腳的value
發表於: 2008/11/18 14:53
Edited by ventrox on 2008年11月18日 15:24:58
|
|||
|