cancel
Showing results for 
Search instead for 
Did you mean: 

Timer

kobihaun
Associate II
Posted on May 07, 2003 at 20:29

Timer

2 REPLIES 2
kobihaun
Associate II
Posted on May 17, 2011 at 11:53

Hi Every body

How can I calculate the value for the buffers TH0 and TL0 in order to have interrupt every 1ms.

Thank you very much

Hayun
joseph2399
Associate II
Posted on May 17, 2011 at 11:53

Timer0_count = 0 - (osc/(12*timer0_period)) - 17

so if your osc freq = 36MHz, then Timer0_count = 0xf459,

if, osc freq = 40MHz, then Timer0_count = 0xf30c

Load the high byte of timer0_count to TH0, and the low byte to TL0.