Summary of PCF8573P I2C Real Time Clock
This article shows how to interface a PCF8573 I2C real-time clock with a PIC16F876A to read minutes and display them on an LED bar graph. It describes a minimal hardware setup (oscillator and capacitor), I2C addressing (write 0xD0, read 0xD1), ACK handling, and transferring minutes to PORTB. An assembly code example, oscilloscope capture of SCL/SDA using a Rigol DS2072, and links to datasheet and related SPI/UART examples are provided.
Parts used in the PCF8573 RTC with PIC16F876A project:
- PIC16F876A microcontroller
- PCF8573 real time clock (RTC) IC
- LED bar graph (connected to PORTB)
- Oscillator for PIC
- Small capacitor (for oscillator stabilization)
- I2C pull-up resistors (implied for SDA and SCL lines)
- Wiring/PCB to connect components
- Oscilloscope (Rigol DS2072 used for capture)
In this post I’m going to show you how to interface an I2C Real Time Clock – RTC with PIC microcontroller. Only a basic hardware configuration and a communication protocol are presented here. I’m planning to extend it to a more advanced design in a near future. 
was used a similar IC’s like PCF8583
will also fit with minimal changes to PIC software. The PCF8573 is a real time clock/calendar IC. Its addresses and data are transferred serially via the two-line bidirectional I2C bus. I2C communication was used in a number of projects like a Function Generator. Here a modified assembly code will read a minutes count from PCF8573 and show its binary value on LED bar graph connected to PORTB of PIC16F876A.
To set up a basic circuit only an oscillator and a small capacitor are required. See design schematic. PCF8573 I2C address 0xD0 is send by PIC. If ACK is received the minutes data is read by sending 0xD1 address and transferred to PORTB. (LSB is R/W bit). More detailed explanation can be found in attached assembly code at the bottom of the page, also look at full Data Sheet for comprehensive functional description of RTC, its timing specification and operation modes.
using its I2C Decoder and trigger mode.
Assembly code is available here. You may also be interested in SPI code example here or UART implementation.
For more detail: PCF8573P I2C Real Time Clock
- How is the PCF8573 addressed by the PIC over I2C?
The PIC sends address 0xD0 for write and 0xD1 for read; the LSB is the R/W bit. - Can a similar RTC like PCF8583 be used?
Yes, similar ICs like PCF8583 will also fit with minimal changes to PIC software. - What minimal hardware is required to set up the circuit?
Only an oscillator and a small capacitor are required for the basic circuit. - How is the minutes data transferred to the PIC?
The PIC reads the minutes by sending the PCF8573 read address and transfers the received minutes byte to PORTB. - Does the project include example code?
Yes, modified assembly code is provided and available via the article link. - What tool was used to capture I2C signals in the article?
An oscilloscope Rigol DS2072 was used with its I2C Decoder and trigger mode. - What happens if ACK is received after sending the write address?
If ACK is received the PIC proceeds to read the minutes data by sending the read address 0xD1. - Where can I find more detailed functional description and timing?
Refer to the full PCF8573 data sheet linked in the article for comprehensive functional description and timing specification.