#include
#define uchar unsigned char
#define uint unsigned int
void timer_init()
{
TMOD=0X01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
EA=1;
IT0=1;
TR0=1;
}
void main()
{
timer_init();
P1=0Xaa;
while(1)
{
if(t==20)
{
t=0;
P1=~P1;
}
}
}
void exter0() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
t++;
}