• 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: 學dsPIC的盲點問題
#6
版主
版主


查看用戶資訊
C:\Program Files\Microchip\MPLAB C30\docs\16-bit Peripheral Libraries.htm

我在這個目錄下就有這個 htm 的說明。我是使用 C30 v3.01 的版本。太舊的版本要更新。

發表於: 2008/1/3 14:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 學dsPIC的盲點問題
#5
初級會員
初級會員


查看用戶資訊
我沒有找到 C30 Library 和 16-bit Peripheral Libraries.htm
是我沒灌完全嗎??用搜尋方式查整個c槽都沒有@@~

發表於: 2008/1/3 13:46
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 學dsPIC的盲點問題
#4
版主
版主


查看用戶資訊
當安裝 C30 時,使用手冊也會跟著安裝進去。可以到底下的目錄: C:\Program Files\Microchip\MPLAB C30\docs\ 看看。
裡面有 C30 Compiler 及 C30 Library 的使用手冊,另外很重要的是 : Peripheral Libraries User' Guide 已經用HTM的方式呈現,只要將 "16-bit Peripheral Libraries.htm" 的檔案開啟就可以選擇那一個元件的周邊並知道其撰寫的方式。

*.gld 檔案 : Linker 要用到的元件記憶體的配置及周邊絕對位址的說明檔,必須在建立 Project 時加入該元件的 GLD 檔。

*.a 檔案 : 壓縮過後的 16-bit 系列的 Library。如果有使用 Library 裡的函數時一定要加入在 Project 裡。

*.h 檔案 : 元件或函數的定義檔,在程式裡用 #include 的方式帶進來。

發表於: 2007/12/27 10:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 學dsPIC的盲點問題
#3
初級會員
初級會員


查看用戶資訊
本人也有相近的困擾
最近在學習dsPIC,要使用週邊時,要Config 或Open或Read,C30也已經提供一些library的函數來方便使用了,但是如果要自己使用時,會不曉得要去找p30fxxx.h來自行研讀,還是.gld,還是.a,還是週邊的.h。
.h、.a、.gld都有一長串似懂不懂的定義,對新手來說,真是不小挑戰。

發表於: 2007/12/27 9:56
數位地球人
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 學dsPIC的盲點問題
#2
資深會員
資深會員


查看用戶資訊
參照:

類似這樣的暫存器設定,這些都是作者已經自行設定好的狀態,我都不知道要再去哪裡改變它暫存器的設定,而且書上有說C30以經有寫好的各種功能的函式庫可用,如 OpenMCPWM
這個函式,但還是必須再寫一堆設定後才能去使用它,感覺它既然有寫好的函式庫為何不能在主程式裡面直接使用,還必須寫副程式來宣告定義。


1.暫存器設定要從兩方面看,一是Datasheet提供哪些功能能用:二是標頭檔對於個暫存器宣告的定義。

2.如果從各dsPIC的Datasheet來看,每個周邊要能工作,要設定的暫存器很多以提供不同的操作方式。基本上只要查C30 Library就能搞定,還不用去設定對應的暫存器的各Bit狀態。已經很方便了。


發表於: 2007/12/27 8:13
不要問我哪裡來,我只是個流浪天涯的工程師
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


學dsPIC的盲點問題
#1
初級會員
初級會員


查看用戶資訊
請問版主和各位先進你們所講的C30能夠支援的C語言函數,這些是要去哪裡找會有完整的各個函式的說明,因為我都只看曾百由這一本在加一本C語言的書,可是還是會霧殺殺,我舉例像

config = (PWM_INT_DIS & PWM_FLTA_DIS_INT &
PWM_INT_PR1 & PWM_FLTA_INT_PR0);

類似這樣的暫存器設定,這些都是作者已經自行設定好的狀態,我都不知道要再去哪裡改變它暫存器的設定,而且書上有說C30以經有寫好的各種功能的函式庫可用,如 OpenMCPWM
這個函式,但還是必須再寫一堆設定後才能去使用它,感覺它既然有寫好的函式庫為何不能在主程式裡面直接使用,還必須寫副程式來宣告定義。

附上15-1的PWM程式
int main(void)
{

Init_MCPWM( );

while(1);
}

void Init_MCPWM(void)
{

unsigned int config;

unsigned int period;

unsigned int sptime;

unsigned int config1;

unsigned int config2;

unsigned int config3;

unsigned int dutycyclereg;
unsigned int dutycycle;
unsigned char updatedisable;

config = (PWM_INT_DIS & PWM_FLTA_DIS_INT & PWM_INT_PR1
& PWM_FLTA_INT_PR0);
ConfigIntMCPWM( config );

dutycyclereg = 1;
dutycycle = 0x7FFF;
updatedisable = 0;
SetDCMCPWM(dutycyclereg,dutycycle,updatedisable);
period = 0x7FFF;
sptime = 0x0;
config1 = (PWM_EN & PWM_IDLE_STOP & PWM_OP_SCALE16
& PWM_IPCLK_SCALE64 &
PWM_MOD_UPDN);
config2 = (PWM_MOD1_COMP &
PWM_PDIS3H & PWM_PDIS2H & PWM_PEN1H &
PWM_PDIS3L & PWM_PDIS2L & PWM_PEN1L);
config3 = (PWM_SEVOPS1 & PWM_OSYNC_PWM & PWM_UEN);
OpenMCPWM(period,sptime,config1,config2,config3);

發表於: 2007/12/27 4: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... ]

教育訓練中心

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