Author Topic: How accurate are AVR watchdog timers?  (Read 1725 times)

0 Members and 1 Guest are viewing this topic.

Online HwAoRrDkTopic starter

  • Super Contributor
  • ***
  • Posts: 1477
  • Country: gb
How accurate are AVR watchdog timers?
« on: June 24, 2017, 06:03:00 pm »
I was wondering what the accuracy is like of the watchdog timer on 8-bit AVRs. For example, would it be suitable for timing applications that require some reasonable level of accuracy, but not anything super-precise?

To give an example of how I'm considering applying it:

I have external square wave signal that I want to measure the frequency of. I'll feed that to a pin that will externally clock a timer. Then with another timer that fires at 1 second intervals, in its interrupt handler I check (and reset) the first timer's counter value to get the frequency reading.

Because of otherwise a very low I/O count requirement I'm looking to use the ATtiny series, and nearly all of them have a paucity of timers (only 1 or 2), and that with the above arrangement I would need three total (I need to do PWM output too), I was wondering whether I could instead use the watchdog timer for my 1 second interval.

However, I'm not sure I'd get a very accurate frequency measurement with the watchdog timer when the datasheets say of the WD oscillator things like "provides a clock source with an approximate frequency of XXX kHz" and "the frequency depends on supply voltage, temperature and batch variations". In one datasheet, buried in the electrical characteristics section, there is even a specified accuracy of only ±30% over the part's given temperature and VCC range! :scared:

Is the accuracy better given a stable operating voltage and temperature? Or should I forget the idea and find an ATtiny that has 3 timers? (ATtiny841 looks like it might fit my needs.)
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: How accurate are AVR watchdog timers?
« Reply #1 on: June 24, 2017, 06:23:23 pm »
I'd go for an ATtiny with three timers. The watchdog timer is only useful for non-time-critcal stuff.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf