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 autoload mode

I use Keil sometimes and while using a timer in autoload mode, the TH0 is loaded with the calculated value but TL0 starts incrementing from 00 instead of the calculated value F0.Am I missing something while using or configuring the keil simulator?

Parents
  • I have not invited comments on my copy paste abilities , but wamt solns from the experts in this forum.
    you can hardly expect 'solons' when posting incorrect 'code'

    void delay()
    {
    TMOD = 0x02;
    TH0 = 0xF0;
    TL0 = 0xF0;
    TRO = 1
    while(TF0==0) // corrected by information from last post
    TR0 = 0;
    TF0 = 0;
    }
    

    why do you use reload mode?

    Erik

Reply
  • I have not invited comments on my copy paste abilities , but wamt solns from the experts in this forum.
    you can hardly expect 'solons' when posting incorrect 'code'

    void delay()
    {
    TMOD = 0x02;
    TH0 = 0xF0;
    TL0 = 0xF0;
    TRO = 1
    while(TF0==0) // corrected by information from last post
    TR0 = 0;
    TF0 = 0;
    }
    

    why do you use reload mode?

    Erik

Children