Jump to content

MIOS_TIMER_Init prescaler question


This N°9

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...