数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

MCP9808 数据表(PDF) 25 Page - Microchip Technology

部件名 MCP9808
功能描述  짹0.5째C Maximum Accuracy Digital Temperature Sensor
PDF  52 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  MICROCHIP [Microchip Technology]
网页  http://www.microchip.com
标志 MICROCHIP - Microchip Technology

MCP9808 数据表(HTML) 25 Page - Microchip Technology

Back Button MCP9808 Datasheet HTML 21Page - Microchip Technology MCP9808 Datasheet HTML 22Page - Microchip Technology MCP9808 Datasheet HTML 23Page - Microchip Technology MCP9808 Datasheet HTML 24Page - Microchip Technology MCP9808 Datasheet HTML 25Page - Microchip Technology MCP9808 Datasheet HTML 26Page - Microchip Technology MCP9808 Datasheet HTML 27Page - Microchip Technology MCP9808 Datasheet HTML 28Page - Microchip Technology MCP9808 Datasheet HTML 29Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 25 / 52 page
background image
© 2011 Microchip Technology Inc.
DS25095A-page 25
MCP9808
5.1.3.1
TA Bits to Temperature Conversion
To convert the TA bits to decimal temperature, the
upper three boundary bits (TA<15:13>) must be
masked out. Then, determine the SIGN bit (bit 12) to
check positive or negative temperature, shift the bits
accordingly, and combine the upper and lower bytes of
the 16-bit register. The upper byte contains data for
temperatures greater than +32°C while the lower byte
contains data for temperature less than +32°C, includ-
ing fractional data. When combining the upper and
lower bytes, the upper byte must be right-shifted by
4 bits (or multiply by 24) and the lower byte must be left-
shifted by 4 bits (or multiply by 2-4). Adding the results
of the shifted values provides the temperature data in
decimal format (see Equation 5-1).
The temperature bits are in two’s compliment format,
therefore, positive temperature data and negative tem-
perature data are computed differently. Equation 5-1
shows the temperature computation. The example
instruction code, outlined in Example 5-1, shows the
communication flow; also see Figure 5-5 for the timing
diagram.
EQUATION 5-1:
BYTES TO
TEMPERATURE
CONVERSION
EXAMPLE 5-1:
SAMPLE INSTRUCTION CODE
Where:
TA = Ambient Temperature (°C)
UpperByte = TA bit 15 to bit 8
LowerByte = TA bit 7 to bit 0
Temperature TA ≥ 0°C
Temperature
< 0°C
T
A
UpperByte
2
4
LowerByte
2
4
–
×
+
×
()
=
T
A
256
UpperByte
2
4
LowerByte
2
4
–
×
+
×
()
–
=
i2c_start();
// send START command
i2c_write (AddressByte & 0xFE);
//WRITE Command
(see
Section 4.1.4 “Address Byte”)
//also, make sure bit 0 is cleared ‘0’
i2c_write(0x05);
// Write TA Register Address
i2c_start();
//Repeat START
i2c_write(AddressByte | 0x01);
// READ Command
(see
Section 4.1.4 “Address Byte”)
//also, make sure bit 0 is Set ‘1’
UpperByte = i2c_read(ACK);
// READ 8 bits
//and Send ACK bit
LowerByte = i2c_read(NAK);
// READ 8 bits
//and Send NAK bit
i2c_stop();
// send STOP command
//Convert the temperature data
//First Check flag bits
if ((UpperByte & 0x80) == 0x80){
//TA ³ TCRIT
}
if ((UpperByte & 0x40) == 0x40){
//TA > TUPPER
}
if ((UpperByte & 0x20) == 0x20){
//TA < TLOWER
}
UpperByte = UpperByte & 0x1F;
//Clear flag bits
if ((UpperByte & 0x10) == 0x10){
//TA < 0°C
UpperByte = UpperByte & 0x0F;
//Clear SIGN
Temperature = 256 - (UpperByte x 16 + LowerByte / 16);
}else
//TA
³ 0°C
Temperature = (UpperByte x 16 + LowerByte / 16);
//Temperature = Ambient Temperature (°C)
This example routine assumes the variables and I2C™ communication subroutines are predefined
(see Appendix A: “Source Code”):



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com