摘要 |
A method of determining the condition of a battery which backs up a real-time clock (RTC) when a main power supply fails or is disconnected, in a system which includes a controller having a volatile random access memory (VRAM) and a non-volatile random access memory (NVRAM). The method includes the steps of periodically storing the time value of the RTC in NVRAM, and periodically writing a predetermined data pattern in VRAM, while the main power supply adequately powers the real time clock. The method then includes the steps of detecting a power-down condition of the main power supply, and terminating the recording and writing steps when the detecting step detects power-down. Return of main power, or power-up, is then detected, with the data pattern stored in VRAM then being compared with the predetermined data pattern. When the patterns are not the same, indicating more than a transitory loss of main power, the difference between the time value indicated by the RTC upon power-up and the last time value of the RTC stored in NVRAM before power down is compared with a predetermined constant time value. When the RTC has not incremented by at least the predetermined constant time value the method includes the step of indicating that the back-up battery is bad.
|