• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






關於c30的疑問
#1
資深會員
資深會員


查看用戶資訊
想請問一下我編譯時都出現
C:\PIC_VFD\VFD_NEW_3.c:59: undefined reference to `OpenSPI1'

這到底是那有問題啊?我找了3天了
還是想不出來耶!我明明有#include "spi.h"
為什麼會找不到阿?

發表於: 2007/7/23 22:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於c30的疑問
#2
資深會員
資深會員


查看用戶資訊
會不會是#INCLUDE的預設路徑錯誤了,所以才會產生沒定義.
可以試看看如果SPI.H的其它定義都正常,就不是路徑錯誤.

發表於: 2007/7/24 15:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於c30的疑問
#3
資深會員
資深會員


查看用戶資訊
我有找到解決辦法就在在Projec旁的Library加入
libpPIC24Fxxx-coff.a才沒有錯誤!

但是我的SPI輸出卻沒有出來,讓我又很頭大
因為我有用到Peripheral Pin Select的設定

因為我現在搞不懂是我的SPI設定錯誤,還是我的
Peripheral Pin Select的設定錯誤!

下面是我的程式,可否跟我說一下我哪用錯了
我搞了好久,SPI就是不出來><

#include <p24Fxxxx.h>
#include <spi.h>



void SPI_Inital(void);
int main (void)
{
SPI_Inital();
while(1)
{
WriteSPI1(0xff55);
while(SPI1STATbits.SPITBF);
}
}

void SPI_Inital(void)
{
unsigned int SPI1CON1_Value;
unsigned int SPI1STAT_Value;
unsigned int SPI1CON2_Value;

SPI1CON1_Value=
ENABLE_SCK_PIN | ENABLE_SDO_PIN | SPI_MODE8_ON | SPI_SMP_OFF | SPI_CKE_ON |SLAVE_ENABLE_OFF | CLK_POL_ACTIVE_LOW | MASTER_ENABLE_ON | SEC_PRESCAL_1_1 |PRI_PRESCAL_1_1;

SPI1STAT_Value=
SPI_ENABLE | SPI_IDLE_CON | SPI_RX_OVFLOW_CLR;

SPI1CON2_Value= 0X0000;

OpenSPI1(SPI1CON1_Value,SPI1CON2_Value,SPI1STAT_Value);

_TRISB0=0;
_TRISB1=1;

_IOLOCK=0;
RPOR0=0x0708;//RP0=>SDO1 RP1=>SCK1
}

發表於: 2007/7/24 22:58
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於c30的疑問
#4
資深會員
資深會員


查看用戶資訊
除了spicon1,mode8和WriteSPI1(0xff55);
資料型態不符合以外,看不出來有什麼不對,可能再檢查一下腳位設定吧.

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


Re: 關於c30的疑問
#5
資深會員
資深會員


查看用戶資訊
Data 看了又看 上網找了好久
終於可以用了,不過還是感謝您的回應

發表於: 2007/7/25 22:24
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... ]

教育訓練中心

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