Overview
The PCF8563 is a low-power CMOS real-time clock (RTC) and calendar IC manufactured by NXP Semiconductors. Paired with a quartz tuning-fork crystal and a 3V coin cell backup battery (CR1220 / CR2032), it maintains timekeeping even when main system power is completely disconnected.
Operating down to DC with a backup supply current of just , the PCF8563 provides full BCD-formatted time registers (seconds, minutes, hours, date, day-of-week, month, century, and year) over an interface (0x51). It features a programmable countdown timer, alarm interrupt output (INT), and a programmable square-wave clock output (CLKOUT).
Quick reference
Operating voltage (VDD) | 1.8 V to 5.5 V DC (1.0 V to 5.5 V timekeeping backup) |
| Interface | Fast-Mode (up to 400 kHz) |
| Fixed address | 0x51 |
| Crystal frequency | () |
| Backup power draw | typical at |
| Timekeeping fields | Seconds, Minutes, Hours, Days, Weekdays, Months, Century, Years |
Clock Output (CLKOUT) | Programmable , or output |
Interrupt Output (INT) | Active-Low open-drain output (Alarm trigger / Countdown timer) |
Pinout (8-Pin SOIC & Module Header)
text
┌───┴───┐
OSCI ─┤ 1 8├─ VDD
OSCO ─┤ 2 7├─ CLKOUT
INT ─┤ 3 6├─ SCL
VSS ─┤ 4 5├─ SDA
└───────┘
| Pin | Name | Type | Description |
|---|---|---|---|
| 1 | OSCI | Analog Input | crystal oscillator input |
| 2 | OSCO | Analog Output | crystal oscillator output |
| 3 | INT | Digital Output | Active-Low open-drain interrupt output pin |
| 4 | VSS | Power | Ground reference (0 V) |
| 5 | SDA | Digital Input / Output | Serial Data |
| 6 | SCL | Digital Input | Serial Clock |
| 7 | CLKOUT | Digital Output | Square-wave clock output pin (Open-drain) |
| 8 | VDD | Power | Supply power input (+1.8 V to +5.5 V DC) |
Specifications
| Parameter | Symbol | Min | Typ | Max | Unit | Conditions |
|---|---|---|---|---|---|---|
| Supply Voltage (Operating) | 1.8 | 3.3 | 5.5 | V | bus operation | |
| Timekeeping Voltage | 1.0 | — | 5.5 | V | Crystal oscillator running | |
| Backup Current | — | 0.25 | 0.8 | µA | inactive | |
| Low Voltage Detect Limit | — | 1.0 | 1.3 | V | Integrity flag set if | |
| Bus Frequency | 0 | — | 400 | kHz | Fast-mode |
Register Map & BCD Format
Time registers are stored in Binary-Coded Decimal (BCD):
| Address | Register Name | Bit Range | Format / Range |
|---|---|---|---|
0x02 | VL_Seconds | Bit 6–0 | 00–59 BCD (Bit 7 = VL Voltage Low integrity flag) |
0x03 | Minutes | Bit 6–0 | 00–59 BCD |
0x04 | Hours | Bit 5–0 | 00–23 BCD |
0x05 | Days | Bit 5–0 | 01–31 BCD |
0x06 | Weekdays | Bit 2–0 | 0–6 (Sunday = 0) |
0x07 | Century_Months | Bit 4–0 | 01–12 BCD (Bit 7 = Century Bit) |
0x08 | Years | Bit 7–0 | 00–99 BCD |
Wiring
| PCF8563 Module Pin | → | Arduino / MCU | ESP32 | Notes |
|---|---|---|---|---|
VCC | 5V / 3.3V | 3.3V | Power rail | |
GND | GND | GND | System ground | |
SCL | A5 | GPIO 22 | Clock | |
SDA | A4 | GPIO 21 | Data |
Example (Arduino RTClib / PCF8563 Library)
cpp
#include <Wire.h>
#include "RTClib.h"
RTC_PCF8563 rtc;
void setup() {
Serial.begin(115200);
Wire.begin();
if (!rtc.begin()) {
Serial.println("Couldn't find PCF8563 RTC!");
while (1);
}
if (rtc.lostPower()) {
Serial.println("PCF8563 lost power, setting time to compile time!");
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
}
void loop() {
DateTime now = rtc.now();
Serial.print(now.year(), DEC); Serial.print('/');
Serial.print(now.month(), DEC); Serial.print('/');
Serial.print(now.day(), DEC); Serial.print(" ");
Serial.print(now.hour(), DEC); Serial.print(':');
Serial.print(now.minute(), DEC); Serial.print(':');
Serial.print(now.second(), DEC); Serial.println();
delay(1000);
}
Common mistakes
- Ignoring the
VL(Voltage Low) flag: Bit 7 of the seconds register (0x02) is theVLflag. If the backup battery voltage drops below ,VLsets to 1, indicating that internal time data is corrupted and must be re-synchronized via NTP/GPS. - Forgetting pull-up resistors on
INT/CLKOUT:INTandCLKOUTare open-drain outputs and require external pull-up resistors to .
Notes
- PCF8563 vs DS1307 vs DS3231: PCF8563 operates down to 1.0V with backup current; DS1307 requires 4.5V main supply; DS3231 includes an internal TCXO crystal for temperature compensation.
Assets & downloads
- datasheetdatasheet
- product-pagereference