How to interpret DS1847 / DS1848 temperature readings-How to I

Abstract: The DS1847 and DS1848 have an on-chip direct-to-digital temperature sensor. The temperature is stored in address locaTIons E2h and E3h. This applicaTIon note explains how to convert the digital temperature data into a decimal degrees Celsius value.

TranslaTIng Temperatures from Hex to DecimalThe procedure for converTIng temperature values ​​for the DS1847 and DS1848 begins with reading the hex values ​​stored in bytes E2h (the MSB of the temperature) and E3h (the LSB of the temperature). These two bytes contain the most recent temperature reading. Once the two bytes have been read, they can be translated into binary. The bit weights are shown in Table 1.

Table 1. Bit weight from page 5 of the DS1847 and DS1848 data sheets
E2h (Temperature MSB) E3h (Temperature LSB)
S 27 26 25 twenty four twenty three twenty two twenty one 20 2-1 2-2 2-3 2-4 0 0 0

The temperature is stored in the 13 MSBs of the binary data. The MSB is the sign bit and indicates whether or not the 2's complement binary number is positive or negative. If the MSB is 0, then the value is positive. If the MSB is 1, then the value is negative. The next 12 bits contain the value of the temperature and are translated into decimal by different methods for positive and negative values. Positive Temperature Translation The following is an example of how to translate a positive temperature. In this example , address locations E2h and E3h contain 2Ah and 88h, respectively. Combine these two bytes to get 2A88h. Next, translate the hex data into binary. The binary equivalent of 2A88h is 0010 1010 1000 1000. Since the MSB is 0, the temperature is positive. The lower 3 bits of the binary data are ignored, so they are masked with 0s. Table 2 shows the translation from hex to binary and the masking of the lower 3 bits.

Table 2. Positive number (MSB = 0) translation
HEXIDECIMAL DATA BINARY DATA MASKED BINARY DATA
2A88h 0010 1010 1000 1000 0010 1010 1000 1000

Because the temperature is positive, no 2's complement transformation is required. The data can be translated directly into a decimal number using a calculator. The binary number 0010 1010 1000 1000 is equal to the decimal value of 10888. Because the data contains a fractional component , the decimal value has to be divided to attain the true temperature. The decimal value must be divided by 128 (or multiplied by 2-7) to calculate the correct decimal temperature value. Dividing the decimal value 10888 by 128 results in a decimal temperature value of 85.0625 ° C. Negative Temperature TranslationConverting a negative temperature value (MSB = 1) is a little more involved. As an example, addresses E2h and E3h contain the data F8h and 08h. The first step would be to convert the hex values ​​into binary. Again, the lower 3 bits are ignored, so they will be masked with 0s. Table 3 shows the translation from hex to binary and the masking of the 3 lower bits.

Table 3. Negative number (MSB = 1) translation
HEXIDECIMAL DATA BINARY DATA MASKED BINARY DATA
F808h 1111 1000 0000 1000 1111 1000 0000 1000

The next step is to take the 2's complement of the masked binary value. This is done by first inverting the masked binary number, then adding 1 to it. Inverting the binary number 1111 1000 0000 1000 results in the binary number 0000 0111 1111 0111. Adding 1 gives the binary number 0000 0111 1111 1000. This value is equal to the decimal number 2040. Like in the positive temperature example, the translated decimal value is divided by 128, but is also made negative because the temperature is negative as indicated by the MSB. So, when the decimal value 2040 is divided by -128, the result is a decimal temperature value of -15.9375 ° C. ConclusionThis application note demonstrates the two methods of translating the hex data found in addresses E2h and E3h into a decimal degrees Celsius temperature value. Any questions about this document can be directed to the Mixed-Signal Applications Group at var name = "MixedSignal.Apps @"; var domain = "dalsemi.com"; document.write ("" + name + domain + "") ; MixedSignal ..

1,2.4G Digital Wireless Backup Camera System for Truck/Van/Caravan/Trailers/Camper/Pickup/5th Wheel/Bus. Easy to install, no more complex wiring.

2, 7-Inch TFT LCD screen Monitor with Built-in Wireless Receiver-- High resolution image and full color display.

3,Rearview IR Reverse HD backup Camera with Built-in Wireless Transmitter---with 12/18/28 individual Infrared (IR) LED for Night Vision. Hard Metal Cased Camera with IP68 Waterproof and Mud proof, Designed and tested for extreme climates.

4, Voltage Range From 12-32V DC Power, Flexible Vehicle Compatibility.

5, Digital wireless technology for specialty vehicles , No any interference with other wireless devices, if you ensure stable and high resolution image with 100M acceptance range in open areas.

Wireless Backup Camera System

Wireless Backup Camera For Car,2.4G Wireless Backup Camera System,Wireless Backup Camera Kit,Wireless Led Backup Camera Kit

Shenzhen Sunveytech Co.,LTD , https://www.sunveytech.com

Posted on