第2个回答 2016-06-18
#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
sbit kai=P1^0;
int num;
void Timer0Init(void) //2ms@11.0592MHz
{
TMOD &= 0xF0; //???????
TMOD |= 0x01; //???????
TL1 = 0xcd;
TH1 = 0xf8;
TF0 = 0; //??TF0??
TR0 = 1;
}
void main()
{
Timer0Init();
EA=1;
ET0=1;
kai=0;
while(1)
{
}
}
void t0_() interrupt 1
{
TL1 = 0xcd;
TH1 = 0xf8;
}