• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Re: 關於16f877a使用參考電壓問題
#13
資深會員
資深會員


查看用戶資訊
我覺得很奇怪....會不會是感測電路有問題....
如果在5v參考電壓下..則ad值從0~03ff都有出現.
但如果參考電壓比如1.25時(從CVREF產生)給VREF+... .
則我即使用精密電阻去調整電壓變化時.....發現有的AD值都跳過去...很努力慢慢調或其他方法..就是要把跳過去的AD值顯示出來..結果不可行....難道是因為參考電壓過小嗎?

發表於: 2009/12/25 10:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#12
版主
版主


查看用戶資訊
有心要學的話看一下這個教材( 201 ASP )

http://www.microchip.com.tw/modules/w ... nglefile.php?cid=4&lid=68

發表於: 2009/12/21 14:05
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#11
資深會員
資深會員


查看用戶資訊
互相漏氣求進步 .... , 我也是從資料手冊推演出來的 (我沒用過這種用法 )
你問題敘述很明瞭清楚 , 所以就很容易知道問題點出在那裡

而且我在這裡也有收穫 ...

.================================
參照:

windows 寫道:
請問一下,我設定好cvrcon暫存器指定參考電壓輸出至外部腳即RA2,我有設RA2為輸出,為何沒有輸出電壓,反而是我設定輸入腳時,就有量到電壓???資料手冊沒有提到.


===================
這也是我從沒用過 也沒想到的問題點 , 所以在其他的 MCU 或許也可以 依此類推 .....

發表於: 2009/12/19 23:27
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#10
資深會員
資深會員


查看用戶資訊
謝謝您的指導....我正好需要ad轉換公式....
資料手冊都沒提到...謝謉

發表於: 2009/12/19 16:40
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#9
資深會員
資深會員


查看用戶資訊
INPUT = 4.29V , Vref+ = 5V , Vref- = 3.75V

OUT = ( ( 4.29 - 3.75 ) / ( 5 - 3.75 ) ) * 1023 = 0X1B9

----------------------------

CVR_OUT = ( ( 15 + 8 ) /32 ) * 5 = 3.59375 V ; B'1111' = 15

INPUT = 4.29V , Vref+ = 5V , Vref- = 3.59375V

OUT = ( ( 4.29 - 3.59375) / ( 5 - 3.59375) ) * 1023 = 0X1FA

-------------------
多少有些誤差 , ( 精確度 , 採樣時間 , 阻抗 ..... ) , 自己再試試看 ......

發表於: 2009/12/19 6:48
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#8
資深會員
資深會員


查看用戶資訊
再請教問題.
已知輸入電壓2.5v,參考電壓Vref=5v,則ad=2.5/(5/1024)=0200H
今天,假設有一輸入電壓為4.29v,參考電壓Vref+=5v,Vref-=3.57v,請問ad值為多少?我想法是4.29/((5-3.75)/1024)=>最大值03FFH,但我電腦上SFR之ADRESHL=01CF.WHY?
我設定的條件如下:
877A之比較器參考電壓CVRCON=11001111B.
設定輸出到RA2並當成AD的參考電壓負端,
而AD的參考電壓正端從RA3直接拉至VDD=5V...
並設定ADCON1之PCFG3:PCFG0=1111即類比輸入腳為AN0
MPLAB結果如上,想不通為什麼?

發表於: 2009/12/17 14:02
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#7
資深會員
資深會員


查看用戶資訊
謝謝版主的指導...即使已做了那麼久了,自己經驗還是不足.謝謝.

發表於: 2009/12/17 11:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#6
版主
版主


查看用戶資訊
PIC16F877A 的 ADC 參考電壓輸入就是這樣設計的,如果要 Vref- 為 AN2 的輸入,那 Vref+ 就會設定由 AN3 輸入但是將 AN3 (Vref+) 接 Vdd 這樣就可以滿足你的需求的。

如果使用PIC16F887 就不會有這問題了,Vref+ & Vref- 始採個別獨立的設定方式的。

發表於: 2009/12/17 9:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#5
資深會員
資深會員


查看用戶資訊
請問,如果比較器參考電壓輸出至RA2,又因為RA2也是AD的參考電壓負端,則可以不用外部連接,直接拿來當AD的參考電壓負端嗎?我看了877A的ADCON1,發現VREF+=VDD時,VREF-只能是VSS.我想法是能不能參考電壓範圍是VDD~CVREF.....
如果不行,請問16F887是否能做到我要的參考電壓範圍呢?謝謝.

發表於: 2009/12/16 17:11
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16f877a使用參考電壓問題
#4
版主
版主


查看用戶資訊
RA2 因為屬於類比腳位功能,要TRIS 成輸入腳。
確定 CVRCON CONTROL REGISTER 的 CVROE = 1 :

bit 6 CVROE: Comparator VREF Output Enable bit
1 = CVREF voltage level is output on RA2/AN2/VREF-/CVREF pin
0 = CVREF voltage level is disconnected from RA2/AN2/VREF-/CVREF pin

發表於: 2009/12/16 15:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







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.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------