Interface between DS1305 RTC and 8051 microcontroller

Abstract: This article introduces the connection between the DS1305 real-time clock and the 8051 microcontroller DS2250. The basic interface program provided is written in C language.

DS1305 pin configuration
Overview This application note describes the interface between the DS1305 serial real-time clock (RTC) and the 8051 microcontroller. The provided program code can implement basic interface functions. The microcontroller used in this article is a DS2250 flexible microcontroller module, the program is written in C language. This program can demonstrate the setting and reading of time and date, the reading and writing operation of RAM, and the setting and reading of alarm clock. Working principle The interface program uses three general-purpose ports of the microcontroller to communicate with the 3-wire interface of the DS1305 real-time clock, and an additional port pin is used to monitor the INT0 interrupt output of the DS1305.

The program list is shown in Figure 1, and the typical circuit is shown in Figure 2.

Download zip file Figure 1. Interface program list

Figure 2. Typical circuit of DS1305
View larger image Figure 2. Typical DS1305 circuit

Traffic Facilities

Traffic Facilities,Waterproof Traffic Facilities,Outdoor Traffic Facilities,Traffic Control Devices

Yangzhou Heli Photoelectric Co., Ltd. , https://www.heli-eee.com