Datasheet
2012-2018 Microchip Technology Inc. DS20002300C-page 32
MCP7951X/MCP7952X
5.7 Battery Backup
The MCP795XX features a backup power supply input
(V
BAT) that can be used to provide power to the time-
keeping circuitry, RTCC registers, and SRAM while pri-
mary power is unavailable. The MCP795XX will
automatically switch to backup power when V
CC falls
below V
TRIP, and back to VCC when it is above VTRIP.
The VBATEN bit must be set to enable the V
BAT input.
The following functionality is maintained while
operating on backup power:
• Timekeeping
•Alarms
• Alarm Outputs
• Digital Trimming
• RTCC Register and SRAM Contents
The following features are not available while operating
on backup power:
• SPI Communication
• Watchdog Timer
• Event Detect
• Square Wave Clock Output
5.7.1 POWER-FAIL TIMESTAMP
The MCP795XX includes a power-fail timestamp
module that stores the minutes, hours, date, and month
when primary power is lost and when it is restored
(Figure 5-9). The PWRFAIL bit is also set to indicate
that a power failure occurred.
To utilize the power-fail timestamp feature, a backup
power supply must be available with the V
BAT input
enabled, and the oscillator should also be running to
ensure accurate functionality.
5.7.1.1 Configuring Battery Backup
In order to configure the battery backup feature, the
following steps need to be performed:
1. Enable the oscillator.
2. Wait for the OSCRUN bit to be set, indicating the
oscillator has started.
3. Enable battery backup by setting the VBATEN
bit.
FIGURE 5-9: POWER-FAIL TIMESTAMP TIMING
Note: If VCC is lost while VBAT voltage is applied,
but where VBATEN is not set to ‘1’, it
could result in undetermined behavior. If a
backup supply is not used, the V
BAT pin
should be connected to V
SS.
Note: Throughout this section, references to the
register and bit names for the Power-Fail
Timestamp module are referred to
generically by the use of ‘x’ in place of the
specific module name. Thus,
“PWRxxMIN” might refer to the minutes
register for power-down or power-up.
Note 1: The PWRFAIL bit must be cleared to log
new timestamp data. This is to ensure
previous timestamp data is not lost.
2: Clearing the PWRFAIL bit will clear all
timestamp registers.
Power-Down
Power-Up
Timestamp
Timestamp
VCC
VTRIP