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


Browsing this Thread:   1 Anonymous Users






Re: 請問有關PIC24F16KA102目前遇到的難題
#8
版主
版主


查看用戶資訊
我沒試過PIC24F16KA102 的函數庫,看起來是有些暫存器上定義的差異。可以找出 I2C1 的原始程式加以修改後加到 Project 裡來使用。 如果Project 有相同的的函數名稱,C30 會忽略 Library 裡的函數而改用 Project裡的函數。

發表於: 2010/2/5 16:43
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問有關PIC24F16KA102目前遇到的難題
#7
新會員
新會員


查看用戶資訊
那用了此兩個lib之後, 在link時有warning message說是以24KJ256GB110來建立的, 請問可以用在16KA101/102上嗎?

Warning: object OpenI2C1.o from library C:\Program Files\Microchip\MPLAB C30\lib\PIC24F\libpPIC24Fxxx-coff.a was created for the 24FJ256GB110 and references register _I2C1BRG

發表於: 2010/2/3 17:00
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問有關PIC24F16KA102目前遇到的難題
#6
版主
版主


查看用戶資訊
那是因為你的程式還沒用到Microchip 所提供的Peripheral Libraries 的關係。如果你有用類似的OpenADC( ) or OpenTimer1( ) 時看看會不會錯。

C:\Program Files\Microchip\MPLAB C30\docs\periph_lib\Microchip PIC24F Peripheral Library HTML 檔案

發表於: 2009/8/31 10:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問有關PIC24F16KA102目前遇到的難題
#5
資深會員
資深會員


查看用戶資訊
參照:

Ryang 寫道:
(a)Header Files要加入p24F16KA102.h嗎??
ANS: PIC24 的 H 檔是放在 C:\Program Files\Microchip\MPLAB C30\support\PIC24F\h 的目錄下,使用時可以直接用:
#include <p24Fxxxx.h> 的檔案,這裡面都是用#if defined 的條件式編譯來判斷該使用哪ㄧ個元件的H 檔。MPLAB IDE 下我們會選擇一顆所使用的元件,該元件在Compiler 時會由 MPLAB IDE 傳給 C Compiler,這樣就可以使用 p24Fxxxx.h 來取代所有的H檔,如此也避免使用到錯誤的檔案。

(b) Libray Files要加入libpPIC24FXXX-coff.a
和libpPIC24FXXX-elf.a嗎??
ANS: 用 coff 的格式,基本上這是MPLAB IDE要做 Source Level Debug 時所要使用到的參考檔案。

(c)Linker Script要加入p24F16KA102.gld
ANS: 自 MPLAB IDE v8.22 以後可以不加入LKR or GLD 等連結描述檔,MPLAB IDE 會依據所選定的元件自動加入,如果有手動加入的話,MPLAB IDE 會以手動為主。


請問 libpPIC24FXXX-coff.a 和 libpPIC24FXXX-elf.a 不加的話
會有什麼影響嗎?
有試過不加入..也可以編譯成功\

發表於: 2009/8/28 23:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問有關PIC24F16KA102目前遇到的難題
#4
版主
版主


查看用戶資訊
參照:
FCY 4MHZ
有用MMPLAB SIM看時間2秒是正確的..只是不知道為什麼HIGH LOW沒依照時間

ANS: 在使用MPLAB SIM 時要先設定 OSC Frequency。
Debugger --> Setting 下,選 osc/trace 輸入所執行的頻率即可。MPLAB SIM 所算出的結果是很準的,而且目前還沒聽說有問題的。

發表於: 2009/8/25 13:54
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問有關PIC24F16KA102目前遇到的難題
#3
版主
版主


查看用戶資訊
(a)Header Files要加入p24F16KA102.h嗎??
ANS: PIC24 的 H 檔是放在 C:\Program Files\Microchip\MPLAB C30\support\PIC24F\h 的目錄下,使用時可以直接用:
#include <p24Fxxxx.h> 的檔案,這裡面都是用#if defined 的條件式編譯來判斷該使用哪ㄧ個元件的H 檔。MPLAB IDE 下我們會選擇一顆所使用的元件,該元件在Compiler 時會由 MPLAB IDE 傳給 C Compiler,這樣就可以使用 p24Fxxxx.h 來取代所有的H檔,如此也避免使用到錯誤的檔案。

(b) Libray Files要加入libpPIC24FXXX-coff.a
和libpPIC24FXXX-elf.a嗎??
ANS: 用 coff 的格式,基本上這是MPLAB IDE要做 Source Level Debug 時所要使用到的參考檔案。

(c)Linker Script要加入p24F16KA102.gld
ANS: 自 MPLAB IDE v8.22 以後可以不加入LKR or GLD 等連結描述檔,MPLAB IDE 會依據所選定的元件自動加入,如果有手動加入的話,MPLAB IDE 會以手動為主。

發表於: 2009/8/25 13:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問有關PIC24F16KA102目前遇到的難題
#2
初級會員
初級會員


查看用戶資訊
這樣寫就OK了!

#include <p24F16KA102.h>
#define test1 PORTBbits.RB2
#define DIR_test1 TRISBbits.TRISB2
int b,bb;

int main()
{
DIR_test1=0;
while(1)
{
b++;
if(b==3500)
{
b=0;
bb++;
}
if(bb==90)
{
bb=0;
test1=!test1;
}
}
}

發表於: 2009/8/24 23:54
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問有關PIC24F16KA102目前遇到的難題
#1
資深會員
資深會員


查看用戶資訊
請問有關PIC24F16KA102目前遇到的難題

1.MPLAB IDE裡面
(a)Header Files要加入p24F16KA102.h嗎??
(b) Libray Files要加入libpPIC24FXXX-coff.a
和libpPIC24FXXX-elf.a嗎??
(c)Linker Script要加入p24F16KA102.gld

2.用迴圈寫LOW2秒=>HIGH2秒=>LOW2秒=>HIGH2秒
執行結果是HIGH沒2秒就變LOW LOW沒2秒就變HIGH..

FCY 4MHZ
有用MMPLAB SIM看時間2秒是正確的..只是不知道為什麼HIGH LOW沒依照時間

#define test1 PORTBbits.RB2
#define DIR_test1 TRISBbits.TRISB2
int b,bb;

void main()
{
DIR_test1=OUTPUT;
while(1)
{
b++;
if(b==3500)
{
b=0;
bb++;
}
if(bb==90)
{
bb=0;
test1=!test1;
}
}

有勞各位先進不吝指教

發表於: 2009/8/21 21:23
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... ]

教育訓練中心

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