1. Application Scope
This method of using the crystal oscillator to calibrate the WDT, and then use the WDT for timing applies to occasions that do not require high timing precision, for example, the 10-minute timing function found in some remote controls. And the method requires an oscillation frequency of no more than 4MHZ. With the single clock AM8EB family, its oscillation frequency may be too high to be used for timing due to current concern. To realize this function with AM8EB, this method can be adopted.
2. Method
1. Clear Timer0, clear WDT, and enable WDT.
2. For each Timer0 interrupt, add the count by 1, repeat this step.
3. For each WDT reset, calculate the lasting time of WDT interruption.
4. WDT reset times = Timing length/the time of each WDT reset
5. If the error is unacceptable, the start-up time of the IC at each WDT reset can be taken into consideration (here, the program does not deal with this).
For the program list, see “Calibrate WDT.asm”.
calibrateWDT.rar