cancel
Showing results for 
Search instead for 
Did you mean: 

A small clarification about timer period calculation

michael
Associate II
Posted on March 27, 2008 at 06:49

A small clarification about timer period calculation

2 REPLIES 2
michael
Associate II
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?

michael
Associate II
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]