 #include<8051.h>
 void main()
 {
      TH0 = 0x0fe;      //to get a delay of 500µ seconds set T0 as FE5F
      TL0 = 0x5f;
      TMOD = 0x01;
      TR0 = 1;
      for (;;)
      {
          P1_0 = P1_0 ^ 1;
          if(TF0==1)
          {
            TR0 =0;
            break;
          }
      }
}



