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.
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
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- STC32G Series MCU Technical Reference Manual
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 24V to 16V circuit problem
- The problem of the propagation speed of electric pulses in wires
- CCS usage problems and solutions
- 【FAQ】BQ76930: Battery balancing issue
- C2000 CLA FAQ
- Ultra-small packaged IC chips VKD233DS and VKD233DR for wireless Bluetooth headsets
- PCB board level shielding design
- DSP Basics--Fixed-point Decimal Operations
- Use protues8.6 to simulate, SRF04 simulation fails, the code is correct,
- DM648 FVID_exchange failed