Skip to main content
Visitor II
March 27, 2008
Question

A small clarification about timer period calculation

  • March 27, 2008
  • 2 replies
  • 705 views
Posted on March 27, 2008 at 06:49

A small clarification about timer period calculation

    This topic has been closed for replies.

    2 replies

    michaelAuthor
    Visitor II
    March 27, 2008
    Posted on March 27, 2008 at 06:44

    Hello all,

    I am calculating my timer period like this:

    period = (65535 * prescaler) / PCLK2.

    So, given the following input:

    prescaler = 4

    PCLK2 = 12 MHz

    I get that period = 0.021845 [s], or 21.845 [ms].

    but the official sheet STR71x_Calculation.xls generates 27.306[ms].

    Where am I wrong?

    michaelAuthor
    Visitor II
    March 27, 2008
    Posted on March 27, 2008 at 06:49

    got it. The excel sheet, just like the datasheet, takes the input value and increments it by 1. so 12*10^6 Hz with a prescaler 4 should be utilized like this:

    period = 65535*5\12*10^6 = 27.305[ms]