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
文章评论(0条评论)
登录后参与讨论