#include "reg52.h"
#define uchar unsigned char
#define uint unsigned int
void delay();
void timer1_uint();
void main()
{
timer1_uint();
while(1);
}
void timer1_uint()
{
TMOD=0x60;
TH1=256-12;
TL1=256-12;
EA=1;
ET1=1;
TR1=1;
}
void delay()
{
uchar i,j;
for(i=0;i<500;i++)
for(j=0;j<500;j++);
}
void int2() interrupt 3
{
P0=0x00;
delay();
P0=0xff;
delay();
} |