Re: dsPIC33FJ128MC708 函數問題
|
||||
---|---|---|---|---|
初級會員
|
謝謝版主的回覆…感謝!!!
發表於: 2007/9/13 17:51
|
|||
|
dsPIC33FJ128MC708 函數問題
|
||||
---|---|---|---|---|
初級會員
|
請問各位前輩…我是使用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
|
|||
|