Interfacing a DS1305 RTC with an 8051-Type Microcontroller
DescriptionThis application note demonstrates how to interface a DS1305 Serial Alarm Real-Time Clock (RTC) to an 8051-type microcontroller. Example code shows basic interface routines. The microcontroller used in this example is the DS2250 Soft Microcontroller Module, and the software is written in C. The program demonstrates setting and reading the time and date, writing and reading the RAM, and setting and reading an alarm.
OperationThe interface program uses three general-purpose port pins (GPIOs) on the microcontroller and the 3-wire interface to communicate with the DS1305 real-time clock. An additional port pin is used to monitor the INT0 interrupt output on the DS1305.
The software is shown in Figure 1. A schematic of the circuit is shown in Figure 2.
Download zip file
Figure 1. Interface Program Listing
For Larger Image
Figure 2. Schematic of DS1305.