• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Re: dsPIC33EP64GS502 ADC抓取疑問
#12
版主
版主


查看用戶資訊
建議你還是先去讀一下 dsPIC30F Module Training 教材裡的 ADC 章節裡的說明。
先了解一下 ADC 的取樣方式及参考電壓的設定後,先了解 ADC 的手動轉換模式再了解自動轉換原理。教材裡都有說明及範例可以参考。

發表於: 2020/12/22 10:35
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dsPIC33EP64GS502 ADC抓取疑問
#11
中級會員
中級會員


查看用戶資訊
Ryan 不好意思 我還是沒有方向
在dspic33fj128mc708a中 設定111是自動轉換
但在dspic33ep64gs502的dasheet中沒看到自動轉換的選擇
還是選擇osc1就是自動轉換呢

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


Re: dsPIC33EP64GS502 ADC抓取疑問
#10
版主
版主


查看用戶資訊
111 = Internal counter ends sampling and starts conversion (auto-convert)
透過 Fosc 降頻後做自動觸發轉換。

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


Re: dsPIC33EP64GS502 ADC抓取疑問
#9
中級會員
中級會員


查看用戶資訊
兩位好
我有去看推薦的教學內容
利用APP026-2學習板 使用自動轉換
可讓AD值變化顯示在LCD上
但dsPIC33EP64GS502的trigger source中 看起來沒有自動轉換這個選項
是因為這功能沒有了嗎 或是我有地方誤解了
THX

dsPIC33FJ128MC708A trigger source定義
111 = Internal counter ends sampling and starts conversion (auto-convert)
110 = Reserved
101 = Reserved
100 = GP timer (Timer5 for ADC1, Timer3 for ADC2) compare ends sampling and starts conversion
011 = MPWM interval ends sampling and starts conversion
010 = GP timer (Timer3 for ADC1, Timer5 for ADC2) compare ends sampling and starts conversion
001 = Active transition on INT0 pin ends sampling and starts conversion


dsPIC33EP64GS502 trigger source定義
11111 = ADTRG31
11110 = Reserved
11101 = Reserved
11100 = PWM Generator 5 current-limit trigger
11011 = PWM Generator 4 current-limit trigger
11010 = PWM Generator 3 current-limit trigger
11001 = PWM Generator 2 current-limit trigger
11000 = PWM Generator 1 current-limit trigger
10111 = Output Compare 2 trigger
10110 = Output Compare 1 trigger
10101 = Reserved
10100 = Reserved
10011 = PWM Generator 5 secondary trigger
10010 = PWM Generator 4 secondary trigger
10001 = PWM Generator 3 secondary trigger
10000 = PWM Generator 2 secondary trigger
01111 = PWM Generator 1 secondary trigger
01110 = PWM secondary Special Event Trigger
01101 = Timer2 period match
01100 = Timer1 period match
01011 = Reserved
01010 = Reserved
01001 = PWM Generator 5 primary trigger
01000 = PWM Generator 4 primary trigger
00111 = PWM Generator 3 primary trigger
00110 = PWM Generator 2 primary trigger
00101 = PWM Generator 1 primary trigger
00100 = PWM Special Event Trigger
00011 = Reserved
00010 = Level software trigger
00001 = Common software trigger
00000 = No trigger is enabled

發表於: 2020/12/20 22:43
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dsPIC33EP64GS502 ADC抓取疑問
#8
管理員
管理員


查看用戶資訊
我做的實驗,透過dsPIC33EP256MU806
ADC:10Bit,Trigger source:Timer 3 (100us->10K)
VR轉動,ADC可以正常取樣數值
讓你交互比對

Attach file:


Link only for registered users

發表於: 2020/12/18 11:28

Edited by Darren on 2020年12月18日 12:01:32
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dsPIC33EP64GS502 ADC抓取疑問
#7
版主
版主


查看用戶資訊
要不要先参考一下教育訓練光碟下的 dsPIC30F Module Training 的教材,裡面有一 ADC 使用的章節,那裡就有說明手動轉換、時脈自動觸發轉換及使用 Timer 的觸發轉換的說明。

我有請同事寫一下範例,完成後會貼上來的。

發表於: 2020/12/18 9:45
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dsPIC33EP64GS502 ADC抓取疑問
#6
中級會員
中級會員


查看用戶資訊
trigger source我是選擇timer1
因為我試過選擇none 和 osc1 則連一筆都抓不到
請問是要選擇哪一個trigge source才能讓ADC會自己重複轉換

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


Re: dsPIC33EP64GS502 ADC抓取疑問
#5
版主
版主


查看用戶資訊
你的 ADC 的專換機制是自動轉換還是透過 Timer1 的觸發轉換? 如果是透過 Timer1 的觸發轉換髂一定要等 Timer1 完成觸發轉換後到中斷裡去讀取 ADC 的值,或設個旗號在主回圈裡做判斷看是否已完成了 ADC 的轉換工作。

先檢查一下 Timer1 的動作,再檢查 ADC 的轉換。

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


Re: dsPIC33EP64GS502 ADC抓取疑問
#4
中級會員
中級會員


查看用戶資訊
Ryan好
我有在getadc之前讓某個io輸出high
Gateadc之後讓io輸出low
看起來每抓一次adc大約會花5us
抓100次大概也會花500us

另外程式跑一陣子按暫停後去看adbuf1的值
和x[i]內的值是一樣的
感覺像是只有轉換ㄧ次Ad值
就沒有再繼續轉換
所以adbuf1也沒有繼續更新

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


Re: dsPIC33EP64GS502 ADC抓取疑問
#3
版主
版主


查看用戶資訊
會不會在 while(1) 迴圈抓 ADC 的資料太快了,導致 ADC 都沒有時間做下一次的轉換抓走的都是同一筆的資料。

建議加個 for 的 delay 迴圈,降低抓取 ADC 的速度看看。

發表於: 2020/12/17 12:23
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... ]

教育訓練中心

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