Share this

DS1629 temperature sensor with real-time clock

2026-04-06 04:48:58 · · #1
[align=left] Abstract: The DS1629 is a newly released digital thermometer with a two-wire serial interface and a clock displaying year, month, day, and week. It has a temperature measurement accuracy of ±2℃, a resolution of 0.5℃, and a temperature range of -55℃ to +125℃. It also features programmability, wide voltage range, and low power consumption, making it suitable for battery-powered systems. This article details the functions and usage of the DS1629. Keywords: Temperature sensor; Real-time clock; DS1629 1. Overview The DS1629 is a two-wire serial interface digital thermometer chip with a calendar and clock, launched by Dallas Semiconductor in 1999. It integrates a digital temperature sensor, a real-time clock, and a Y2K corrected calendar onto a single chip. The DS1629 is commonly used in mobile phones, industrial control, office equipment, data acquisition, and other systems requiring temperature measurement and timing control. By integrating these two functions onto a single chip, the DS1629 reduces the number of external components and system space, while also offering programmability, wide voltage range, and low power consumption, making it suitable for low-power systems such as battery-powered systems. The pin symbols of the DS1629 are shown in Figure 1, and the functions of each pin are listed in Table 1. The DS1629 digital temperature sensor has an accuracy of ±2.0℃, outputting a 9-bit temperature measurement value in 0.5℃ increments to indicate the ambient temperature. Its temperature measurement range is -55℃ to +125℃; the real-time clock provides a BCD code clock/calendar with year-over-year compensation up to 2100, and offers both 12-hour and 24-hour modes; it requires an external 32.768kHz crystal oscillator, has an on-chip frequency divider, and provides an open-drain frequency divider signal output; it has temperature interrupt and clock interrupt functions, which can be set by the user to be simultaneously active, individually active, or both disabled (default power-on state); in addition, it has 32 bytes of general-purpose SRAM for general recording purposes. All communication is completed through a standard two-wire serial interface. 2. Two-wire serial bus The DS1629 supports a two-wire serial data transmission protocol. The DS1629 acts as a slave device on the bus, connected to the master CPU via SDA and SCL pins. The master CPU generates a serial clock to access the bus. The bus protocol is defined as follows: ● Data transmission can only begin when the bus is idle, i.e., both the data line and clock line are high. ● START bit (Start of Data Transmission): When the clock line is high, the data line transitions from high to low, defining a START bit, indicating the start of a data frame transmission. ● STOP bit (Stop of Data Transmission): When the clock line is high, the data line transitions from low to high, defining a STOP bit, indicating the end of a data frame transmission. ● Valid Data Bit: After a START bit, a fixed level on the data line during the high-level clock period is considered a valid data bit. During the low-level clock period, the state of the data line can be changed. One data bit corresponds to one clock pulse. During data transmission, when the clock line is high, the data line must maintain a fixed level. Changing the state of the data line during this time will be interpreted as a START or STOP bit, causing a data interruption. ● Each data frame transmission begins with START and ends with STOP. A new frame can also be started with another START bit. The number of bytes in a data frame is unlimited and determined entirely by the main CPU. For each byte transmitted, the DS1629 sends an ACK signal to indicate receipt. ● The maximum clock frequency of the DS1629 is 400kHz. ● When the main CPU accesses a device on the serial bus, it first sends the START bit, followed by a control word. This control word is defined as follows: D7, D6, D5, D4: Control code. These 4 bits are set to 1001 when reading or writing to the DS1629. D3, D2, D1: Address code. The DS1629's address code is fixed to 111 by hardware; therefore, only one DS1629 can be connected to the bus at a time to avoid address conflicts. However, up to seven other serial devices can be connected to the bus, provided their control code is 1001 and their address code is not 111. D0 (R/W): Read/write bit. When bit D0 is 1, it indicates a read operation; when bit D0 is 0, it indicates a write operation. After the START bit, the DS1629 will detect the control word on the data line. Upon receiving the control word, it will send back an ACK signal, setting the operating mode to receive or transmit based on the read/write bits. ● The electrical parameters of the two-wire serial bus are listed in Table 2, and the timing diagram is shown in Figure 2. 3. Temperature The DS1629 is factory-set to start continuous temperature measurement upon power-up. This operation is similar to background operation; the main CPU can periodically read the temperature register without affecting temperature measurement and conversion. Users can also disable automatic temperature measurement upon power-up of the DS1629 to reduce power consumption. Users can set the DS1629 to single conversion, completing one conversion, writing data to the temperature register (see Figure 3), and then returning to standby mode. It can also be set to continuous conversion. The typical conversion time is 400ms, with a maximum of 1000ms, and the measurement accuracy is ±2.0℃. Regardless of the mode, users can obtain the data in the temperature register using the read temperature command (AAh). Setting the highest bit of the low byte in the temperature register to 1 or 0 provides a resolution of 0.5℃. Temperature data is represented in two's complement binary, as shown in Table 3. 4. Clock/Calendar The command to access the real-time clock/calendar register is C0h. Reading and writing are controlled by the R/W bits in the serial communication control word. Data is in BCD code, as shown in Figure 4 (a 0 bit indicates a read-only bit, and the read value is always 0). CH: Clock pause bit. CH=0 enables the divider; CH=1 disables the divider. The default value is 0 upon power-up, meaning the divider outputs a signal immediately upon power-up. 12/24: Timing mode selection bit. 0 for 24-hour format, 1 for 12-hour format. Bit 5 of cell 02h forms the high-order bits of the hour (0, 1, 2) together with Bit 4 in 24-hour format. In 12-hour format, Bit 5 is 0, indicating AM; Bit 5 is 1, indicating PM. 5. Interrupts The DS1629 provides an open-drain interrupt pin. Interrupt mode is configured in the status register, and can be set to temperature or time interrupt only, both temperature and time interrupt, or interrupt disabled. The status register has two status bits, TAF and CAF. The DS1629 determines the interrupt output by the logical OR result of these two status bits. 5.1 Temperature Interrupt: After each temperature conversion, the temperature comparator is refreshed. When the measured temperature reaches or exceeds the value in the upper temperature limit register TH, the TAF bit in the status register is set to 1 and remains in the 1 state until the temperature value drops to the value in the lower temperature limit register TL, at which point it is automatically cleared to 0. Reading and writing to the TH and TL registers can be performed using the A1h (access TH) and A2h (access TL) instructions according to the two-wire serial bus communication protocol. Both TH and TL registers are E2PROM registers, and their format is the same as the temperature register. 5.2 Time Interrupt: When the data in the time register is the same as the data in the time interrupt register, the DS1629 will set the time interrupt flag (CAF) within 1 second, and it will be cleared after the main controller performs a read/write operation on the time or time interrupt register. The format of the time interrupt register is shown in Figure 5. The default setting of the DS1629's time interrupt register upon power-on is 12:00 AM Sunday. The command to access the time interrupt register is C7h. When setting the interrupt time, whether the time is in 24-hour or 12-hour format must match the format of the time register. 6. Status Register The command to access the status register is Ach. Read and write operations are performed with the high byte first. The format of the status register is shown in Figure 6. 1SH: Temperature conversion mode selection. When 1SH is 1, it is in single conversion mode; the DS1629 performs one temperature conversion after receiving the start temperature conversion command EEh. When 1SH is 0, it is in continuous conversion mode; in this case, the DS1629 will continuously perform temperature conversions and save the most recent result in the temperature register. The factory default setting is 0. POL: Interrupt output status selection. When POL is 0, the interrupt output is active low; when POL is 1, the interrupt output is active high. The factory default setting is 0. CNV: Power-on operating status selection. When CNV is 0 (factory default setting), the DS1629 begins temperature conversion upon power-up. When CNV is 1, the DS1629 is in standby mode after power-up. Users can select the state of the 1SH and CNV flags according to system power consumption requirements. A0, A1: Interrupt output selection (see Table 4). OS0, OS1: Frequency output selection (see Table 5). CAF: Time interrupt flag, read-only bit. When the real-time time matches the set interrupt time, the CAF bit is set to 1 and automatically cleared to 0 after the main controller performs a read/write operation on the time or time interrupt register. CAF of 0 indicates that the real-time time does not meet the interrupt conditions. It is automatically cleared to 0 upon power-up. TAF: Temperature interrupt flag, read-only bit. When the measured temperature reaches or exceeds the temperature value in the TH register, the TAF bit is set to 1 and cleared to 0 only when the measured temperature drops below the temperature value in the TL register. TAF of 0 indicates that the measured temperature does not meet the interrupt conditions. It is automatically cleared to 0 upon power-up. CAL: Time interrupt latch bit. Read-only bit. CAL is set to 1 when a time interrupt occurs. Once set to 1, it remains in the 1 state until the DS1629 is power-on and reset. CAL of 0 indicates that no time interrupt has occurred during the DS1629's power-on operation. It is automatically cleared to 0 upon power-on. TAL: Temperature interrupt latch bit. Read-only bit. It is set to 1 when a temperature interrupt occurs and remains in the 1 state until the DS1629 is power-on and reset. TAL of 0 indicates that the temperature measured by the DS1629 during power-on operation has never exceeded the temperature value set in the TH register. It is automatically cleared to 0 upon power-on. 7. Command Set The DS1629 command set is listed in Table 6. The explanation of the commands can be found in the notes column as follows: 1. The data flow is determined by the read/write bit (R/W) of the control word in the serial communication protocol. 2. When accessing SRAM in page read/write mode, after accessing the highest address cell, the DS1629 returns an ACK signal, and then the address counter automatically returns to the lowest address. 3. In continuous temperature conversion mode, the measurement can be stopped using the stop temperature conversion command. Then the measurement must be restarted using the Start Temperature Conversion command. In single-operation mode, the Start Temperature Conversion command must be used for each temperature reading. 4. When reading the temperature register, if high accuracy is not required, only the first byte needs to be read; otherwise, both bytes must be read. 5. When writing data to the E2 register, the typical write time is approximately 10ms at room temperature, with a maximum of 50ms. Therefore, there should be at least a 50ms interval between two write operations. The TH, TL, and status registers of the DS1629 are E2 registers. 6. The low byte of the DS1629's status register is a read-only register. During write operations, only the high byte can be written; during read operations, both the high and low bytes can be read. 7. Used to achieve high-precision temperature measurement.
Read next

CATDOLL Oksana 95CM TPE Mini Love Doll

Height: 95cm Weight: 16kg Shoulder Width: 27cm Bust/Waist/Hip: 50/52/63cm Oral Depth: 3-5cm Vaginal Depth: 3-13cm Anal ...

Articles 2026-02-22