Author Topic: Timer vs Real Time counter  (Read 1667 times)

0 Members and 1 Guest are viewing this topic.

Offline silo_xtremeTopic starter

  • Robot Overlord
  • ****
  • Posts: 172
  • Helpful? 0
  • I really love robots, they keep me awake at night.
Timer vs Real Time counter
« on: December 14, 2009, 09:24:33 PM »
Hey All,

I'm just wondering if anyone uses the RTC on an AVR chip?  I'm wondering if the RTC is really "that much more accurate" than a typically 16 bit timer. 

Any thoughts?

Mike

Offline hopslink

  • Robot Overlord
  • ****
  • Posts: 202
  • Helpful? 14
Re: Timer vs Real Time counter
« Reply #1 on: December 15, 2009, 07:32:20 AM »
The quick answer is that the RTC will be no more accurate than a 16 bit timer(assuming both are run from a clock source with identical accuracy). The main reason for using the RTC inputs would be for simple (and accurate) seconds-based timing. 

In terms of accuracy, much of the time the internal oscillator is accurate enough and offers the bonus of extra IO pins and circuit simplicity. If you need very accurate timing from a microcontroller system you would run it from an external Xtal (crystal) oscillator not the internal RC (Resistor Capacitor) oscillator. Xtal oscillators typically have much tighter frequency tolerances and suffer less frequency drift with temperature.   

You would use the RTC inputs and an external watch Xtal (typically oscillating at 32768Hz) if you wanted to have time (seconds, minutes, hours...) functionality in your system. The benefit comes from the integer power of 2 division of the clock frequency to the exact time base you want. Alternatively if you do not need high processing throughput you could use a watch Xtal for the main system clock to get the same effect.

Similar examples where you might use a specific frequency for the system clock include serial comms and video applications (just two common ones off the top of my head, there are probably loads more).

Offline silo_xtremeTopic starter

  • Robot Overlord
  • ****
  • Posts: 172
  • Helpful? 0
  • I really love robots, they keep me awake at night.
Re: Timer vs Real Time counter
« Reply #2 on: December 15, 2009, 07:48:17 AM »
Thanks Hopslink! :)

 


Get Your Ad Here

data_list