??? 06/27/05 06:31 Read: times |
#95983 - 65536, not 65535 Responding to: ???'s previous message |
hi,
Adam Klaum said:
So for a 1.4 ms time I need to start the timer at:
65535 - 1290 = 64245 = FAF5 hex And for the 16.781818182 ms time I need to start the timer at: 65535 - 15467 = 50068 = C394 hex Adam, 16-bit timer overflows when it counts up from 65535 to 65536 (to zero due its 16 bit wide). By other words when you need to count for one timer clock then you should reload timer with value 65535 (65536-1). So replace 65535 with 65536 in your calculations. Regards, Oleg |