Interfacing a DS1305 RTC with an 8051-Type Microcontroller

Abstract: This application note describes how to interface a DS1305 real-time clock with the DS2250, an 8051-type microcontroller. Example code, written in C, shows basic interface routines.

DS1305 Pin Assignment


This 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.


The 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

Figure 2. Schematic of DS1305.
For Larger Image

Figure 2. Schematic of DS1305.
Next Steps
EE-Mail Subscribe to EE-Mail and receive automatic notice of new documents in your areas of interest.
Download Download, PDF Format
© , Maxim Integrated Products, Inc.
The content on this webpage is protected by copyright laws of the United States and of foreign countries. For requests to copy this content, contact us.
APP 3510:
APPLICATION NOTE 3510,AN3510, AN 3510, APP3510, Appnote3510, Appnote 3510