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


Browsing this Thread:   1 Anonymous Users




« 1 (2)


Re: PIC24HJ64GP206之AD轉換問題
#5
新會員
新會員


查看用戶資訊
感謝版主熱心協助,關於DMA的設定我已經完成,已可以使用4-channel的ADC轉換訊號,但還是有幾個問題想要請教。

問題1:似乎使用DMA會花比較多的時間,因為一開始設定完後沒辦法使用,後來抓到問題是時間太短來不及中斷,所以需要delay一點時間等中斷。

問題2:有關DMA設定中,DMA0CON中ping-pong mode到底是什麼意思,我的理解是bufferA->B->A->B這樣循環儲存,但是我看起來結果卻不是這樣,把他disable掉結果也還是一樣,所以可以請版主解釋一下嗎?

問題3:是否可以完成像spec裡說的同時擷取的功能,因為像我現在完成的功能截取出的訊號之間還是有時間差,感謝

發表於: 2008/3/24 18:55
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC24HJ64GP206之AD轉換問題
#4
版主
版主


查看用戶資訊
DMA 的原理與工作範例可以參考 204 ADV 的教材。左邊下載中心裡有。

發表於: 2008/3/24 16:14
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC24HJ64GP206之AD轉換問題
#3
新會員
新會員


查看用戶資訊
感謝版主的回應,目前我已經針對dma的設定開始工作

發表於: 2008/3/24 14:30
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC24HJ64GP206之AD轉換問題
#2
版主
版主


查看用戶資訊
PIC24HJ & dsPIC33F 如果一次要轉一個次AD輸入的話是比較簡單的,可以利用切換AD CH 達到多輸入的轉換:
void __attribute__((interruptno_auto_psv)) _ADC1Interrupt(void)
{

        
IFS0bits.AD1IF ;
        
MyADC ADC1BUF0 ;
}

void ADC_Initial(void)
{

     
AD1PCFGL 0xFFDF;                // AN5 is Analog , others are Digital;
     
AD1CON1 0x0446;                // 0b0000 0000 0100 0110 
                        // Auto convert using TMR3 as trigger source
        // A/D Sample Auto-Start
     
AD1CON2 0x0000;                // ADCON2 = 0000 0000 0000 0000
        // Don't scan inputs , SMPi = 00 ( Interrupt for each sample/convert )
     
AD1CSSL 0x0000;                // no scan input selected .......
     
AD1CON3 0x1F3F;                // TAD = 8 Tcy , SAMC = 15 TAD 
    
AD1CHS0 0x0005;                // ADCHS = 0b 00000000 00000101
    
AD1CON4 0x0000;

    
IFS0bits.AD1IF ;
    
IEC0bits.AD1IE ;            // Enable AD interrupt
    
IPC3bits.AD1IP ;            // Set Priority to 7     >> highest !!
 
     
AD1CON1bits.ADON 1;            // turn ADC ON
}


如果你要同時作多輸入的轉換就必須啟動 DMA 功能,由 DMA Controller 幫你轉換並將結果方在 DAM RAM 裡,動作有點複雜,但功能遭強的。請參考 Microchip 所提供的 Code Example。
http://www.microchip.com/stellent/idc ... e=SS_GET_PAGE&nodeId=2622

http://www.microchip.com/stellent/idc ... e=SS_GET_PAGE&nodeId=2623

發表於: 2008/3/24 10:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


PIC24HJ64GP206之AD轉換問題
#1
新會員
新會員


查看用戶資訊
各位前輩們好,想請問一下有關pic24的ad轉換問題,
因為pic24的ad轉換暫存器只有ADC1BUF0而不像是DsPIC30系列有
ADCBUF0~F的暫存器,這樣話萬一要同時擷取多個訊號時,PIC24要如何處理,謝謝

發表於: 2008/3/21 17:21
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... ]

教育訓練中心

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