Interfacing DS1318 with 8051 Microcontroller

Publisher:YuexiangLatest update time:2012-02-02 Source: Maxim中文网站Keywords:DS1318  Counter Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
This application note demonstrates how to use the DS1318 elapsed time counter to count days. The software example includes basic operation procedures and gives a schematic diagram of the application circuit.

BEGIN: DB HTML DS1318 pin configuration

Counter Overview

This application note demonstrates how to use the DS1318 elapsed time counter, which has a 44-bit counter that provides a timing resolution of 244µs. The 44-bit counter is accessed through six 8-bit registers (Figure 1).


Figure 1. DS1318 44-bit counter configuration.

Conceptually, the 44-bit counter can be divided into a 12-bit subsecond counter and a 32-bit counter with a resolution of one second (Figure 2). If the application does not require subsecond resolution, the 32-bit seconds counter can be accessed.


Figure 2. 12-bit subsecond counter and 32-bit seconds counter.

In the example provided in this application note, a software routine continuously reads the value of a 32-bit seconds counter once per second and outputs the time and date in ASCII format through the UART interface of an 8051 microcontroller (µC). The time and date are based on the elapsed time in seconds since 00:00:00, January 1, 1970. 0000000h corresponds to 00:00:00, January 1, 1970; 42C924C0h corresponds to 2005/7/4 12:00:00.

Another subroutine configures the device to interrupt periodically with a frequency of 1Hz. Each time an interrupt occurs, the interrupt handler reads the counter data, converts the time into a date format, and outputs the data in ASCII format through URAT.

We also provide other routines that can perform the following operations on the DS1318: write user input data to registers; convert the time and date entered by the user to the time in seconds since January 1, 1970; write data to a counter. Another subroutine is used to read the DS1318 registers and output the data in hexadecimal format.

How it works

The hardware circuit in this application note places the data of the DS1318 into the data memory space of the µC. The µC accesses the DS1318 registers by reading and writing the data memory at the correct address.

The DS80C323 low-voltage, 8051-compatible microcontroller is used in this example. Both user input data and program output data are passed to the µC, communicating through the RS-232 interface of a PC terminal emulator. Detailed information on the DS80C323 microcontroller used in this application note can be downloaded from the company's website.

The program listing is shown in Figure 3, and the circuit schematic is shown in Figure 4.




Figure 3. Program listing



Figure 4. Circuit schematic.

Keywords:DS1318  Counter Reference address:Interfacing DS1318 with 8051 Microcontroller

Previous article:Design and implementation of automatic storage cabinet based on AT89C52 single chip microcomputer
Next article:Using single chip microcomputer to realize automatic assessment and stop announcement of buses

Recommended ReadingLatest update time:2024-11-16 15:26

Design of Metal Halide Lamp Controller Using C8051F920 Single Chip Microcomputer
1 Introduction At present, most lighting equipment still uses traditional energy for lighting. Making full use of solar energy as the energy supply for lighting equipment is of great significance in terms of saving energy and protecting the environment. 2. Overall structure of controller
[Microcontroller]
Design of Metal Halide Lamp Controller Using C8051F920 Single Chip Microcomputer
Generating 3-wire signals using multiple DS1267 digital potentiometers and an 8051 microprocessor
The DS1267 is a dual-channel digital potentiometer with a serial "shift register" type interface. The shift register has an input pin for shifting data in, and an output pin for shifting data out of the last bit of the shift register when writing. This allows multiple DS1267s to be daisy chained together and programme
[Microcontroller]
Generating 3-wire signals using multiple DS1267 digital potentiometers and an 8051 microprocessor
8051 MCU development environment construction under Ubuntu 16.04
Due to work requirements, I am preparing to learn MCU, and I am also preparing to learn embedded Linux in the future. Recently, I am fed up with the automatic updates of Win10, so I gave up the Windows environment and prepared to start from 51 MCU in Linux environment, learning both MCU and Linux. I am a novice in b
[Microcontroller]
Working principle of non-invasive fetal heart rate detection sensor system
1. Overview Detecting fetal heart rate is a highly technical task. Since the fetal heart rate is very fast, between 120 and 160 beats per minute, it is difficult to measure accurately with a traditional stethoscope or even an ultrasonic Doppler instrument with only amplification function and manual counting. The ultra
[Microcontroller]
Working principle of non-invasive fetal heart rate detection sensor system
Design of intelligent pneumatic pump control system based on C8051F020
1. Introduction to the functions of C8051F020 MCU The C8051F020 device is a fully integrated mixed-signal system-level MCU chip with 64 digital I/O pins. Its main features are: 1) High-speed, pipelined 8051-compatible CIP-51 core (up to 25MIPS); 2) Full-speed, non-intrusive in-system debug interface (on-chip);
[Microcontroller]
Design of intelligent pneumatic pump control system based on C8051F020
C8051F Simulation Debugging Quick Start (Silicon IDE)
Note: Silicon IDE and Keil software must be installed before downloading the program Keil installation:   Please go to Keil official website:  https://www.keil.com/c51/demo/eval/c51.htm to download and install. ·Silicon IDE installation:   Please go to the Silabs official website:  http://www.silabs.com/products/mcu/P
[Microcontroller]
C8051F Simulation Debugging Quick Start (Silicon IDE)
8051 MCU Tutorial Lesson 9: Data Transfer Instructions
Data transfer instructions 1) Instructions with the accumulator as the destination operand MOVA,Rn MOVA,direct MOVA,@Ri MOVA,#data In the first instruction, Rn represents R0-R7. In the second instruction, direct refers to the direct address, and in the third instruction, it is what we just talked about. Th
[Microcontroller]
Design of CAN bus intelligent node based on C8051F550
The CAN bus was first designed by the German company BOSCH to solve the monitoring and control system of automobiles. This paper briefly introduces the characteristics and composition of the CAN bus . The working process of the master node and the construction method of the slave node hardware interface ci
[Microcontroller]
Design of CAN bus intelligent node based on C8051F550
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号