PDA

View Full Version : Timer Prescales - maximum time before overflow



jamie_s
- 27th August 2005, 15:13
Just a quick question, can someone tell me what the maximum time timer1 will count before an overflow occurs, at 4mhz and the following prescales (in uS or mS)

1:1
1:2
1:4
1:8

I need to have a timer that will work upto 256ms - is this possible?

Thanks

Melanie
- 27th August 2005, 15:43
Timer1 is a 16-bit Timer... it will tick once every 1uS at 4MHz.

Given that, it will count to 65535 before generating a Flag/Interrupt as it rolls back to zero. So, in it's native 1:1 prescaler state it will do this every 65.336mS @ 4MHz.

Prescaling 2:1 will double that... 4:1 will quadruple it etc. You can do the math.

jamie_s
- 27th August 2005, 16:52
Thanks melanie, thats what i needed :)

Now i just need to figure out how to do my time divisions exponentially