??? 09/05/05 13:06 Read: times |
#100614 - The timer counts UP Responding to: ???'s previous message |
In the 8051, the timer counts up and when it overflows it clocks the uart or fires the interrupt. so, you have timer = 0-time. 0 being the value when it overflows. say you want the timer to interrupt every 16 clocks. the timer gets loaded with 0-16 = 240 (assuming a 8 bit timer). So the timer counts 240,241,242....255,0 (interrupt!). This is explained in the bible. So do a bit of reading on the timers and all shall be revealed. |