Re: 學dsPIC的盲點問題
|
||||
---|---|---|---|---|
版主
|
C:\Program Files\Microchip\MPLAB C30\docs\16-bit Peripheral Libraries.htm
我在這個目錄下就有這個 htm 的說明。我是使用 C30 v3.01 的版本。太舊的版本要更新。
發表於: 2008/1/3 14:15
|
|||
|
Re: 學dsPIC的盲點問題
|
||||
---|---|---|---|---|
初級會員
|
我沒有找到 C30 Library 和 16-bit Peripheral Libraries.htm
是我沒灌完全嗎??用搜尋方式查整個c槽都沒有@@~
發表於: 2008/1/3 13:46
|
|||
|
Re: 學dsPIC的盲點問題
|
||||
---|---|---|---|---|
初級會員
|
本人也有相近的困擾
最近在學習dsPIC,要使用週邊時,要Config 或Open或Read,C30也已經提供一些library的函數來方便使用了,但是如果要自己使用時,會不曉得要去找p30fxxx.h來自行研讀,還是.gld,還是.a,還是週邊的.h。 .h、.a、.gld都有一長串似懂不懂的定義,對新手來說,真是不小挑戰。
發表於: 2007/12/27 9:56
|
|||
數位地球人
|
||||
|
Re: 學dsPIC的盲點問題
|
||||
---|---|---|---|---|
資深會員
|
參照:
1.暫存器設定要從兩方面看,一是Datasheet提供哪些功能能用:二是標頭檔對於個暫存器宣告的定義。 2.如果從各dsPIC的Datasheet來看,每個周邊要能工作,要設定的暫存器很多以提供不同的操作方式。基本上只要查C30 Library就能搞定,還不用去設定對應的暫存器的各Bit狀態。已經很方便了。
發表於: 2007/12/27 8:13
|
|||
不要問我哪裡來,我只是個流浪天涯的工程師
|
||||
|
學dsPIC的盲點問題
|
||||
---|---|---|---|---|
初級會員
|
請問版主和各位先進你們所講的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
|
|||
|