Position: Index >

Software for the DS1302 Real Time Clock

2016-02-21 01:55  
Declaration:We aim to transmit more information by carrying articles . We will delete it soon, if we are involved in the problems of article content ,copyright or other problems.

The DS1302 Trickle Charge Timekeeping Chip contains a real time clock/calendar and 31 bytes of static RAM. It communicates with a microprocessor via a simple serial interface. The real time clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The end of the month date is automatically adjusted for months with less than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with an AM/PM indicator.

This RTC is the replacement for the eariler DS1202. The DS1302 will work is a circuit designed for a DS1202 and will be able to use DS1202 software, HOWEVER, there can be a problem with battery life when used in a DS1202 circuit. This is the problem:

1. The DS1202 only had one Vcc pin and the designer normally powered the chip from the system +5 Volt and from a battery through isolating diodes. With this technique the life of a small lithium coin cell could be years.

2. The DS1302 has two Vcc pins one for system +5 Volt power and a seperate pin for the battery. In a circuit designed to use both Vcc pins the battery life will be years but if a DS1302 is placed in a circuit designed for a DS1202 the life of a small lithium coin cell will only be weeks.

DS1302 mounted in DS1202 socket

The photo above is of a DS1302 mounted in the application area of the MC9S12DP256 EVBplus Development board, DRAGON12, from WYTEC. This circuit used the two diode DS1202 type layout. To correct this problem bend up pin 1 and connect it directly to the positive terminal of the battery. (The diode in the photo could have been replaced with a wire jumper.)


DS1302 mounted in fox11

The photo above is of the DS1302 mounted in the application area of the FOX11 MC68HC11 trainer board from WYTEC. This board has a solderless breadboard mounted above the application area. It must be removed before the DS1302 and other parts are added. The battery part # is CR1225FV available from Mouser Electronics.