#include <REG52.H>
sfr CCON=0xD8;
sfr CMOD=0xD9;
sfr CL=0xE9;
sfr CH=0xF9;
sfr CCAP0L=0xEA;
sfr CCAP0H=0xFA;
sfr CCAP1L=0xEB;
sfr CCAP1H=0xFB;
sfr CCAPM0=0xDA;
sfr CCAPM1=0xDB;
sfr PCAPWM0=0xf2;
sfr PCAPWM1=0xf3;
sbit CR=0xDE;
void main()
{
CMOD=0x00;
CL=0x00;
CH=0x00;
CCAP0L=0x80;
CCAP0H=0x80;
CCAP1L=0x80;
CCAP1H=0x80;
CCAPM0=0x42;
CCAPM1=0x42;
CR=1;
while(1);
}
这是数据手册的例程,频率都是几K的