Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
13760_ds12887 Rtc Interfacing

13760_ds12887 Rtc Interfacing

Ratings: (0)|Views: 47|Likes:
Published by Jay Tiwari

More info:

Published by: Jay Tiwari on May 13, 2013
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Ads by Google
► Alarm Clock► RTC Real Time Clock► RTC
Related Searches:
HTML Page Adobe PhotoshopPluginsGoogle Search ApplianceNew Business ApplicationsInternet SearchEnginesInternet SearchKeyword ResearchKeyword Analysis Ad Copy Adobe PhotoshopTutorialsPlugin For Photoshop
4/15/13 DS12887 RTC INTERFACINGwhat-when-how.com/8051-microcontroller/ds12887-rtc-interfacing/ 2/11
The real-time clock (RTC) is a widely used device that provides accurate time and date for many applications. Manysystems such as the x86 IBM PC come with such a chip on the motherboard. The RTC chip in the IBM PC providestime components of hour, minute, and second, in addition to the date/calendar components of year, month, and day. TheRTC chip uses an internal battery, which keeps the time and date even when the power is off. Although some 8051family members, such as the DS5000T, come with the RTC already embedded into the chip, we have to interface thevast majority of them to an external RTC chip. One of the most widely used RTC chips is the DS 12887 from DallasSemiconductor/Maxim Corp. This chip is found in the vast majority of x86 PCs. The original IBM PC/AT used theMC14618B RTC from Motorola. The DS 12887 is the replacement for that chip. It uses an internal lithium battery tokeep operating for over 10 years in the absence of external power. According to the DS 12887 data sheet from Maxim,it keeps track of “seconds, minutes, hours, days, day of week, date, month, and year with leap-year compensation validup to year 2100″. The above information is provided in both binary (hex) and BCD formats. The DS 12887 supports both 12-hour and 24-hour clock modes with AM and PM in the 12-hour mode. It also supports the Daylight SavingsTime option. The DS 12887 uses CMOS technology to keep the power consumption low and it has the designationDS12C887, where C is for CMOS. The DS12887 has a total of 128 bytes of nonvolatile RAM. It uses 14 bytes oRAM for clock/calendar and control registers, and the other 114 bytes of RAM are for general-purpose data storage. Inthe x86 IBM PC, these 114 bytes of NV-RAM are used for the CMOS configuration, where the system setups are kept before the operating system takes over. Next we describe the pins of the DS 12887. See Figure 16-1.
Pin 24 provides external supply voltage to the chip. The external voltage source is +5V. When V
falls below the 3Vlevel, the external source is switched off and the internal lithium battery provides power to the RTC.This nonvolatile capability of the RTC prevents any loss of data. According to the DS12887 data sheet “the RTCfunction continues to operate, and all of the RAM, time, calendar, and alarm memory locations remain non-volatileregardless of the level of the V
input.” However, in order to access the registers via a program, the V
must besupplied externally. In other words, when external V
is applied, the device is fully accessible and data can be writtenand read. When V
falls below 4.25 volts, the read and write to the chip are prevented, but the timekeeping and RAMcontents are unaffected, since they are nonvolatile.
It must also be noted that “when V
is applied to the DS12887
4/15/13 DS12887 RTC INTERFACINGwhat-when-how.com/8051-microcontroller/ds12887-rtc-interfacing/ 3/11
and reaches a level of greater than 4.25V, the device becomes accessible after 200ms.”
Pin 12 is the ground.
The multiplexed address/data pins provide both addresses and data to the chip. Addresses are latched into the DS12887 on the falling edge of the AS (ALE) signal. A simple way of connecting the DS 12887 to the 8051 is shown inFigure 16-2. Notice that ADO – AD7 of the DS 12887 are connected directly to PO of the 8051 and there is no needfor any 74xx373 latches, since the DS 12887 provides the latch internally. To access the DS 12887 in Figure 16-2, weuse the MOVX instruction since it is mapped as external memory. We will discuss this shortly.
AS (address strobe) is an input pin. On the falling edge it will cause the addresses to be latched into the DS 12887. TheAS pin is used for demultiplexing the address and data and is connected to the ALE pin of the 8051 chip.
This is an input pin that allows the choice between the Motorola and Intel microcontroller bus timings. The MOT pin isconnected to GND for the Intel timing. That means when we connect DS 12887 to the 8051, MOT = GND.
Data strobe or read is an input. When MOT = GND for Intel timing, the DS pin is called the RD (read) signal and isconnected to the RD pin of the 8051.
Read/Write is an input pin. When MOT = GND for the Intel timing, the R/W pin is called the WR (write) signal and isconnected to the WR pin of the 8051.
Chip select is an input pin and an active low signal. During the read (RD) and write (WR) cycle time of Intel timing, theCS must be low in order to access the chip. It must be noted that the CS works only when the external V
is connected.In other words “when V
falls below 4.25V, the chip-select input is internally forced to an inactive level regardless of thevalue of CS at the input pin.” This is called the
write-protected state.
When the DS 12887 is in write-protected state, allinputs are ignored.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->