I have a program in an Atmega 162.
It takes the time from an RTC chip (DS1337) and displays it on 4 x 7 segment displays.
The display refresh subroutine is accessed via a pin change interrupt that is connected to a square wave output from the RTC chip at 4.096 kHz.
I am looking into the application of a watch dog timer to the program and was planning to put the WDR command in the display refresh subroutine as it is accessed from every part of the program in one form or another.
I set all 3 of the WDP (0,1,2) bits in the WDTCR to allow maximum time to reset (2.1 Seconds at the 5VDC i am using).
I am using a 4 mHz resonator and have unticked the divide by 8 internally fuse (AVR Studio 4).
The WDT works for most of my program but for some parts where the display is momentarialy not refreshed, the program resets. I do not think the delay is anywhere near 2 seconds. is there something else that can affect my WDT time or pre scaler value?
Also how can I check the scan time of a part of my program to see if it should be suitable for the WDR command? Is it a matter of counting the commands in a section?
Should i only be using WDR once in good practice?