Application design of the hottest single chip micr

  • Detail

Application design of single chip microcomputer in digital multimeter

structural characteristics and working principle of 1ds1629

ds1629 is a chip specially designed for digital measurement of temperature, and also has the function of real-time clock/calendar. The wide power range and minimal power consumption of ds1629 are very suitable for battery powered applications. Its clock function can be in 12 hour or 24-hour mode, with am/pm indication in 12 hour mode. When the temperature reaches or exceeds the upper limit th set by the program or the time reaches the time set by the program, the chip will produce an open drain alarm output

ds1629 is composed of six parts: digital temperature sensor, real-time clock, two-wire serial interface, data register, temperature and clock alarm comparator, clock divider and buffer

the temperature sensor specified by the manufacturer does not need external devices. The chip starts temperature conversion as soon as it is powered on, and then continues to convert. The host (usually single-chip microcomputer) can periodically read the latest converted temperature value in the temperature register, And because the conversion is in "The cooperation between the background and Alibaba is not just an ordinary business cooperation. Reading data does not affect the conversion process. The host can modify the chip configuration and does not immediately start the conversion and continuous conversion mode after power on, which is very beneficial for occasions requiring power saving. The real-time clock/calendar provides BCD values of seconds, minutes, hours, weeks, dates, months and years, which requires internal oscillator/frequency divider and external 32.768KHz crystal oscillator. Months with less than 31 days will be automatically adjusted at the end of the month, and the compensation for leap years will continue until 2100. The real-time clock can be turned off by clearing the control bit in the clock register. The clock alarm output can be turned off by reading/writing the clock register or the clock alarm register

binary data is read/written through a two-wire bus, with the high bit first, and each register is accessed using an 8-bit command protocol. The functions of each pin of the chip are shown in Table 1

2.1 hardware design

from the previous discussion, it can be seen that ds1629 has the functions of digital temperature sensor and real-time clock/calendar, and the working voltage is 2.2 ~ 5.5V. Therefore, it can be combined with MCU to design a digital thermometer with the function of digital clock. The single chip microcomputer adopts AT89C2051, which is packaged as 20dip, and the working voltage range is 2.7 ~ 5.5V. The display part adopts 6-digit digital tube to display data such as time, date or temperature. In order to simplify the circuit, reduce the chip and reduce the power consumption, the display part adopts the mode of dynamic cyclic scanning and is driven by a 4-7 segment decoder cd4543. The working voltage of cd4543 is 3 ~ 18V, and the whole circuit is powered by two dry batteries. The hardware composition of the system is shown in Figure 1. In the figure, the SCL and SDA terminals of ds1629 are respectively connected to P3.0 and P3.1 of the single chip microcomputer, R1 and C1 form the power on automatic reset circuit, p3.2 ~ p3.4 are connected to three keys, C2, C3 and 6mhz crystal oscillators form the oscillation circuit, p3.5, P3.7, P1.0 ~ p1.3 are respectively connected to the common end of 6-bit nixie tubes (the three nixie tubes LED2 ~ LED4 in the figure are not drawn) as the position selection signal, and P1.4 ~ P1.7 are connected to the BCD code input end of cd4543, The data input terminals a ~ g of the six nixie tubes are connected to the data output terminals a ~ g of the cd4543 in parallel

the functions of the digital meter include temperature measurement and display and clock, so it should be considered at the same time in the software design. The thermometer and clock functions are selected by the key S3. The default state after power on is to automatically display the measured temperature. Press S3 to switch to the company and add a 3D printing R & D laboratory time display. Press again to return to the temperature display. By default, key S2 is a stopwatch function key. Press it once to start timing, press it twice to stop timing, press it three times to clear 0, and then press it again to return to the initial state. In the default state, press S1 as the function key to adjust the time. Press S1 once to set the hour. At this time, S2 is the plus 1 key, press 1 hour plus 1, S3 is the minus 1 key, and press 1 hour minus 1; Press S1 twice to set minutes. At this time, S2 and S3 have the same effect as before; Press S1 three times to return to the initial state. According to these functions, the software design consists of initialization, function key processing, time display, temperature measurement and display. The initialization part completes the initial configuration of MCU interrupt, timer, on-chip storage unit and ds1629; The function key processing part scans the keyboard and processes it accordingly; The time and temperature display is to read the time and temperature parameters of ds1629 and send out the display after conversion. The following is the program section of the single-chip microcomputer operating on ds1629. It is assumed that P3.1 of the single-chip microcomputer is connected to SDA and P3.0 is connected to SCL, and the working mode of ds1629 is set to single conversion e-mail:samt_ Cui@ mode, clock output is prohibited, and the clock is high-level alarm for temperature and time, the corresponding program section is as follows:

from the previous discussion, it can be seen that ds1629 brings great convenience to the temperature measurement and control of the digital shoulder sample based on single chip microcomputer, which greatly simplifies the design of the system and has high practical value

Copyright © 2011 JIN SHI