• slider image 442
  • slider image 497
  • slider image 498
  • slider image 499
  • slider image 500
  • slider image 502
:::


Browsing this Thread:   1 Anonymous Users






Re: 請問有關 AD問題
#2
新會員
新會員


查看用戶資訊
void ADC_Initial(void)
{
AD1CON1 = 0b0000000000000110 ; set SAMP auto set
AD1CON2 = 0b0000000000000000 ;
AD1CON3 = 0b1000001100001111 ; internal RC clock
as A/D clock
Auto-sample time
is 3 Tad
A/D conversion
clock is 16 Tcy
AD1CHS0 = 0x00 ;
AD1PCFG = 0b1111111111111011 ; AN2 enable
AD1CON1bits.ADON = 1 ; A/D module
enable
}

請問是A/D 初始化有問題嗎?
而PIC24FJ256GB110 Family datasheet(編號39897b)上AD1PCFG改成AD1PCFGL 和 AD1PCFGH但是
程式編譯會出現undefined錯誤

PIC24FJ64GB106.o(.text+0xd2): In function `ADC_Initial':
D:\Code\PIC24FJ64GB106\PIC24FJ64GB106.c:90: undefined reference to `AD1PCFGL'
Link step failed.

是這個問題讓A/D轉換不正常嗎??

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


請問有關 AD問題
#1
新會員
新會員


查看用戶資訊
小弟用 APP026-3 開發板MCU用PIC24FJGA006
run光碟Demo的範例程式 AD轉換值都正常
但是MCU我換上PIC24FJGB106後
register名稱照datasheet修改 AD1CHS改為AD1CHS0
AD的值一直維持在1023..沒有改變
請問是哪裡有問題阿??

int main(void)
{
int LoopVar1 ;

ADC_Initial() ;
PMP_Initial();
AD1PCFGbits.PCFG15 = 1 ;
LCD_Initial() ;

LED0 = 0 ;
TRISDbits.TRISD0 = 0;

putrsLCD("I am APP026-3") ;

LCD_SetCursor(0,1) ;
putrsLCD("ADC=") ;

while(1)
{

AD1CHS0 = 0x0002 ;

AD_Delay() ;
AD1CON1bits.SAMP = 0 ;

Nop() ;
Nop() ;
while ( ! AD1CON1bits.DONE ) ;

ADC_TempValue = ADC1BUF0 ;

}

void ADC_Initial(void)
{
AD1CON1 = 0b0000000000000110 ;
AD1CON2 = 0b0000000000000000 ;
AD1CON3 = 0b1000001100001111 ;
AD1CHS0 = 0x00 ;
AD1PCFG = 0b1111111111111011 ;
AD1CON1bits.ADON = 1 ;
}

Attach file:


Link only for registered users

發表於: 2008/11/24 16:46

Edited by yuju on 2008年11月24日 19:04:50
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... ]

教育訓練中心

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