User Manual
148
Lesson 33 RTC DS1302
Introduction
DS1302 is a trickle charging clock chip, launched by DALLAS in America. With a built-in real-
time clock/calendar and a 31-byte static RAM, it can communicate with MCU through
simple serial interfaces. The real-time clock/calendar circuit provides information about
second, minute, hour, day, week, month, and year. DS1302 can automatically adjust the
number of days per month and days in leap year. You can determine to use a 24-hour or 12-
hour system by AM/PM selection.
Components
- 1 * Raspberry Pi
- 1 * Breadboard
- 4 * Jumper wires (Male to Male, 2 red and 2 black)
- 1 * Network cable (or USB wireless network adapter)
- 1 * DS1302 RTC module
- 1 * 5-Pin anti-reverse cable
Experimental Principle
Interfacing the DS1302 with a microprocessor is simplified by using synchronous serial
communication. Only three wires are required to communicate with the clock/RAM: RST,
serial data (SDA) and serial clock (SCL). SDA can be transferred to and from the clock/RAM
one byte at a time or in a burst of up to 31 bytes.
After the time of the DS1302 is set manually, the MCU starts to read the accurate time and
date returned by DS1302.










