原创 PwmAppnote

2008-10-28 18:39 2135 8 8 分类: MCU/ 嵌入式

1.       In the Main file “other head”, you need to include the two file


#include "./libraries/hal/halPwm.h"
#include "./libraries/hal/halPwm.c"<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


2.       In the Main file “initial block”, you need to add below code


initPwm();


3.       In the halPwm.h, you need to modify initial setting base your request


#define initPwm() \
   T2ModeVal_(T2POST1, T2PRE1); \
   ECCPMode_(P1M_Single, ECCP_PwmAllActiveHigh);


4.       That is all, you can any time, write below code change the PWM pulsing width.


CCPR1L=0x80;


 



20081028PwmLibraries.ziphttps://static.assets-stash.eet-china.com/album/old-resources/2008/10/28/f9ddf85a-6300-4574-bcd9-c56e9f5cc0b8.zip


·         halPwm.c


·         halPwm.h


 
PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
8
关闭 站长推荐上一条 /3 下一条