ENGLISH 简体中文 日本語 한국어  


APPLICATION NOTE  3721

Interfacing the DS1318 with an 8051-type Microcontroller

Abstract: This note demonstrates an application that counts the passage of days using the DS1318 Elapsed-Time Counter. The software example includes basic operating routines. A schematic of the application circuit is included.

DS1318 Pin Assignment
DS1318 Pin Assignment

Counter Overview

This application note demonstrates how to use the DS1318 Elapsed-Time Counter. The DS1318 has a 44-bit counter that increments once every 244µs. The 44-bit counter is accessed through six 8-bit registers (Figure 1).

Figure 1. DS1318 44-bit counter configuration.
Figure 1. DS1318 44-bit counter configuration.

Conceptually, the 44-bit counter can be broken into a 12-bit sub-second counter and a 32-bit counter that increments once per second (Figure 2). If sub-second resolution is not required, only the 32-bit second counter registers can be accessed.

Figure 2. The 12-bit sub-second and 32-bit second counters.
Figure 2. The 12-bit sub-second and 32-bit second counters.

In the example for this application note, a software routine reads the 32-bit seconds counter continuously, and outputs the time and date in ASCII format through a UART on an 8051 microcontroller (µC) on each once-per-second change. The time and date value is based upon the elapsed time, in seconds, from January 1, 1970 00:00:00. A value of 00000000h would be January 1, 1970 00:00:00. A value of 42C924C0h corresponds to 2005/7/4 12:00:00.

Another routine configures the device's periodic interrupt to a 1Hz rate. Each time an interrupt occurs, an interrupt handling routine reads the counter data, converts the data to a time and date format, and outputs the data in ASCII through the UART.

Additional routines are possible. In other examples the DS1318 could: take user inputs to write data to a single register; take time and date information from the user and convert it to elapsed time in seconds from January 1, 1970; write the value to the counter. Another routine reads all the DS1318 registers and outputs them in hexadecimal format.

Operation

The hardware example in this application note places the DS1318 into the µC's data memory space. The µC accesses the DS1318's registers by reading and writing the appropriate data-memory locations.

A low-voltage 8051-compatible microcontroller, the DS80C323, is used in this example. User inputs and data outputs from the program are passed to the µC through an RS-232 interface from a terminal emulator program on a PC. More information about the DS80C323 microcontroller used in this application note can be found on our website.

The software is shown in the Program Listing, Figure 3. A schematic of the circuit is shown in Figure 4.


Figure 3. Program listing.
Download
(TXT, 7K)
Figure 3. Program listing.

Figure 4. Circuit schematic.
More Detailed Image
(PDF, 30K)
Figure 4. Circuit schematic.


의견을 보내주세요!
위 내용이 도움이 되셨나요?
여러분의 의견을 기다립니다 — Maxim은 보내주신 정정이나 제안사항을 반영하고 있습니다. 이 페이지를 평가하고 의견을 보내주십시오.


자동 업데이트
관심있는 분야의 애플리케이션 노트가 나올 때 자동으로 업데이트 받고 싶으세요? 그렇다면 EE-Mail™을 신청하십시오.



추가 정보  APP 3721: Dec 23, 2005
DS1318 병렬 인터페이스가 내장된 경과시간 카운터 전체 데이터 시트
(PDF, 168kB)
무료 샘플
 

다운로드, PDF 형식다운로드, PDF 형식 (67kB)
 AN3721, AN 3721, APP3721, Appnote3721, Appnote 3721



         



   Copyright © 2008 by Maxim Integrated Products, Dallas Semiconductor    법적 고지    개인정보보호 정책