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
The next step is to take the 2's complement of the masked binary value. This is done by first inverting the masked binary data and then adding 1 to the LSB. The binary number 1101 0011 0110 0000 converts to 0010 1100 1001 1111. Adding 1 to the LSB results in the binary number 0010 1100 1010 0000. This binary number is equal to the decimal number 11424. Like in the positive temperature example, the translated decimal value is divided by 256, but is also made negative because the temperature is negative as indicated by the MSB. So, the decimal value 11424 is divided by -256, resulting in a decimal temperature value of -44.625°C.
Table 4. VCC bit weights and masking
As an example, the values read from 62h and 63h are found to be D7A0h. Translating this number directly to a decimal value results in a value of 55200, which translates to 5.52V when multiplied by the 100µV scaling factor.
Table 5. Analog input bit weights and masking
As an example, the hex value of 9E70h is read from the two address locations. After masking the 4 lower bits with 0s, the binary value is determined to be 1001 1110 0111 0000. The decimal equivalent is 40560. Multiplying this value by the scaling factor of 38.147µV results in the scaled voltage value of 1.547V.
编辑:神话 引用地址:如何解释DS1852温度和电压读-How to Interp
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
HEXIDECIMAL DATA | BINARY DATA | MASKED BINARY DATA |
D360h | 1101 0011 0110 0000 | 1101 0011 0110 0000 |
The next step is to take the 2's complement of the masked binary value. This is done by first inverting the masked binary data and then adding 1 to the LSB. The binary number 1101 0011 0110 0000 converts to 0010 1100 1001 1111. Adding 1 to the LSB results in the binary number 0010 1100 1010 0000. This binary number is equal to the decimal number 11424. Like in the positive temperature example, the translated decimal value is divided by 256, but is also made negative because the temperature is negative as indicated by the MSB. So, the decimal value 11424 is divided by -256, resulting in a decimal temperature value of -44.625°C.
VCC Translation
The VCC value is stored in address locations 62h and 63h. The voltage data is read as an unsigned 16-bit value, however the lower 4 bits are ignored. When reading 62h and 63h, the lower 4 bits should be masked with 0s. Table 4 shows the bit weights of the VCC data and the masking of the 4 lower bits. With the lower 4 bits masked, the maximum range is 65520, which translates to a voltage range of 0V to 6.552V when it is multiplied by the LSB (scaling factor) of 100µV (factory default).Table 4. VCC bit weights and masking
62h (VCC MSB) | 63h (VCC LSB) | ||||||||||||||
215 | 214 | 213 | 212 | 211 | 210 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
215 | 214 | 213 | 212 | 211 | 210 | 29 | 28 | 27 | 26 | 25 | 24 | 0 | 0 | 0 | 0 |
As an example, the values read from 62h and 63h are found to be D7A0h. Translating this number directly to a decimal value results in a value of 55200, which translates to 5.52V when multiplied by the 100µV scaling factor.
Analog Input (Bin, Pin, Rin) Translations
The analog input pins Bin, Pin, and Rin are unsigned 16-bit numbers, and are translated the same way. Table 5 shows the bit weights of the analog input bytes and the masking of the 4 lower bits. With the lower 4 bits masked, the maximum range is 65520, which translates to a voltage range of 0V to 2.499V when it is multiplied by the LSB (scaling factor) of 38.147µV (factory default).Table 5. Analog input bit weights and masking
64h (Bin MSB) | 65h (Bin LSB) | ||||||||||||||
66h (Pin MSB) | 67h (Pin LSB) | ||||||||||||||
68h (Rin MSB) | 69h (Rin LSB) | ||||||||||||||
215 | 214 | 213 | 212 | 211 | 210 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 |
215 | 214 | 213 | 212 | 211 | 210 | 29 | 28 | 27 | 26 | 25 | 24 | 0 | 0 | 0 | 0 |
As an example, the hex value of 9E70h is read from the two address locations. After masking the 4 lower bits with 0s, the binary value is determined to be 1001 1110 0111 0000. The decimal equivalent is 40560. Multiplying this value by the scaling factor of 38.147µV results in the scaled voltage value of 1.547V.
Conclusion
This application note demonstrates how to translate the hex data stored in the DS1852 into decimal values. Any questions about this document can be directed to the Mixed-Signal Applications Group at MixedSignal.Apps@dalsemi.com MixedSignal.Apps@dalsemi.com.
上一篇:理解集成的ADC-Understanding Integra
下一篇:介绍DS1847用于工业控制-Introduction of
- 热门资源推荐
- 热门放大器推荐
小广播
热门活动
换一批
更多
最新电源管理文章
更多精选电路图
更多热门文章
更多每日新闻
- Allegro MicroSystems 在 2024 年德国慕尼黑电子展上推出先进的磁性和电感式位置感测解决方案
- 左手车钥匙,右手活体检测雷达,UWB上车势在必行!
- 狂飙十年,国产CIS挤上牌桌
- 神盾短刀电池+雷神EM-i超级电混,吉利新能源甩出了两张“王炸”
- 浅谈功能安全之故障(fault),错误(error),失效(failure)
- 智能汽车2.0周期,这几大核心产业链迎来重大机会!
- 美日研发新型电池,宁德时代面临挑战?中国新能源电池产业如何应对?
- Rambus推出业界首款HBM 4控制器IP:背后有哪些技术细节?
- 村田推出高精度汽车用6轴惯性传感器
- 福特获得预充电报警专利 有助于节约成本和应对紧急情况
更多往期活动
11月16日历史上的今天
厂商技术中心