#include &#reg51.h>
sbit Port3_Pin1 = P3^1;
void main(void) {
  Port3_Pin1 = 0; //Pin Configuration TMOD = 0x01;
  //Square wave generation
  while(1) {
    Port3_Pin1 = ~Port3_Pin1;
    //Delay for 0.5ms (with 1 MHz clock frequency)
    TH0 = 0xFF;
    TL0 = 0xD5;
    TF0 = 0;
    TR0 = 1;
    while (TF0 == 0);
    TR0 = 0;
  }
}