Tool Tip: microcontroller timer calculator


In life and embedded systems timing is everything. Give [Frank's] web-based timer calculator a try. Set your system clock resolution (in hertz making sure you account for any system clock divider), select your timer resolution and prescaler, then calculate based on desired ticks, overflows, or real time. He’s built this with the AVR chips in mind but it should be handy for any family of microcontrollers.

Of course none of this is rocket science, but if you’re trying to use one timer for two differently synchronized events this can save you a lot of trial and error time.


  1. thethirdmoose says:

    This is one of those simple things that’s incredibly useful. Calculating timer constants by hand is a real pain – half the time you end up dividing something where you should have multiplied, or you forget to take into account the overflow, or something else. Stuff like this is really helpful.

  2. jimmys says:

    Oh yeah, Mike. Nice catch. Thanks for the post.

  3. reboots says:

    Also useful, linked from Frank’s site, the Engbedded Atmel AVR® Fuse Calculator:

  4. John says:

    Yeah very usefull indeed.
    Altough, I would be a bit nervous about precision. I’m used to PIC microcontroller and I have a spreadsheet that I update each time I use a new family. Every single time there is a new pre or post scaler with or without PLL etc…
    But once you verified that it actually works with the device you use, it is indeed a very useful tool.

    Nice !

  5. Frank says:

    Hey thanks for the mention! This started as a Visual C# thing but I figured a web interface would be more cross-platform.

  6. Bloom Berg says:

    Dear Sir,

    I click the buttons but nothing happen.

    Kindly fix routines.

  7. Hackius says:

    Bah! Embedded C solves all this with good functions and a smart compiler.

  8. Roman D says:

    Great tool.

    @Hackius – Having a smart compiler is no excuse for being lazy.

  9. Frank Zhao says:

    everything seems to work fine for me

    i’m not actually familiar with javascript, so if any body see that i did anything wrong let me know.

    i’m using firefox 3.5 with javascript enabled

  10. Ryan says:

    @Bloom Berg

    …you’re not just clicking the JPG above and hoping it works are you?

  11. gianni says:

    I’ve written a similar software some months ago, for the Microchip’s Picmicro. It generate also the code (in Ansi C):

    I’m Italian but the software is also translated in English

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 96,459 other followers