Sunday, January 15, 2012

Ways to connect your microcontroller to the M41T81S Real-time Clock chip

By James H. Reinholm


The M41T81S real time clock (RTC) from STMicroelectronics is a trustworthy low-cost, low-power 8-pin IC that electronics designers can use to keep track of time and perform timing functions in their projects. Many of ST's designs need a battery back-up to keep the clock running during power down and maintain their state when the primary power supply is off or at a low voltage level.

The device has a built in power sense component which can instantly switch over to the back-up supply when a low power level or no power is detected. This device can operate normally with a supply voltage of between 2.0 and 5.5V and only needs approximately 0.6micro Amps(at three volts) of back-up battery supply current. A small small lithium button cell may be employed as the back-up source, although another convenient way of providing back-up power would be via the use of a special rechargeable capacitor such as a Super capacitor. Using one of these could make a circuit maintenance-free as issues with battery replacement and disposal are eliminated. Nevertheless a Super Capacitor would only work with short breaks in the power supply (a few days - a battery on the other hand will last years).

The chip has a built in 32.768 kHz oscillator controlled by an external crystal, which is the sole additional component required for the oscillator. The chip has inbuilt load capacitors in the oscillator circuit (pins X0 and X1), so external load capacitors are not required, nor are external resistors.

The chip uses an I2C serial interface for two-way information transfer at 400 kHz. The device is selected by the microcontroller with the address D0h, which initiates the data exchange. Then a byte from the inbuilt SRAM is selected along with the read/write command. A built-in address register is incremented immediately after each WRITE or READ data bit, so the subsequent SRAM byte selection is optional. If the M41T81S senses a low voltage condition, it'll cancel any data transfer in progress and reset the device address counter to prevent erroneous info from being transferred.

There are eight bytes of SRAM reserved for the clock/calendar function and twelve bytes of SRAM are used for status/control of the alarm, watchdog and square wave functions. The eight clock address locations can record from hundredths of a second up to centuries. There's a special clock calibration routine built into the device which can compensate for crystal deviation due to temperature. The operating temperature range is specified from -40 C to +85 C.




About the Author:



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.