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

論壇索引


Board index » All Posts (sean0414)




Re: ADC最快多久抓一次
#11
中級會員
中級會員


RYANG大好

我們是要應用在高速偵測距離 , 所以需要至少2M以上的sample rate
空間上也有限制 所以不能用太大顆的IC

因為AD轉換後還會做FFT轉換 ,想請問若是用over sample的平均模式
經過FFT會不會出現失真的情況
感謝回覆

發表於: 2021/3/11 20:43
頂部


Re: ADC最快多久抓一次
#12
中級會員
中級會員


補充一下
若程式改為 x=ADCBUF2; 則只需要耗時110ns
看起來讀取ADCBUF1的時間會是ADCBUF2的三倍

發表於: 2021/3/5 8:57
頂部


Re: ADC最快多久抓一次
#13
中級會員
中級會員


Ryang大 好

感謝回覆!! 想再請教一下
在Fosc=140MH時 觸發ADC取樣並轉換成功耗時350ns (接近3.25M/s)
但x=ADCBUF1;這個指令就花費390ns
不知道是否有其他更快速的方式去抓取ADCBUF
THX

/////////////////////////////////程式範例///////////////////////////////
ADCON3Lbits.SWCTRG=1;
while(!ADSTATLbits.AN1RDY)
{
}
x=ADCBUF1;

發表於: 2021/3/4 20:24
頂部


Re: ADC最快多久抓一次
#14
中級會員
中級會員


Ryang大 好

感謝您的建議
後來我將TRIG方式改為common software trigger
然後在程式中加入以下程式 在Fosc=85M下可得到1.8M的取樣率

ADCON3Lbits.SWCTRG=1;
while(!ADSTATLbits.AN1RDY)
{
}
x=ADCBUF1;

但想再請問幾個問題
1.
當使用8MHz的震盪器, 在MCC中 PLL頻率最高只能設為85M
但若從程式去設定PLLPRE , PLLPOST , 等暫存器
可以將PLL輸出頻率提高為100M以上
想請問MCC設定這樣的上限是有什麼用意嗎

2.
dsPIC33ep64gs502型錄內說最高可至70MIPS
是指Fcy最高為70M ,Fosc最高為140M嗎
不知道這理解正確嗎

感謝您抽空回覆

發表於: 2021/3/4 9:15
頂部


Re: ADC最快多久抓一次
#15
中級會員
中級會員


ryan大好

因看dspic33ep64GS502的型錄上有提到以下規格
"Up to 3.25 Msps Conversion Rate per Channel at 12-Bit Resolution"
但我實際操作用timer1觸發只能達到約1Mhz的取樣率 , 和3.25有點差距,
還是3.25Mhz是只有轉換,不包含取樣與等待觸發的時間
我的目的是希望能以1.28Mhz的取樣率來抓AD值,
判斷方式是進timer中斷後,IO輸出high,ADC做完後,IO輸出low , 並等待下次timer觸發, 從IO的間隔時間看起來ADC 取樣+轉換約400ns , 等待timer下次觸發約500ns

另外請問你是指使用over-sampling mode就可以自動快速取樣轉換嗎? 那TRGSRC這個register要設定為什麼?

感謝回復

發表於: 2021/2/8 11:05
頂部


FFT 範例CE018相關問題
#16
中級會員
中級會員


各位好 因不熟練C語言
想請問CE018範例中,inputsignal_square1khz.c的輸入訊號sigCmpx
看起來是將ADC值依序放在sigCmpx[0].real , sigCmpx[0].imag ,sigCmpx[1].real , sigCmpx[1].imag
(所以256點只會放到sigCmpx[128])
然後經過下面主程式 把第一筆ADC值放在sigCmpx[0].real
再放0x0000到sigCmpx[0].imag ,
依序放入sigCmpx變數 再去做FFT 這樣理解對嗎

然後經過SquareMagnitudeCplx輸出的sigCmpx變數是否已經沒有
real和imag的分別,每一個點都是代表頻率的大小,這樣的理解對嗎
THX

//////////////////////////////////主程式程式碼/////////////////////////////////////////
p_real = &sigCmpx[(FFT_BLOCK_LENGTH/2)-1].real ;
p_cmpx = &sigCmpx[FFT_BLOCK_LENGTH-1] ;

for ( i = FFT_BLOCK_LENGTH; i > 0; i-- )
{
(*p_cmpx).real = (*p_real--);
(*p_cmpx--).imag = 0x0000;
}
///////////////////////////////////////////////////////////////////////////////////////////////////

發表於: 2021/2/5 11:18
頂部


Re: ADC最快多久抓一次
#17
中級會員
中級會員


補充一下
在MCC上設定TMR1
Clock source為Fosc/2 =42.5MHz
Period count為0x1
Timer period為23.5ns
Calculated period為23ns
但從示波器上看間隔約700ns才觸發下一次timer
再麻煩了 感謝

發表於: 2021/1/28 18:39
頂部


ADC最快多久抓一次
#18
中級會員
中級會員


想請問dsPIC33ep64GS502 若是用timer1最快可以多久抓一次ADC
Tad=14.28ns resolution=12-bit 使用8MHz振盪器 倍頻至85MHz
最快轉換時間是14.28*(12+2)=200ns 那最快取樣時間該如何計算

因為從示波器看起來 取樣+轉換約400ns 等待timer1下次觸發約500ns
所以約900ns才抓一筆ADC 但希望能壓在750ns內
不知是否還可以降低ADC取樣轉換時間或timer1觸發時間
感謝

發表於: 2021/1/26 23:15
頂部


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


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

發表於: 2020/12/21 14:57
頂部


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


兩位好
我有去看推薦的教學內容
利用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
頂部



« 1 (2) 3 4 5 »



:::

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... ]

教育訓練中心

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