如何解释DS1852温度和电压读-How to Interp
时间:05-27
来源:互联网
点击:
Abstract: The DS1852 is a digital potentiometer with five analog inputs that can be used in conjunction with the potentiometers to gather feedback information about an analog system, as well as provide analog control functions. Its intended application is to provide a high level of control and instrumentation in a laser transceiver, but it could be used in any sort of control system where this kind of instrumentation and control is required. This application brief discusses the interpretation of the analog input registers in the DS1852. It is intended as a supplement to the data sheet for a software/firmware developer writing code to control the DS1852.
Table 1. Bit weight of digital temperature and masking
The temperature is stored in the 12 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 temperature is positive. If the MSB is 1, then the temperature is negative. The next 11 bits contain the value of the temperature and are translated into decimal differently for positive and negative values.
Table 2. Positive number (MSB = 0) translation
Since the MSB sign bit is 0, the temperature is positive and requires no 2's complement transformation. Therefore, the value can be translated directly into a decimal number using a calculator. The binary number 0011 1100 0101 0000 is equal to the decimal value of 15440. The decimal value must be divided by 256 (or multiplied by 2-8) to calculate the correct decimal temperature value. Dividing the decimal value 15440 by 256 results in a decimal temperature value of 60.3125°C.
Table 3. Negative number (MSB = 1) translation
Introduction
The analog-to-digital converter (ADC) of the DS1852 reads five analog inputs. This application note explains how to interpret the digital values for temperature, VCC, and analog input data and translate them into temperature and voltages.Scaling Calibration
Each analog input (VCC, Bin, Pin, Rin) has a 16-bit scaling value for calibration in table 03h EEPROM. This application note assumes the factory default scaling values are used.Translating Temperature from Hex to Decimal
The procedure for converting temperature values for the DS1852 begins with reading the hex values stored in bytes 60h (the MSB of the temperature) and 61h (the LSB of the temperature). These two bytes contain the most recent temperature reading, however the lower 4 bits are ignored and should be masked with 0's when read. Once the two bytes have been read, translate the hex values into binary. The bit weights and masking of the 4 lower bits are shown in Table 1.Table 1. Bit weight of digital temperature and masking
| 60h (Temperature MSB) | 61h (Temperature LSB) | ||||||||||||||
| S | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 2-1 | 2-2 | 2-3 | 2-4 | 2-5 | 2-6 | 2-7 | 2-8 |
| S | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 2-1 | 2-2 | 2-3 | 2-4 | 0 | 0 | 0 | 0 |
The temperature is stored in the 12 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 temperature is positive. If the MSB is 1, then the temperature is negative. The next 11 bits contain the value of the temperature and are translated into decimal differently for positive and negative values.
Positive Temperature Translation
The following is an example of how to translate a positive temperature value from hex to decimal. In this example, the values in addresses 60h and 61h are read to be 3Ch and 50h, respectively. Combine these two bytes to get the hex value of 3C50h. Next, translate the hex data into binary. The binary equivalent of 3C50h is 0011 1100 0101 0000. Since the MSB is 0, the temperature is positive. The lower 4 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 4 bits.Table 2. Positive number (MSB = 0) translation
| HEXIDECIMAL DATA | BINARY DATA | MASKED BINARY DATA |
| 3C50h | 0011 1100 0101 0000 | 0011 1100 0101 0000 |
Since the MSB sign bit is 0, the temperature is positive and requires no 2's complement transformation. Therefore, the value can be translated directly into a decimal number using a calculator. The binary number 0011 1100 0101 0000 is equal to the decimal value of 15440. The decimal value must be divided by 256 (or multiplied by 2-8) to calculate the correct decimal temperature value. Dividing the decimal value 15440 by 256 results in a decimal temperature value of 60.3125°C.
Negative Temperature Translation
Converting a negative temperature value (MSB = 1) is a little more involved. An example is if addresses 60h and 61h contained the data D3h and 60h. The first step would be to convert the hex values into binary. Again, the lower 4 bits are ignored, so they will be masked with 0s. Table 3 shows the translation from hex to binary and the masking of the 4 lower bits.Table 3. Negative number (MSB = 1) translation
模拟电源 电源管理 模拟器件 模拟电子 模拟 模拟电路 模拟芯片 德州仪器 放大器 ADI 相关文章:
- 采用数字电源还是模拟电源?(01-17)
- 模拟电源管理与数字电源管理(02-05)
- 数字电源正在超越模拟电源(03-19)
- 数字电源PK模拟电源(04-03)
- TI工程师现身说法:采用数字电源还是模拟电源?(10-10)
- 开关电源与模拟电源的分别(05-08)
