Interfacing a DS1388 Real-Time Clock with an 8051-Type Microcontroller
Abstract
This application note demonstrates how to interface a DS1388 to an 8051-type microcontroller with software written in C. Basic interface routines are illustrated by example code. The microcontroller used in this example is the DS2250.
Description
This application note demonstrates how to interface a DS1388 real-time clock to an 8051-type microcontroller and provides example code showing basic interface routines. The microcontroller used in this example is the DS2250, and the software is written in C.
Operation
The program uses two general-purpose port pins on the micro to operate as a master on the I²C bus. The DS1388 operates as a slave device on the same bus.
The software is shown in Figure 1. A schematic of the circuit is shown in Figure 2.
Figure 1. Program Listing
Download zip file