• 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: dsPIC33FJ128MC708 函數問題
#3
初級會員
初級會員


查看用戶資訊
謝謝版主的回覆…感謝!!!

發表於: 2007/9/13 17:51
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: dsPIC33FJ128MC708 函數問題
#2
版主
版主


查看用戶資訊
參照:
In function 'Init_ADC'
error: too few arguments to function 'OpenADC1'
error: too few arguments to function 'SetChanADC1'

傳給函數的參數不對也太少了,請參考 C30 Libraries User's Guide 的說明。

參照:
In function `main'
undefined reference to `ConfigIntTimer1'
undefined reference to `OpenTimer1'

應該是忘了 include timer.h 的檔案了。

發表於: 2007/9/13 15:19
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


dsPIC33FJ128MC708 函數問題
#1
初級會員
初級會員


查看用戶資訊
請問各位前輩…我是使用APP021模擬板,主控晶片是dsPIC33FJ128MC708,可是在編寫程式時,無法成功使用
以下這些函數,則output示窗會出現以下六行訊息,是在這裡的寫法不同,還是原因如何,煩請前輩們解答,謝謝。

ConfigIntTimer1( )
OpenTimer1( )
BusyADC1()
CloseADC1()
ConfigintADC1()
ConvertADC1()
OpenADC1()
ReadADC1()
SetChanADC1()


In function 'Init_ADC'
error: too few arguments to function 'OpenADC1'
error: too few arguments to function 'SetChanADC1'

In function `main'
undefined reference to `ConfigIntTimer1'
undefined reference to `OpenTimer1'

include Library Files

libp33FJ128MC708-elf.a
libp33FJ128MC708-coff.a

程式:

#include <P33FJ128MC708.h>
#include "C30EVM_LCD.h"
#include <adc.h>
#include <timer.h>
#define FCY 7372800 * 2




int main( void )



ConfigIntTimer1( T1_INT_PRIOR_7 & T1_INT_ON ) ;

OpenTimer1( T1_ON & T1_IDLE_STOP & T1_GATE_OFF &
T1_PS_1_1 & T1_SYNC_EXT_OFF & T1_SOURCE_INT , (FCY/ 1000) ) ;


void Init_ADC(void)
{

unsigned int Channel, PinConfig, Scanselect, ADxCON4_reg, ADxCON3_reg, ADxCON2_reg, ADxCON1_reg;

AD1CON1bits.ADON = 0;

PinConfig = ENABLE_AN0_ANA;

ADxCON1_reg = ADC_MODULE_ON &
ADC_IDLE_STOP &
ADC_FORMAT_INTG &
ADC_CLK_MANUAL &
ADC_SIMULTANEOUS &
ADC_AUTO_SAMPLING_OFF;

ADxCON2_reg = ADC_VREF_AVDD_AVSS &
ADC_SCAN_OFF &
ADC_ALT_BUF_OFF &
ADC_ALT_INPUT_OFF &
ADC_SELECT_CHAN_0 &
ADC_DMA_ADD_INC_1;

ADxCON3_reg = ADC_SAMPLE_TIME_10 &
ADC_CONV_CLK_SYSTEM &
ADC_CONV_CLK_4Tcy;

ADxCON4_reg = ADC_DMA_BUF_LOC_128 ;


Scanselect = SCAN_NONE_0_15;

OpenADC1(ADxCON1_reg, ADxCON2_reg, ADxCON3_reg, PinConfig, Scanselect);

Channel = ADC_CH0_POS_SAMPLEA_AN0 &
ADC_CH0_NEG_SAMPLEA_VREFN ;
SetChanADC1(Channel);

ConfigIntADC1(ADC_INT_DISABLE);

}

/***********************************************/
// Subroutine to show Time on LCD

void Show_ADC(void)
{
unsigned char dummy ;
unsigned int ADC1Value;

AD1CON1bits.SAMP = 1;

for ( dummy = 0 ; dummy < 100 ; dummy ++ );

ConvertADC1();
while (BusyADC1());
ADC1Value = (ADC1BUF0 >> 2);

setcurLCD(12,1) ;

put_Num_LCD( ADC1Value ) ;

}

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

教育訓練中心

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