アプリケーションノート3974

Using a DS32x35 with an 8051-Type Microcontroller

Mar 23, 2007

Abstract: This application note describes how to interface the DS32x35 real-time clock with an 8051-type microcontroller. It also provides a schematic of the application circuit and example software code for implementing basic operating routines.

Overview of the DS32x35

The DS32x35 real-time clock (RTC) is a temperature-compensated clock/calendar that includes an integrated 32.768kHz crystal, an I²C interface, and a bank of nonvolatile memory in a single package. The DS32x35's integration of a crystal resonator enhances the long-term accuracy of the device and reduces the piece-part count in a manufacturing line.

The RTC provides seconds, minutes, hours, day, date, month, and year information. The date at the end of the month is automatically adjusted for months with fewer 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. Additionally, the clock provides two programmable time-of-day alarms and a programmable square-wave output.

Interfacing the DS32x35 to a µC

This application note demonstrates how to interface the DS32x35 to an 8051-type microcontroller, such as the DS2250 soft-microcontroller module. Additionally, Figure 1 provides example code, written in C, for implementing basic interface routines, including routines for reading the time and date from the real-time clock (RTC); writing time and date data to the RTC from user entries; writing and reading data to and from the FRAM; reading the temperature from the temperature sensor; and selecting the proper FRAM density. The software supports both FRAM densities: 16kb (DS32B35) and 64kb (DS32C35).

Figure 2 is a schematic that illustrates the connections required for interfacing the DS32x35 RTC with an 8051-type microcontroller. The program uses two general-purpose (GP) port pins on the microcontroller to communicate with the DS32x35 using an I²C serial interface; a third GP port pin is used to enable or disable the write-protect (WP) input pin for the FRAM. The microcontroller's internal UART drives two port pins, which are connected to a DS232 line driver/receiver. User inputs and data outputs from the program are passed through the RS-232 interface from a PC's terminal-emulator program to the microcontroller. The RS-232 DTR input line controls the microcontroller's reset input.

Figure 1. Program Listing.
Download Program Files
(ZIP, 4kB)
Figure 1. Program Listing

Figure 2. A schematic illustrating the connections for interfacing the DS32x35 with an 8051-type microcontroller.
More detailed image
(PDF, 260kB)
Figure 2. A schematic illustrating the connections for interfacing the DS32x35 with an 8051-type microcontroller.



関連製品
DS32B35 TCXO/水晶/FRAM内蔵、高精度I²C RTC  
DS32C35 TCXO/水晶/FRAM内蔵、高精度I²C RTC  


次のステップ
EE-Mail EE-Mail配信の登録申し込みをして、興味のある分野の最新ドキュメントに関する自動通知を受け取る。
Download ダウンロード、PDFフォーマット (41kB)  
シェア
その他のチャンネル  E-Mailこのページを知り合いに送る。


We Want Your Feedback!



フィードバックをお寄せください。
内容に満足されましたか、あるいは満足されていませんか?もっと良いページにできると思いますか?あるいは、単なるコメントでも結構です。フィードバックをお待ちしています。—マキシムはお客様からいただく訂正、提案を元に改善していきます。 このページを評価し、フィードバックを送信する。



APP 3974: Mar 23, 2007
アプリケーションノート3974, AN3974, AN 3974, APP3974, Appnote3974, Appnote 3974

シェア



その他




    |         |         |     プライバシーポリシー     |     法的お知らせ
Copyright © 2012 by Maxim Integrated Products