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
  • while(TF0==0)
    TR0 = 0; stopping the timer
    TF0 = 0; Reset the flag,
    When the lines of the code is as stated above its obvious that while loop is being executed till TF0 remains 0 and once its set to 1 the next steps are executed. The next two liines stops the counter and I dont understand what great coding techniques is involved to detect the missing number 0 in the while loop.I have not invited comments on my copy paste abilities , but wamt solns from the experts in this forum.

Reply
  • while(TF0==0)
    TR0 = 0; stopping the timer
    TF0 = 0; Reset the flag,
    When the lines of the code is as stated above its obvious that while loop is being executed till TF0 remains 0 and once its set to 1 the next steps are executed. The next two liines stops the counter and I dont understand what great coding techniques is involved to detect the missing number 0 in the while loop.I have not invited comments on my copy paste abilities , but wamt solns from the experts in this forum.

Children