Jump to content

Recommended Posts

Posted

hi all,

based on which criterias should I choose a timer prescaler? is there some performance

advantage/disadvantage?

in the documetation, this example is shown:

// we want to setup the timer with a frequency of 500 Hz = 2 mS

  // prescaler 1:1 should be used

  // calculate the required number of clocks for this period:

  // clocks = period / 100 nS = 2 mS / 100 nS = 20000

  // therefore:

  MIOS_TIMER_Init(0x00, 20000);

  // now the Timer() function is called every 2 mS!

why not take a prescaler of 1:2 and set the period to 10000?

this

Posted

I'm using 1:1 prescaler in this example, so that the period time is easier to calculate.

1 mS == 10000

Maximum value for 1:1 prescaler is 65535 = 6.5535 mS

got the point?

At application level, there are no real advantages/disadvantages when using higher prescaler values. Just select a prescaler which fits your needs

Best Regards, Thorsten.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...