hi, I am trying to use TIMER0 for delay in 89C4051 and this delay is working on Keil at debug time. But when I am trying same code on hardware it is not working. plz suggest me. code is given below
void T0delay(unsigned char t) // if t=1 then delay=1 sec { for(i=0;i<t;i++) { for(j=0;j<20;j++) { TMOD=0X01; TL0=0XB0; TH0=0X3C; TR0=1; while(TF0==0); TR0=0; TF0=0; } } }
Thank You in advance.