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. Although PCF8573
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. In a screenshot above you can see SCL – Clock and SDA – Data lines while I2C was active. Oscilloscope screen capture was taken with RIGOL DS2072
Assembly code is available here. You may also be interested in SPI code example here or UART implementation.