Skip to main content
Visitor II
May 7, 2003
Question

Timer

  • May 7, 2003
  • 2 replies
  • 622 views
Posted on May 07, 2003 at 20:29

Timer

    This topic has been closed for replies.

    2 replies

    kobihaunAuthor
    Visitor II
    May 17, 2011
    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
    Visitor II
    May 17, 2011
    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.