[求助]16F877A的PWM怎么输出全高电平(占空比100%)
#include <pic.h>__CONFIG(XT&WDTEN);
#define uchar unsigned char
#define uintunsigned int
unsigned char pwm1;
void PWM1(uchar maikuan)
{
CCPR1L=maikuan;
CCP1CON=0x3c;
PR2=63; T2CKPS1=0;
T2CKPS0=0; //前分频为1:1
TRISC2=0; //将RC1设置为输入,暂时关闭PWM
TMR2ON=1; //启动TIMER2
}
void main()
{
TRISC3=0;
TRISC4=0;
RC3=0;
PWM1(0XFF);
while(1);
}
最大占空比只能到80%多 请哪位高手指点一下 谢谢
页:
[1]