void Timer0_Init(void)
{
AUXR0 |= T0XL;
AUXR2 &= ~T0X12; //选定时器时钟源为SYSCLK
// AUXR2 |= 0X01; //使能T0从P3.4输出
AUXR2 &= 0xFE; //禁止T0从P3.4输出
TMOD&=0XF0;
TMOD|=0X01; //定时器0工作于方试1,即16位定时器
TH0=0xec;
TL0=0x78;
ET0=1; //定时器0开启中断
EA=1;
TR0=1;
}
void timer0_isr(void) interrupt 1
{
xs(1,6);
delay(100);
P37=0;
delay(100);
P37=1;
}
void main
{
void Timer0_Init();
while(1)
{
}
} |