void main(void)
{
PADDR = 0xc7;
PAOR = 0xe7;
PBDDR = 0x03; //00000011
PBOR = 0x07; //00000111
PADR = 0x38; //00111000
PBDR = 0x04; //00000100
ATCSR=0x12; //开12位重装定时器 开溢出中断
PWMOCR=0x01; //pwm使能
PWM0CSR=0x00; //1位pwm输出倒相
ARTH=0x0e;
ARTL=0x0c;
X=(char*)0xffde;
RCCR=*X; //RC频率修正值,也可用80H
while(1)
{DCR0H=0x0e;
DCR0L=0xfc;}
}
pwm有输出,但间断有一个100%脉宽,请教高手,什么原因如何解决? |