Testing the accuracy of the attiny45 watchdog timer

A project log for W-Ring

An RGB led Clock-Ring

EnriqueEnrique 08/22/2018 at 18:140 Comments

One important spec of a watch is the accuracy, a delay of couple of seconds each day is acceptable, but the watchdog timer of most of the microcontrollers is not usually accurate.

For testing it I wrote a small blink code of 500ms with the tinySnore library, a library which allows to sleep the uC with only one line and provides 6.4 micro amps, which is not bad at all.

Because I wanted to be precise, and the arduino digitalWrite function add a little delay, I had to directly toggle the PB register. Then I burned into the attiny45 and connected an arduino as a flank detector, connected to the pc through the serial. I counted each tick, which is supposed to last 1 sec, and at the same time I started an online precision timer for two days. 

I started it two days ago at 16:00:59, which is a total of 186606 seconds, and I got as you can see 172966, a 7.31% of error, 105 mins of error each day, an enormous error. I could see how that error in certain way was constant, so could be possible to correct it, but is better to look for an alternative, my first idea was get a TPL5110, a nanopower timer