Re: 發現ADC.h的內容有誤
|
||||
---|---|---|---|---|
資深會員
|
參照:
LSB 4 bit 是沒錯 , 至於 4 , 5 bit ( VCFG0 & VCFG1 ) 可能還須要與其他參數 作運算 ( 例 : .AND. ) 才會得到正確參數 ... 要追蹤整個 HEAD 檔 LOADING 太重 , 我想較簡單的方式是寫個小程式來驗證結果是否正確 應該是比較可行的方法 Attach file: (0.00 KB)
發表於: 2009/12/17 4:24
|
|||
|
發現ADC.h的內容有誤
|
||||
---|---|---|---|---|
高級會員
|
我是用PIC18F4520
MPLAB-C18-Std-Eval-v3_33 ADC.h內的OpenADC () 以下參數有誤 #elif defined (ADC_V2) || defined (ADC_V5) || defined (ADC_V6) || defined (ADC_V12) #ifndef USE_OR_MASKS //***************A/D Port Configuration Control ******************************* #define ADC_0ANA 0b11111111 // All channels are digital #define ADC_1ANA 0b11111110 // analog: AN0 and remaining channels are digital #define ADC_2ANA 0b11111101 // analog: AN0->1 and remaining channels are digital #define ADC_3ANA 0b11111100 // analog: AN0->2 and remaining channels are digital #define ADC_4ANA 0b11111011 // analog: AN0->3 and remaining channels are digital #define ADC_5ANA 0b11111010 // analog: AN0->4 and remaining channels are digital #define ADC_6ANA 0b11111001 // analog: AN0->5 and remaining channels are digital #define ADC_7ANA 0b11111000 // analog: AN0->6 and remaining channels are digital #define ADC_8ANA 0b11110111 // analog: AN0->7 and remaining channels are digital #define ADC_9ANA 0b11110110 // analog: AN0->8 and remaining channels are digital #define ADC_10ANA 0b11110101 // analog: AN0->9 and remaining channels are digital #define ADC_11ANA 0b11110100 // analog: AN0->10 and remaining channels are digital #ifndef ADC_V12 #define ADC_12ANA 0b11110011 // analog: AN0->11 and remaining channels are digital #define ADC_13ANA 0b11110010 // analog: AN0->12 and remaining channels are digital #define ADC_14ANA 0b11110001 // analog: AN0->13 and remaining channels are digital #define ADC_15ANA 0b11110000 // All channels are analog #endif 例如: #define ADC_1ANA 0b11111110 應該是0b00001110 #if defined ( ADC_V2 ) || defined (ADC_V3) || defined (ADC_V4 ) ||\ defined ( ADC_V5 ) || defined ( ADC_V6 ) || defined (ADC_V7) ||\ defined (ADC_V7_1) || defined ( ADC_V8 ) || defined (ADC_V9) ||\ defined (ADC_V11) || defined (ADC_V12) #define ADC_VREFPLUS_VDD ADC_REF_VDD_VREFMINUS // VREF+ = AVDD #define ADC_VREFPLUS_EXT ADC_REF_VREFPLUS_VREFMINUS // VREF+ = external.. #define ADC_VREFMINUS_VSS ADC_REF_VREFPLUS_VSS // VREF- = AVSS #define ADC_VREFMINUS_EXT ADC_REF_VREFPLUS_VREFMINUS // VREF- = external 其中ADC_VREFPLUS_EXT和ADC_VREFMINUS_EXT的定義一樣? ---------------------------------------------------------------------- 如果是我看錯, 請指教! 謝謝!
發表於: 2009/12/16 14:07
|
|||
|