This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Timer in 89c4051

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.

Parents
  • right over the place you enter your post it says: NOTE: When posting messages, use the following HTML tags to make your
    message easier to read and understand. For more information, refer to
    Tips for Posting Messages.
    ¦Use )b> and )/b> for BOLD text.
    ¦Use )i> and )/i> for ITALICS text.
    ¦Place source code source code between

     and
    

    .
    ¦Your e-mail address is not published in the forum.

    NOTE I changed the '<' to make the tags show

    Erik

Reply
  • right over the place you enter your post it says: NOTE: When posting messages, use the following HTML tags to make your
    message easier to read and understand. For more information, refer to
    Tips for Posting Messages.
    ¦Use )b> and )/b> for BOLD text.
    ¦Use )i> and )/i> for ITALICS text.
    ¦Place source code source code between

     and
    

    .
    ¦Your e-mail address is not published in the forum.

    NOTE I changed the '<' to make the tags show

    Erik

Children