Skip to main content
This topic has been closed for replies.

2 replies

kobihaun
kobihaunAuthor
Associate II
May 17, 2011 9:53 AM UTC
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
May 17, 2011 9:53 AM UTC
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.