MCP9804T-E/MCBBB [MICROCHIP]
Serial Switch/Digital Sensor, 16 Bit(s), 1Cel, Rectangular, Surface Mount;型号: | MCP9804T-E/MCBBB |
厂家: | MICROCHIP |
描述: | Serial Switch/Digital Sensor, 16 Bit(s), 1Cel, Rectangular, Surface Mount 输出元件 传感器 换能器 |
文件: | 总52页 (文件大小:878K) |
中文: | 中文翻译 | 下载: | 下载PDF数据表文档文件 |
MCP9804
±0.25°C Typical Accuracy Digital Temperature Sensor
Features
General Description
• Accuracy:
Microchip Technology Inc.’s MCP9804 digital
temperature sensor converts temperatures between
-40°C and +125°C to a digital word with ±0.25°C/±1°C
(typical/maximum) accuracy.
- ±0.25°C (typical) from -40°C to +125°C
- ±1°C (maximum) from -40°C to +125°C
- +0.05°C (typical) lifetime drift
The MCP9804 comes with user-programmable registers
that provide flexibility to temperature sensing
applications. The registers allow user-selectable
settings such as Shutdown or Low-Power modes and
the specification of temperature Alert window limits and
critical output limits. When the temperature changes
beyond the specified boundary limits, the MCP9804
outputs anAlert signal. The user has the option of setting
the Alert output signal polarity as an active-low or active-
high comparator output for thermostat operation, or as a
temperature Alert interrupt output for microprocessor-
based systems. The Alert output can also be configured
as a critical temperature output only.
- ±0.0625°C or ±1 LSb (typical) repeatability
• User-Selectable Measurement Resolution:
- +0.5°C, +0.25°C, +0.125°C, +0.0625°C
• User-Programmable Temperature Limits:
- Temperature Window Limit
- Critical Temperature Limit
• User-Programmable Temperature Alert Output
• Operating Voltage Range: 2.7V to 5.5V
• Operating Current: 200 µA (typical)
• Shutdown Current: 0.1 µA (typical)
• 2-wire Interface: I2C™/SMBus Compatible
• Available Packages: 2x3 DFN-8, MSOP-8
This sensor has an industry standard 100 kHz, 2-wire,
SMBus/I2C compatible serial interface, allowing up to
eight or sixteen sensors to be controlled with a single
serial bus (see Table 3-2 for available Address codes).
These features make the MCP9804 ideal for
sophisticated, multi-zone, temperature-monitoring
applications.
Typical Applications
• General Purpose
• Industrial Applications
• Industrial Freezers and Refrigerators
• Food Processing
Package Types
• Personal Computers and Servers
• PC Peripherals
8-Pin 2x3 DFN *
8-Pin MSOP
• Consumer Electronics
• Handheld/Portable Devices
V
SDA 1
8
7
6
5
SDA
SCL
V
DD
1
2
8
7
DD
2
3
4
A0
SCL
A0
EP
9
Temperature Accuracy
A1
A2
Alert
GND
Alert
GND
A1
A2
3
4
6
5
40%
TA = -40°C to +125°C
* Includes Exposed Thermal Pad (EP); see Table 3-1.
VDD = 3.3V
2787 units
30%
20%
10%
0%
Temperature Accuracy (°C)
2009-2018 Microchip Technology Inc.
DS20002203D-page 1
MCP9804
Hysteresis
Shutdown
Critical Trip Lock
Alarm Window Lock
Clear Alert
Alert Status
Output Control
Critical Alert only
Alert Polarity
Alert Comp/Int
Band Gap
Temperature
Sensor
Configuration
Temperature
ADC
T
Limit
Limit
UPPER
T
LOWER
+0.5°C
+0.25°C
T
Limit
CRITICAL
+0.125°C
+0.0625°C
Manufacturer ID
Device ID/Rev
Resolution
Register
Pointer
2
SMBus/Standard I C™
Interface
V
GND
SCL
SDA
A0
Alert
DD
A2
A1
FIGURE 1:
Functional Block Diagram
DS20002203D-page 2
2009-2018 Microchip Technology Inc.
MCP9804
†Notice: Stresses above those listed under “Maximum
ratings” may cause permanent damage to the device. This is
a stress rating only and functional operation of the device at
those or any other conditions above those indicated in the
operational listings of this specification is not implied.
Exposure to maximum rating conditions for extended periods
may affect device reliability.
1.0
ELECTRICAL
CHARACTERISTICS
Absolute Maximum Ratings †
V
.................................................................................. 6.0V
DD
Voltage at All Input/Output Pins .............. GND – 0.3V to 6.0V
Storage Temperature ....................................-65°C to +150°C
Ambient Temperature with Power Applied ....-40°C to +125°C
Junction Temperature (T )...........................................+150°C
J
ESD Protection on All Pins (HBM:MM) ................ (4 kV:400V)
Latch-up Current at Each Pin (25°C) ....................... ±200 mA
TEMPERATURE SENSOR DC CHARACTERISTICS
Electrical Specifications: Unless otherwise indicated, VDD = 2.7V to 5.5V, GND = Ground and
TA = -40°C to +125°C.
Parameters
Sym
Min
Typ
Max Unit
Conditions
Temperature Sensor Accuracy
-40°C < TA +125°C
Accuracy Drift
TACY
TDRIFT
TREPEAT
-1.0
—
±0.25 +1.0 °C VDD = 3.3V (Note 1)
+0.05
—
—
°C VDD = 3.3V (Note 2)
Accuracy Repeatability
Temperature Conversion Time
0.5°C/bit
—
±0.0625
°C 48 hours at 55°C, VDD = 3.3V
tCONV
—
—
—
—
30
65
—
—
—
—
ms 33s/sec (typical)
ms 15s/sec (typical)
ms 7s/sec (typical)
ms 4s/sec (typical)
0.25°C/bit
0.125°C/bit
130
250
0.0625°C/bit
Power Supply
Operating Voltage Range
Operating Current
Shutdown Current
Power-on Reset (POR)
VDD
IDD
2.7
—
—
—
—
—
5.5
V
200
0.1
2.2
-0.1
400 µA
ISHDN
VPOR
°C/VDD
2
µA
V
—
—
Threshold for falling VDD
Power Supply Rejection
°C/V VDD = 2.7V to 5.5V, TA = +25°C
Alert Output (open-drain output, external pull-up resistor required), see Section 5.2.3, Alert Output Configuration
High-Level Current (leakage)
Low-Level Voltage
IOH
—
—
—
—
1
µA VOH = VDD (Active-Low, Pull-up Resistor)
VOL
0.4
V
IOL= 3 mA (Active-Low, Pull-up Resistor)
Thermal Response, from +25°C (air) to +125°C (oil bath)
8L-DFN
tRES
—
—
0.7
1.4
—
—
s
s
Time to 63% (+89°C)
8L-MSOP
Note 1: Accuracy specification includes lifetime drift.
2: Using Accelerated Life Cycle, equivalent of 12 years of operation at 55°C.
2009-2018 Microchip Technology Inc.
DS20002203D-page 3
MCP9804
DIGITAL INPUT/OUTPUT PIN CHARACTERISTICS
Electrical Specifications: Unless otherwise indicated, VDD = 2.7V to 5.5V, GND = Ground and
TA = -40°C to +125°C.
Parameters
Sym
Min
Typ
Max
Units
Conditions
Serial Input/Output (SCL, SDA, A0, A1, A2)
Input
High-Level Voltage
Low-Level Voltage
Input Current
VIH
0.7 VDD
—
—
—
—
—
0.3 VDD
±5
V
V
VIL
IIN
—
µA
Output (SDA)
Low-Level Voltage
High-Level Current (leakage)
Low-Level Current
SDA and SCL Inputs
Hysteresis
VOL
IOH
IOL
—
—
6
—
—
—
0.4
1
V
IOL= 3 mA
µA
mA
VOH = 5.5V
VOL = 0.6V
—
VHYST
tSP
—
—
—
0.05 VDD
—
50
—
V
Spike Suppression
Capacitance
—
5
ns
pF
CIN
GRAPHICAL SYMBOL DESCRIPTION
OUTPUT
INPUT
VDD
Voltage
Voltage
Current
VDD
VIH
VOL
VIL
IOL
Current
IIN
IOH
time
time
TEMPERATURE CHARACTERISTICS
Electrical Specifications: Unless otherwise indicated, VDD = 2.7V to 5.5V and GND = Ground.
Parameters
Temperature Ranges
Sym
Min
Typ
Max
Units
Conditions
Specified Temperature Range
Operating Temperature Range
Storage Temperature Range
Thermal Package Resistances
Thermal Resistance, 8L-DFN
Thermal Resistance, 8L-MSOP
TA
TA
TA
-40
-40
-65
—
—
—
+125
+125
+150
°C
°C
°C
(Note 1)
JA
JA
—
—
41
—
—
°C/W
°C/W
206
Note 1: Operation in this range must not cause TJ to exceed Maximum Junction Temperature (+150°C).
DS20002203D-page 4
2009-2018 Microchip Technology Inc.
MCP9804
SENSOR SERIAL INTERFACE TIMING SPECIFICATIONS
Electrical Specifications: Unless otherwise indicated, VDD= 2.7V to 5.5V, TA = -40°C to +125°C, GND = Ground
and CL = 80 pF (Note 1).
(Note 6)
Parameters
Sym
Min
Max
Min
Max
Units
Conditions
2-Wire SMBus/I2C Interface
Serial port frequency
Low Clock
fSCL
tLOW
0
100
—
0
1300
600
20
400
—
kHz
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ms
pf
(Note 2, Note 4)
(Note 2)
4700
4000
—
High Clock
tHIGH
—
—
(Note 2)
Rise Time
tR
1000
300
—
300
300
—
Fall Time
tF
20
20
Data in Setup Time
Data in Hold Time
Data out Hold Time
Start Condition Setup Time
Start Condition Hold Time
Stop Condition Setup Time
Bus Free
tSU-DI
tHD-DI
tHD-DO
tSU-START
tHD-START
tSU-STOP
tB-FREE
tOUT
250
0
100
0
(Note 3)
(Note 5)
(Note 4)
—
—
300
4700
4000
4000
4700
25
—
200
600
600
600
1300
25
900
—
—
—
—
—
—
—
—
Time-out
50
—
50
Bus Capacitive load
Cb
—
—
400
Note 1: All values referred to VIL MAX and VIH MIN levels.
2: If tLOW > tOUT or tHIGH > tOUT, the temperature sensor I2C interface will time-out. A Repeat Start command
is required for communication.
3: This device can be used in a Standard-mode I2C-bus system, but the requirement tSU:DI MIN must be met.
This device does not stretch SCL Low time.
4: As a transmitter, the device provides internal minimum delay time tHD:DO MIN, to bridge the undefined
region of the falling edge of SCL tF MAX to avoid unintended generation of Start or Stop conditions.
5: As a receiver, SDA should not be sampled at the falling edge of SCL. SDA can transition tHD:DI after SCL
toggles Low.
6: The I2C Fast Mode specification, or timing for bus frequency up to 400KHz, applies to devices starting
with date code of 1145.
TIMING DIAGRAM
tHD-START
tSU-START
tB-FREE
tSU-STOP
tHIGH
tLOW
SCL
SDA
tOUT
tR, tF
tHD-DI/ HD-DO
t
tSU-DI
START Condition
Data Transmission
STOP Condition
2009-2018 Microchip Technology Inc.
DS20002203D-page 5
MCP9804
NOTES:
DS20002203D-page 6
2009-2018 Microchip Technology Inc.
MCP9804
2.0
TYPICAL PERFORMANCE CURVES
Note:
The graphs and tables provided following this note are a statistical summary based on a limited number of
samples and are provided for informational purposes only. The performance characteristics listed herein
are not tested or guaranteed. In some graphs or tables, the data presented may be outside the specified
operating range (e.g., outside specified power supply range) and therefore outside the warranted range.
Note: Unless otherwise indicated, VDD = 2.7V to 5.5V, GND = Ground, SDA/SCL pulled-up to VDD and
TA = -40°C to +125°C.
60%
1.0
TA = +45°C
VDD = 3.3V
722 units
VDD = 3.3V
722 units at -40°C, +45°C, +125°C
64 units at other temperatures
50%
40%
30%
20%
10%
0%
0.5
0.0
+Std. Dev.
Average
-Std. Dev.
-0.5
-1.0
-40 -20
0
20
40
60
80 100 120
TA (°C)
Temperature Accuracy (°C)
FIGURE 2-1:
Temperature Accuracy
FIGURE 2-4:
Temperature Accuracy
Histogram, TA = +45°C
60%
40%
TA = +125°C
TA = -40°C to +125°C
DD = 3.3V
2787 units
V
DD = 3.3V
V
50%
40%
30%
20%
10%
0%
722 units
30%
20%
10%
0%
Temperature Accuracy (°C)
Temperature Accuracy (°C)
FIGURE 2-2:
Histogram, TA = -40°C to +125°C
Temperature Accuracy
FIGURE 2-5:
Histogram, TA = +125°C
Temperature Accuracy
60%
60%
TA = +25°C
TA = -40°C
V
DD = 3.3V
V
DD = 3.3V
50%
40%
30%
20%
10%
0%
50%
40%
30%
20%
10%
0%
64 units
722 units
Temperature Accuracy (°C)
Temperature Accuracy (°C)
FIGURE 2-3:
Histogram, TA = +25°C
Temperature Accuracy
FIGURE 2-6:
Histogram, TA = -40°C
Temperature Accuracy
2009-2018 Microchip Technology Inc.
DS20002203D-page 7
MCP9804
Note: Unless otherwise indicated, VDD = 2.7V to 5.5V, GND = Ground, SDA/SCL pulled-up to VDD and
TA = -40°C to +125°C.
1.00
0.50
400
350
300
250
200
150
100
Δ°C/ΔVDD = 0.1°C/V
VDD = 2.7V
VDD = 3.3V
VDD = 5.5V
0.00
-0.50
-1.00
-40 -20
0
20
40
60
80 100 120
-40 -20
0
20
40
60
80 100 120
Temperature (°C)
Temperature (°C)
FIGURE 2-7:
Supply Current vs.
FIGURE 2-10:
Temperature Accuracy vs.
Temperature
Supply Voltage
2.00
1.50
1.00
0.50
0.00
1.0
Δ°C/ΔVDD, VDD = 3.3V + 150 mVPP (AC)
TA = +25°C
0.5
0.0
-0.5
-1.0
No decoupling capacitor
1
0
1k
10k
100k
1M
100
-40 -20
0
20
40
60
80 100 120
Temperature (°C )
Frequency (Hz)
FIGURE 2-11:
Power Supply Rejection vs.
FIGURE 2-8:
Shutdown Current vs.
Frequency
Temperature
1000
3
2.5
2
0.0625°C
0.125°C
0.25°C
0.5°C
100
10
1.5
1
-40 -20
0
20
40
60
80 100 120
-40 -20
0
20
40
60
80 100 120
Temperature (°C)
Temperature (°C)
FIGURE 2-12:
Temperature Conversion
FIGURE 2-9:
Power-on Reset Threshold
Time vs. Temperature
Voltage vs. Temperature
DS20002203D-page 8
2009-2018 Microchip Technology Inc.
MCP9804
Note: Unless otherwise indicated, VDD = 2.7V to 5.5V, GND = Ground, SDA/SCL pulled-up to VDD and
TA = -40°C to +125°C.
120%
100%
80%
60%
40%
20%
0%
0.4
IOL = 3 mA
0.3
0.2
Alert VOL
SDA VOL
MSOP-8
DFN-8
0.1
0
Room to +125°C (Oil bath)
-40 -20
0
20
40
60
80 100 120
-2
0
2
4
6
8
10 12 14 16
Temperature (°C)
Time (s)
FIGURE 2-13:
SDA and Alert Output VOL
FIGURE 2-15:
Package Thermal Response
vs. Temperature
35
30
25
48
VOL = 0.6V
42
36
30
24
18
12
20
-40 -20
0
20
40
60
80 100 120
6
Temperature (°C)
-40 -20
0
20
40
60
80 100 120
Temperature (°C)
FIGURE 2-16:
SMBus Time-out vs.
FIGURE 2-14:
SDA IOL vs. Temperature
Temperature
2009-2018 Microchip Technology Inc.
DS20002203D-page 9
MCP9804
NOTES:
DS20002203D-page 10
2009-2018 Microchip Technology Inc.
MCP9804
3.0
PIN DESCRIPTION
The descriptions of the pins are listed in Table 3-1.
TABLE 3-1:
DFN
PIN FUNCTION TABLE
MSOP
Symbol
Pin Function
1
2
3
4
5
6
7
8
9
1
2
SDA
SCL
Alert
GND
A2
Serial Data Line
Serial Clock Line
Temperature Alert Output
Ground
3
4
5
Slave Address
Slave Address
Slave Address
Power Pin
6
A1
7
A0
8
VDD
EP
—
Exposed Thermal Pad (EP); must be connected to GND
3.1
Address Pins (A0, A1, A2)
3.4
Serial Clock Line (SCL)
These pins are device address input pins.
The SCL is a clock input pin. All communication and
timing is relative to the signal on this pin. The clock is
generated by the host or master controller on the bus.
(See Section 4.0 “Serial Communication”.)
The address pins correspond to the Least Significant
bits (LSbs) of the address bits and the Most Significant
bits (MSbs): A6, A5, A4, A3. This is shown in Table 3-2.
TABLE 3-2:
Device
MCP9804 ADDRESS BYTE
3.5
Temperature Alert, Open-Drain
Output (Alert)
Address Code
Slave
Address
The MCP9804 temperature Alert output pin is an
open-drain output. The device outputs a signal when the
ambient temperature goes beyond the user-programmed
temperature limit. (See Section 5.2.3 “Alert Output
Configuration”.)
A6 A5 A4 A3 A2 A1 A0
MCP9804
MCP9804(2)
Note 1:
0
1
0
0
1
0
1
1
x(1)
x
x
x
x
x
User-selectable address is shown by
‘x’. A2, A1 and A0 must match the
corresponding device pin configuration.
3.6
Power Pin (V
)
DD
2: Contact factory for this address code.
VDD is the power pin. The operating voltage range, as
specified in the DC electrical specification table, is
applied on this pin.
3.2
Ground Pin (GND)
The GND pin is the system ground pin.
3.7
Exposed Thermal Pad (EP)
There is an internal electrical connection between the
Exposed Thermal Pad (EP) and the GND pin. The EP
may be connected to the system ground on the Printed
Circuit Board (PCB).
3.3
Serial Data Line (SDA)
SDA is a bidirectional input/output pin, used to serially
transmit data to/from the host controller. This pin
requires a pull-up resistor. (See Section 4.0 “Serial
Communication”.)
2009-2018 Microchip Technology Inc.
DS20002203D-page 11
MCP9804
NOTES:
DS20002203D-page 12
2009-2018 Microchip Technology Inc.
MCP9804
4.1.1
DATA TRANSFER
4.0
4.1
SERIAL COMMUNICATION
Data transfers are initiated by a Start condition
(START), followed by a 7-bit device address and a
read/write bit. An Acknowledge (ACK) from the slave
confirms the reception of each byte. Each access must
be terminated by a Stop condition (STOP).
2
2-Wire Standard Mode I C™
Protocol Compatible Interface
The MCP9804 Serial Clock (SCL) input and the
bidirectional Serial Data (SDA) line form a 2-wire
bidirectional, Standard mode, I2C compatible
communication port (refer to the Digital Input/Output
Pin Characteristics and Sensor Serial Interface
Timing Specifications tables).
Repeated communication is initiated after tB-FREE
.
This device does not support sequential register read/
write. Each register needs to be addressed using the
Register Pointer.
This device supports the receive protocol. The register
can be specified using the pointer for the initial read.
Each repeated read or receive begins with a Start
condition and address byte. The MCP9804 retains the
previously selected register. Therefore, it outputs data
from the previously specified register (repeated pointer
specification is not necessary).
The following bus protocol has been defined:
TABLE 4-1:
MCP9804 SERIAL BUS
PROTOCOL DESCRIPTIONS
Term
Description
Master
The device that controls the serial bus,
typically a microcontroller.
4.1.2
MASTER/SLAVE
Slave
The device addressed by the master,
such as the MCP9804.
The bus is controlled by a master device (typically a
microcontroller) that controls the bus access and
generates the Start and Stop conditions. The MCP9804
is a slave device and does not control other devices in
the bus. Both master and slave devices can operate as
either transmitter or receiver. However, the master
device determines which mode is activated.
Transmitter Device sending data to the bus.
Receiver
START
Device receiving data from the bus.
A unique signal from the master to
initiate serial interface with a slave.
STOP
A unique signal from the master to
terminate serial interface from a slave.
4.1.3
START/STOP CONDITION
Read/Write A read or write to the MCP9804
registers.
A high-to-low transition of the SDA line (while SCL is
high) is the Start condition. All data transfers must be
preceded by a Start condition from the master. A
low-to-high transition of the SDA line (while SCL is
high) signifies a Stop condition.
ACK
A receiver Acknowledges (ACK) the
reception of each byte by polling the bus.
NAK
A receiver Not-Acknowledges (NAK) or
releases the bus to show End-of-Data
(EOD).
If a Start or Stop condition is introduced during data
transmission, the MCP9804 releases the bus. All data
transfers are ended by a Stop condition from the
master.
Busy
Communication is not possible
because the bus is in use.
Not Busy
The bus is in the Idle state; both SDA
and SCL remain high.
Data Valid SDA must remain stable before SCL
becomes high in order for a data bit to
be considered valid. During normal
data transfers, SDA only changes state
while SCL is low.
2009-2018 Microchip Technology Inc.
DS20002203D-page 13
MCP9804
4.1.4
ADDRESS BYTE
4.1.5
DATA VALID
Following the Start condition, the host must transmit an
8-bit address byte to the MCP9804. The address for the
MCP9804 temperature sensor is ‘0011,A2,A1,A0’ in
binary, where the A2, A1 and A0 bits are set externally
by connecting the corresponding pins to VDD ‘1’ or GND
‘0’. The 7-bit address, transmitted in the serial bit stream,
must match the selected address for the MCP9804 to
respond with an ACK. Bit 8 in the address byte is a read/
write bit. Setting this bit to ‘1’ commands a read
operation, while ‘0’ commands a write operation (see
Figure 4-1).
After the Start condition, each bit of data in the
transmission needs to be settled for a time specified by
tSU-DATA before SCL toggles from low-to-high (see the
Sensor Serial Interface Timing Specifications section).
4.1.6
ACKNOWLEDGE (ACK/NAK)
Each receiving device, when addressed, must
generate an ACK bit after the reception of each byte.
The master device must generate an extra clock pulse
for ACK to be recognized.
The Acknowledging device pulls down the SDA line for
tSU-DATA before the low-to-high transition of SCL from
the master. SDA also needs to remain pulled down for
Address Byte
t
H-DATA after a high-to-low transition of SCL.
SCL
SDA
1
0
2
0
3
1
4
1
5
6
7
8
9
During read, the master must signal an End-of-Data
(EOD) to the slave by not generating an ACK bit (NAK),
once the last bit has been clocked out of the slave. In
this case, the slave will leave the data line released to
enable the master to generate the Stop condition.
A
C
K
A2 A1 A0
Start
Slave
Address
Code
R/W
Address
4.1.7
TIME-OUT
MCP9804 Response
If the SCL stays low or high for the time specified by
tOUT, the MCP9804 temperature sensor resets the
serial interface. This dictates the minimum clock speed
as outlined in the specification.
See Table 3-2.
FIGURE 4-1:
Device Addressing
DS20002203D-page 14
2009-2018 Microchip Technology Inc.
MCP9804
5.0
FUNCTIONAL DESCRIPTION
The MCP9804 temperature sensors consist of a band-
gap-type temperature sensor, a Delta-Sigma Analog-to-
Digital Converter ( ADC), user-programmable
registers and a 2-wire SMBus/I2C protocol compatible
serial interface. Figure 5-1 shows a block diagram of
the register structure.
Hysteresis
Shutdown
Critical Trip Lock
Alarm Win. Lock
Clear Alert
Alert Status
Output Control
Critical Alert Only
Alert Polarity
Alert Comp/Int
Band Gap
Temperature
Sensor
Configuration
Temperature
ADC
T
Limit
Limit
UPPER
T
T
LOWER
+0.5°C
+0.25°C
Limit
CRITICAL
+0.125°C
+0.0625°C
Manufacturer ID
Device ID/Rev
Resolution
Register
Pointer
2
SMBus/Standard I C™
Interface
V
DD
GND
SCL
SDA
A0
Alert
A2
A1
FIGURE 5-1:
Functional Block Diagram
2009-2018 Microchip Technology Inc.
DS20002203D-page 15
MCP9804
Section 5.2.3 “Alert Output Configuration”). In
addition, the Critical Temperature Limit register is used
to provide an additional critical temperature limit.
5.1
Registers
The MCP9804 has several registers that are
user-accessible. These registers include Temperature,
Configuration, Temperature Alert Upper Boundary and
Lower Boundary Limit, Critical Temperature Limit, Man-
ufacturer Identification and Device Identification.
The Configuration register provides access to
configure the MCP9804 device’s various features.
These registers are described in further detail in the
following sections.
The Temperature register is read-only, used to access
the ambient temperature data. This register is double-
buffered and it is updated every tCONV. The Temperature
Alert Upper Boundary and Lower Boundary Limit
registers are read/write registers. If the ambient
temperature drifts beyond the user-specified limits, the
MCP9804 outputs a signal using the Alert pin (refer to
The registers are accessed by sending a Register
Pointer to the MCP9804, using the serial interface. This
is an 8-bit write-only pointer. However, the four Least
Significant bits are used as pointers and all unused bits
(Register Pointer<7:4>) need to be cleared or set to ‘0’.
Register 5-1 describes the pointer or the address of
each register.
REGISTER 5-1:
REGISTER POINTER (WRITE-ONLY)
W-0
—
W-0
—
W-0
—
W-0
—
W-0
W-0
W-0
W-0
Pointer bits
bit 7
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
bit 7-4
bit 3-0
W: Writable bits
Write ‘0’.
Bits 7-4 must always be cleared or written to ‘0’. This device has additional registers that are reserved
for test and calibration. If these registers are accessed, the device may not perform according to the
specification.
Pointer bits
0000=RFU, Reserved for Future Use (Read-Only register)
0001=Configuration register (CONFIG)
0010=Alert Temperature Upper Boundary Trip register (TUPPER
)
0011=Alert Temperature Lower Boundary Trip register (TLOWER
)
0100=Critical Temperature Trip register (TCRIT
0101=Temperature register (TA)
0110=Manufacturer ID register
0111=Device ID/Revision register
1000=Resolution register
)
1xxx=Reserved(1)
Note 1: Some registers contain calibration codes and should not be accessed.
DS20002203D-page 16
2009-2018 Microchip Technology Inc.
MCP9804
TABLE 5-1:
BIT ASSIGNMENT SUMMARY FOR ALL REGISTERS (See Section 5.3, Summary of
Power-on Default for Power-on Defaults)
Register
Pointer
(Hex)
Bit Assignment
MSB/
LSB
7
6
5
4
3
2
1
0
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
0x08
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
LSB
0
0
0
0
1
0
0
1
0
1
0
0
0
0
0
1
0
1
0
Crt Loc
0
0
Win Loc
0
0
Hysteresis
SHDN
Int Clr
0
Alt Stat
SIGN
Alt Cnt
Alt Sel
Alt Pol
Alt Mod
7
6
5
4
2 °C
2 °C
2 °C
2 °C
3
2
1
0
-1
-2
2 °C
2 °C
2 °C
2 °C
2 °C
2 °C
0
0
7
6
5
4
0
0
0
SIGN
2 °C
2 °C
2 °C
2 °C
3
2
1
0
-1
-2
2 °C
2 °C
2 °C
2 °C
2 °C
2 °C
0
0
7
6
5
4
0
0
0
SIGN
2 °C
2 °C
2 °C
2 °C
3
2
1
0
-1
-2
2 °C
2 °C
2 °C
2 °C
2 °C
2 °C
0
0
7
6
5
4
T
T
T
T
T
T
LOWER
SIGN
2 °C
2 °C
2 °C
2 °C
A
CRIT
A
UPPER
A
3
2
1
0
-1
-2
2 °C
2 °C
2 °C
2 °C
2 °C
2 °C
0
0
0
1
0
1
0
0
0
0
1
1
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
2009-2018 Microchip Technology Inc.
DS20002203D-page 17
MCP9804
user-specified
temperature
boundary
(see
5.1.1
SENSOR CONFIGURATION
REGISTER (CONFIG)
Section 5.2.2 “Temperature Hysteresis (THYST)”.
The Continuous Conversion or Shutdown mode is
selected using bit 8. In Shutdown mode, the band gap
The MCP9804 has a 16-bit Configuration register
(CONFIG) that allows the user to set various functions for
a robust temperature monitoring system. Bits 10 through
0 are used to select the temperature alert output
hysteresis, device shutdown or Low-Power mode,
temperature boundary and critical temperature lock, and
temperature Alert output enable/disable. In addition, Alert
output condition (output set for TUPPER and TLOWER
temperature boundary or TCRIT only), Alert output status
and Alert output polarity and mode (Comparator Output
or Interrupt Output mode) are user-configurable.
temperature sensor
circuit
stops converting
temperature and the Ambient Temperature register
(TA) holds the previous temperature data (see
Section 5.2.1 “Shutdown Mode”). Bits 7 and 6 are
used to lock the user-specified boundaries TUPPER
,
TLOWER and TCRIT to prevent an accidental rewrite.
The Lock bits are cleared by resetting the power. Bits 5
through 0 are used to configure the temperature Alert
output pin. All functions are described in Register 5-2
(see Section 5.2.3 “Alert Output Configuration”).
The temperature hysteresis bits 10 and 9 can be used
to prevent output chatter when the ambient
temperature
gradually
changes
beyond
the
REGISTER 5-2:
CONFIG: CONFIGURATION REGISTER ( ADDRESS ‘0000 0001’b)
U-0
—
U-0
—
U-0
—
U-0
—
U-0
—
R/W-0
R/W-0
R/W-0
R/W-0
SHDN
THYST
bit 15
bit 8
R/W-0
Crit. Lock
bit 7
R/W-0
R/W-0
R-0
R/W-0
R/W-0
R/W-0
Win. Lock
Int. Clear
Alert Stat.
Alert Cnt.
Alert Sel.
Alert Pol.
Alert Mod.
bit 0
Legend:
R = Readable bit
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
-n = Value at POR
bit 15-11
bit 10-9
Unimplemented: Read as ‘0’
THYST: TUPPER and TLOWER Limit Hysteresis bits
00=0°C (power-up default)
01=+1.5°C
10=+3.0°C
11=+6.0°C
(Refer to Section 5.2.3 “Alert Output Configuration”.)
This bit cannot be altered when either of the Lock bits are set (bit 6 and bit 7).
This bit can be programmed in Shutdown mode.
SHDN: Shutdown Mode bit
bit 8
0= Continuous conversion (power-up default)
1= Shutdown (Low-Power mode)
In shutdown, all power-consuming activities are disabled, though all registers can be written to or read.
This bit cannot be set to ‘1’ when either of the Lock bits is set (bit 6 and bit 7). However, it can be
cleared to ‘0’ for continuous conversion while locked (refer to Section 5.2.1 “Shutdown Mode”).
DS20002203D-page 18
2009-2018 Microchip Technology Inc.
MCP9804
REGISTER 5-2:
bit 7
CONFIG: CONFIGURATION REGISTER ( ADDRESS ‘0000 0001’b)
Crit. Lock: TCRIT Lock bit
0= Unlocked. TCRIT register can be written (power-up default)
1= Locked. TCRIT register cannot be written
When enabled, this bit remains set to ‘1’ or locked until cleared by an internal Reset (Section 5.3
“Summary of Power-on Default”). This bit does not require a double-write.
This bit can be programmed in Shutdown mode.
bit 6
Win. Lock: TUPPER and TLOWER Window Lock bit
0= Unlocked; TUPPER and TLOWER registers can be written (power-up default)
1= Locked; TUPPER and TLOWER registers cannot be written
When enabled, this bit remains set to ‘1’ or locked until cleared by a Power-on Reset (Section 5.3
“Summary of Power-on Default”). This bit does not require a double-write.
This bit can be programmed in Shutdown mode.
bit 5
bit 4
Int. Clear: Interrupt Clear bit
0= No effect (power-up default)
1= Clear interrupt output; when read, this bit returns to ‘0’
This bit cannot be set to ‘1’ in Shutdown mode, but it can be cleared after the device enters Shutdown
mode.
Alert Stat.: Alert Output Status bit
0= Alert output is not asserted by the device (power-up default)
1= Alert output is asserted as a comparator/Interrupt or critical temperature output
This bit cannot be set to ‘1’ or cleared to ‘0’ in Shutdown mode. However, if the Alert output is
configured as Interrupt mode, and if the host controller clears to ‘0’, the interrupt, using bit 5 while the
device is in Shutdown mode, then this bit will also be cleared ‘0’.
bit 3
bit 2
bit 1
bit 0
Alert Cnt.: Alert Output Control bit
0= Disabled (power-up default)
1= Enabled
This bit cannot be altered when either of the Lock bits are set (bit 6 and bit 7).
This bit can be programmed in Shutdown mode, but the Alert output will not assert or deassert.
Alert Sel.: Alert Output Select bit
0= Alert output for TUPPER, TLOWER and TCRIT (power-up default)
1= TA > TCRIT only (TUPPER and TLOWER temperature boundaries are disabled)
When the Alarm Window Lock bit is set, this bit cannot be altered until unlocked (bit 6).
This bit can be programmed in Shutdown mode, but the Alert output will not assert or deassert.
Alert Pol.: Alert Output Polarity bit
0= Active-low (power-up default; pull-up resistor required)
1= Active-high
This bit cannot be altered when either of the Lock bits are set (bit 6 and bit 7).
This bit can be programmed in Shutdown mode, but the Alert output will not assert or deassert.
Alert Mod.: Alert Output Mode bit
0= Comparator output (power-up default)
1= Interrupt output
This bit cannot be altered when either of the Lock bits are set (bit 6 and bit 7).
This bit can be programmed in Shutdown mode, but the Alert output will not assert or deassert.
2009-2018 Microchip Technology Inc.
DS20002203D-page 19
MCP9804
Writing to the CONFIG Register to Enable the Event Output Pin <0000 0000 0000 1000>b:
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
SCL
SDA
A
C
K
A
C
K
A
2
A
1
A
0
S
0
0
1
1
W
0
0
0
0
0
0
0
1
Address Byte
Configuration Pointer
MCP9804 MCP9804
1
0
2
3
0
4
0
5
0
6
0
7
0
8
0
1
0
2
0
3
0
4
0
5
1
6
0
7
0
8
0
A
C
K
A
C
K
0
P
MSB Data
LSB Data
MCP9804
MCP9804
Note: This is an example routine (see Appendix A: “Source Code”).
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(0x01);
i2c_write(0x00);
i2c_write(0x08);
i2c_stop();
// Write CONFIG Register
// Write data
// Write data
// send STOP command
FIGURE 5-2:
Timing Diagram for Writing to the Configuration Register (see Section 4.0 “Serial
Communication”)
DS20002203D-page 20
2009-2018 Microchip Technology Inc.
MCP9804
Reading the CONFIG Register:
1
2
3
4
5
6
7
8
1
0
2
0
3
0
4
0
5
0
6
0
7
0
8
1
Note:
It is not necessary to
select the Register
Pointer if it was set
from the previous
read/write.
SCL
SDA
A
C
K
A
C
K
A
2
A
1
A
0
S
0
0
1
1
W
Address Byte
Configuration Pointer
MCP9804 MCP9804
1
0
2
0
3
1
4
1
5
6
7
8
1
2
3
4
5
6
7
8
1
2
0
3
0
4
0
5
1
6
0
7
0
8
0
SCL
SDA
A
C
K
A
C
K
N
A
K
A
2
A
1
A
0
0
0
0
0
0
S
R
0
0
0
0
P
Address Byte
MSB Data
LSB Data
Master
Master
MCP9804
Note: This is an example routine (see Appendix A: “Source Code”).
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(0x01);
// Write CONFIG Register
// send Repeat START command
//READ Command
i2c_start();
i2c_write(AddressByte | 0x01);
//also, make sure bit 0 is set ‘1’
UpperByte = i2c_read(ACK);
//and Send ACK bit
// READ 8 bits
LowerByte = i2c_read(NAK);
//and Send NAK bit
// READ 8 bits
i2c_stop();
// send STOP command
FIGURE 5-3:
Timing Diagram for Reading from the Configuration Register (see Section 4.0 “Serial
Communication”)
2009-2018 Microchip Technology Inc.
DS20002203D-page 21
MCP9804
the maximum and minimum temperature boundary or
temperature window that can be used to monitor
ambient temperature. If this feature is enabled
(Section 5.1.1 “Sensor Configuration Register
(CONFIG)”) and the ambient temperature exceeds the
specified boundary or window, the MCP9804 asserts an
Alert output. (Refer to Section 5.2.3 “Alert Output
Configuration”).
5.1.2
UPPER/LOWER/CRITICAL
TEMPERATURE LIMIT REGISTERS
(TUPPER/TLOWER/TCRIT
)
The MCP9804 has a 16-bit read/write Alert Output
Temperature Upper Boundary register (TUPPER), a 16-bit
Lower Boundary register (TLOWER) and a 16-bit Critical
Boundary register (TCRIT) that contain 11-bit data in
two’s complement format (0.25°C). This data represents
REGISTER 5-3:
TUPPER/TLOWER/TCRIT: UPPER/LOWER/CRITICAL TEMPERATURE LIMIT
REGISTER
( ADDRESS ‘0000 0010’b/‘0000 0011’b/‘0000 0100’b)(1)
U-0
—
U-0
—
U-0
—
R/W-0
Sign
R/W-0
27°C
R/W-0
26°C
R/W-0
25°C
R/W-0
24°C
bit 15
bit 8
R/W-0
23°C
R/W-0
22°C
R/W-0
21°C
R/W-0
20°C
R/W-0
2-1°C
R/W-0
2-2°C
U-0
—
U-0
—
bit 7
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
bit 15-13
bit 12
Unimplemented: Read as ‘0’
Sign: Sign bit
0= TA 0°C
1= TA 0°C
bit 11-2
bit 1-0
TUPPER/TLOWER/TCRIT: Temperature Boundary bits
Temperature boundary trip data in two’s complement format.
Unimplemented: Read as ‘0’
Note 1: This table shows two 16-bit registers for TUPPER, TLOWER and TCRIT, located at ‘0000 0010b’,
‘0000 0011b’ and ‘0000 0100b’, respectively.
DS20002203D-page 22
2009-2018 Microchip Technology Inc.
MCP9804
Writing +90°C to the TUPPER Register <0000 0101 1010 0000>b:
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
SCL
SDA
A
C
K
A
C
K
A
2
A
1
A
0
S
0
0
1
1
W
0
0
0
0
0
0
1
0
Address Byte
T
Pointer
UPPER
MCP9804
MCP9804
1
0
2
3
0
4
0
5
0
6
1
7
0
8
1
1
2
3
1
4
0
5
0
6
0
7
0
8
A
A
C
1
C
0
P
0
0
K
K
MSB Data
LSB Data
MCP9804
MCP9804
Reading from the TUPPER Register:
1
2
3
4
5
6
7
8
1
0
2
0
3
0
4
0
5
6
0
7
1
8
0
Note:
It is not necessary to
select the Register
Pointer if it was set
from the previous
read/write.
SCL
SDA
A
A
C
K
A
2
A
1
A
0
C
S
0
0
1
1
0
W
K
Address Byte
TUPPER Pointer
MCP9804
MCP9804
1
0
2
0
3
1
4
1
5
6
7
8
1
2
0
3
0
4
0
5
0
6
1
7
0
8
1
2
0
3
1
4
0
5
6
0
7
0
8
0
SCL
SDA
A
C
K
A
C
K
N
A
K
A
2
A
1
A
0
0
1
1
0
S
R
P
Address Byte
MSB Data
LSB Data
Master
Master
MCP9804
FIGURE 5-4:
Timing Diagram for Writing and Reading from the TUPPER Register (see Section 4.0
“Serial Communication”)
2009-2018 Microchip Technology Inc.
DS20002203D-page 23
MCP9804
In addition, the TA register uses three bits (TA<15:13>)
to reflect the Alert pin state. This allows the user to
identify the cause of the Alert output trigger (see
Section 5.2.3 “Alert Output Configuration”); bit 15 is
set to ‘1’ if TA is greater than or equal to TCRIT, bit 14 is
set to ‘1’ if TA is greater than TUPPER and bit 13 is set to
5.1.3
AMBIENT TEMPERATURE
REGISTER (TA)
The MCP9804 uses a band gap temperature sensor
circuit to output analog voltage proportional to absolute
temperature. An internal ADC is used to convert the
analog voltage to a digital word. The digital word is
loaded to a 16-bit read-only Ambient Temperature
register (TA) that contains 13-bit temperature data in
two’s complement format.
‘1’ if TA is less than TLOWER
.
The TA register bit assignment and boundary
conditions are described in Register 5-4.
The TA register bits (TA<12:0>) are double-buffered.
Therefore, the user can access the register, while in the
background, the MCP9804 performs an Analog-to-
Digital conversion. The temperature data from the
ADC is loaded in parallel to the TA register at tCONV
refresh rate.
REGISTER 5-4:
TA: AMBIENT TEMPERATURE REGISTER ( ADDRESS ‘0000 0101’b)(1)
R-0
R-0
R-0
R-0
R-0
R-0
R-0
R-0
(1)
(1)
(1)
TA vs. TCRIT
bit 15
TA vs. TUPPER
TA vs. TLOWER
SIGN
27 °C
26 °C
25 °C
24 °C
bit 8
R-0
23 °C
R-0
22 °C
R-0
21 °C
R-0
20 °C
R-0
2-1 °C
R-0
2-2 °C(2)
R-0
2-3 °C(2)
R-0
2-4 °C(2)
bit 7
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
bit 15
bit 14
bit 13
bit 12
bit 11-0
TA vs. TCRIT bit(1)
0 = TA TCRIT
1 = TA TCRIT
TA vs. TUPPER bit(1)
0= TA TUPPER
1= TA TUPPER
TA vs. TLOWER bit(1)
0= TA TLOWER
1= TA TLOWER
SIGN bit
0= TA 0°C
1= TA 0°C
TA: Ambient Temperature bits(2)
12-bit ambient temperature data in two’s complement format.
Note 1: Bits 15, 14 and 13 are not affected by the status of the Alert Output Configuration (CONFIG<5:0> bits,
Register 5-2).
2: Bits 2, 1 and 0 may remain clear at ‘0’ depending on the status of the Resolution register (Register 5-7).
The power-up default is 0.25°C/bit; bits 1 and 0 remain clear ‘0’.
DS20002203D-page 24
2009-2018 Microchip Technology Inc.
MCP9804
instruction code, outlined in Example 5-1, shows the
communication flow; also see Figure 5-5 for the timing
diagram.
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).
EQUATION 5-1:
BYTES TO
TEMPERATURE
CONVERSION
Temperature TA 0°C
= UpperByte 2 + LowerByte 2
4
–4
T
A
Temperature 0°C
= 256 – UpperByte 2 + LowerByte 2
4
–4
T
A
Where:
TA = Ambient Temperature (°C)
UpperByte = TA bit 15 to bit 8
LowerByte = TA bit 7 to bit 0
The temperature bits are in two’s complement format,
therefore, positive temperature data and negative tem-
perature data are computed differently. Equation 5-1
shows the temperature computation. The example
EXAMPLE 5-1:
SAMPLE INSTRUCTION CODE
2
This example routine assumes the variables and I C™ communication subroutines are predefined
(see Appendix A: “Source Code”):
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 T Register Address
A
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);
//and Send ACK bit
// READ 8 bits
LowerByte = i2c_read(NAK);
//and Send NAK bit
// READ 8 bits
i2c_stop();
// send STOP command
//Convert the temperature data
//First Check flag bits
if ((UpperByte & 0x80) == 0x80){
}
//T T
A
CRIT
if ((UpperByte & 0x40) == 0x40){
}
//T > T
A
UPPER
LOWER
if ((UpperByte & 0x20) == 0x20){
}
//T < T
A
UpperByte = UpperByte & 0x1F;
if ((UpperByte & 0x10) == 0x10){
//Clear flag bits
//T < 0°C
A
UpperByte = UpperByte & 0x0F;//Clear SIGN
Temperature = 256 - (UpperByte x 16 + LowerByte / 16);
}else
Temperature = (UpperByte x 16 + LowerByte / 16);
//Temperature = Ambient Temperature (°C)
//T
0°C
A
2009-2018 Microchip Technology Inc.
DS20002203D-page 25
MCP9804
1
2
3
4
1
5
6
7
8
1
0
2
0
3
0
4
0
5
0
6
1
7
0
8
1
Note:
It is not necessary to
select the Register
Pointer if it was set from
the previous read/write.
SCL
SDA
A
C
K
A
C
K
A
2
A
1
A
0
S
0
0
1
W
Address Byte
TA Pointer
MCP9804
MCP9804
1
2
3
1
4
1
5
6
7
8
1
0
2
3
0
4
0
5
0
6
0
7
0
8
1
1
1
2
0
3
0
4
1
5
0
6
1
7
0
8
0
SCL
SDA
A
C
K
A
C
K
N
A
K
A
2
A
1
A
0
0
S
0
0
P
R
Address Byte
MSB Data
LSB Data
Master
MCP9804
Master
FIGURE 5-5:
Timing Diagram for Reading +25.25°C Temperature from the TA Register (see
Section 4.0 “Serial Communication”)
DS20002203D-page 26
2009-2018 Microchip Technology Inc.
MCP9804
5.1.4
MANUFACTURER ID REGISTER
This register is used to identify the manufacturer of the
device in order to perform manufacturer-specific
operations. The Manufacturer ID for the MCP9804 is
0x0054 (hexadecimal).
REGISTER 5-5:
MANUFACTURER ID REGISTER – READ-ONLY ( ADDRESS ‘0000 0110’b)
R-0
R-0
R-0
R-0
R-0
R-0
R-0
R-0
Manufacturer ID
bit 15
R-0
bit 8
bit 0
R-1
R-0
R-1
R-0
R-1
R-0
R-0
Manufacturer ID
bit 7
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
bit 15-0
Device Manufacturer Identification bits
1
0
2
0
3
1
4
1
5
6
7
8
1
0
2
0
3
0
4
0
5
0
6
1
7
1
8
0
Note:
It is not necessary to
select the Register
Pointer if it was set
from the previous
read/write.
SCL
SDA
A
C
K
A
C
K
A
2
A
1
A
0
S
W
Address Byte
Manufacturer ID Pointer
MCP9804
MCP9804
1
0
2
0
3
1
4
1
5
6
7
8
1
0
2
0
3
0
4
0
5
0
6
0
7
0
8
0
1
0
2
1
3
0
4
1
5
0
6
1
7
0
8
0
SCL
SDA
A
C
K
A
C
K
N
A
K
A
2
A
1
A
0
S
R
P
Address Byte
MSB Data
LSB Data
Master
Master
MCP9804
FIGURE 5-6:
Timing Diagram for Reading the Manufacturer ID Register (see Section 4.0 “Serial
Communication”)
2009-2018 Microchip Technology Inc.
DS20002203D-page 27
MCP9804
5.1.5
DEVICE ID AND REVISION
REGISTER
The upper byte of this register is used to specify the
device identification and the lower byte is used to
specify the device revision. The Device ID for the
MCP9804 is 0x02 (hex).
The revision begins with 0x00 (hex) for the first release,
with the number being incremented as revised versions
are released.
REGISTER 5-6:
DEVICE ID AND DEVICE REVISION – READ-ONLY ( ADDRESS ‘0000 0111’b)
R-0
R-0
R-0
R-0
R-0
R-0
R-1
R-0
Device ID
bit 15
R-0
bit 8
bit 0
R-0
R-0
R-0
R-0
R-0
R-0
R-1
Device Revision
bit 7
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
bit 15-8
bit 7-0
Device ID: Bit 15 to bit 8 are used for device ID
Device Revision: Bit 7 to bit 0 are used for device revision
1
0
2
0
3
1
4
1
5
6
7
8
1
0
2
0
3
0
4
0
5
0
6
1
7
1
8
1
Note:
It is not necessary to
select the Register
Pointer if it was set
from the previous
read/write.
SCL
SDA
A
C
K
A
C
K
A
2
A
1
A
0
S
W
Address Byte
Device ID Pointer
MCP9804
MCP9804
1
0
2
0
3
1
4
1
5
6
7
8
1
2
0
3
0
4
0
5
0
6
0
7
1
8
1
2
0
3
0
4
5
0
6
0
7
0
8
0
SCL
SDA
A
C
K
A
C
K
N
A
K
A
2
A
1
A
0
0
0
S
R
0
0
P
Address Byte
MSB Data
LSB Data
Master
Master
MCP9804
FIGURE 5-7:
Timing Diagram for Reading Device ID and Device Revision Register (see
Section 4.0 “Serial Communication”)
DS20002203D-page 28
2009-2018 Microchip Technology Inc.
MCP9804
5.1.6
This register allows the user to change the sensor
resolution (see Section 5.2.4 “Temperature
RESOLUTION REGISTER
Resolution”). The POR default resolution is
+0.0625°C. The selected resolution is also reflected in
the Capability register (see Register 5-2).
REGISTER 5-7:
RESOLUTION REGISTER ( ADDRESS ‘0000 1000’b)
U-0
—
U-0
—
U-0
—
U-0
—
U-0
—
U-0
—
R/W-1
R/W-1
Resolution
bit 7
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared x = Bit is unknown
bit 7-2
bit 1-0
Unimplemented: Read as ‘0’
Resolution bits
00=LSB = +0.5°C (tCONV = 30 ms typical)
01=LSB = +0.25°C (tCONV = 65 ms typical)
10=LSB = +0.125°C (tCONV = 130 ms typical)
11=LSB = +0.0625°C (power-up default, tCONV = 250 ms typical)
1
0
2
0
3
1
4
1
5
6
7
8
1
0
2
0
3
0
4
0
5
1
6
0
7
8
0
1
0
2
0
3
0
4
0
5
0
6
0
7
8
1
SCL
A
C
K
A
C
K
A
C
K
A
2
A
1
A
0
S
W
0
SDA
1
P
Address Byte
Resolution Pointer
Data
MCP9804
MCP9804
MCP9804
FIGURE 5-8:
Timing Diagram for Changing TA Resolution to +0.0625°C <0000 0011>b (see
Section 4.0 “Serial Communication”)
2009-2018 Microchip Technology Inc.
DS20002203D-page 29
MCP9804
5.2
SENSOR FEATURE DESCRIPTION
VDD
5.2.1
SHUTDOWN MODE
MCP9804
Shutdown mode disables all power consuming
activities (including temperature sampling operations)
while leaving the serial interface active. This mode is
selected by setting bit 8 of CONFIG to ‘1’. In this mode,
the device consumes ISHDN. It remains in this mode
until bit 8 is cleared to ‘0’ to enable Continuous
Conversion mode or until power is recycled.
RPU
Alert Output
The Shutdown bit (bit 8) cannot be set to ‘1’ while the
CONFIG<7:6> bits (Lock bits) are set to ‘1’. However, it
can be cleared to ‘0’ or returned to Continuous
Conversion mode while locked.
FIGURE 5-9:
Configuration.
Active-Low Alert Output
The status of the Alert output can be read using
CONFIG<4> (Alert Output Status bit). This bit cannot
be set to ‘1’ in Shutdown mode.
In Shutdown mode, all registers can be read or written.
However, the serial bus activity increases the shutdown
current. In addition, if the device is in shutdown while
the Alert pin is asserted, the device will retain the active
state during shutdown. This increases the shutdown
current due to the additional Alert output current.
Bits 7 and 6 of the CONFIG register can be used to lock
the TUPPER, TLOWER and TCRIT registers. These bits
prevent false triggers at the Alert output due to an
accidental rewrite to these registers.
The Alert output can also be used as a critical tempera-
ture output using bit 2 of CONFIG (Alert Output Select
bit). When this feature is selected, the Alert output
becomes a comparator output. In this mode, the
interrupt output configuration (Alert Output Mode bit,
CONFIG<0>) is ignored.
5.2.2
TEMPERATURE HYSTERESIS
(THYST
)
A hysteresis of 0°C, +1.5°C, +3°C or +6°C can be
selected for the TUPPER, TLOWER and TCRIT temperate
boundaries, using bits 10 and 9 of CONFIG. The
hysteresis applies for decreasing temperature only (hot
to cold) or as temperature drifts below the specified
limit.
5.2.3.1
Comparator Mode
Comparator mode is selected using bit 0 of CONFIG. In
this mode, the Alert output is asserted as active-high or
active-low, using bit 1 of CONFIG. Figure 5-10 shows
the conditions that toggle the Alert output.
The Hysteresis bits cannot be changed if either of the
Lock bits (CONFIG<7:6) are set to ‘1’.
The TUPPER, TLOWER and TCRIT boundary conditions
are described graphically in Figure 5-10.
If the device enters Shutdown mode with asserted Alert
output, the output remains asserted during Shutdown
mode. The device must be operating in Continuous
5.2.3
ALERT OUTPUT CONFIGURATION
Conversion mode for tCONV. The TA vs. TUPPER
,
The Alert output can be enabled by using bit 3 of the
CONFIG register (Alert Output Control bit) and can be
configured as either a comparator output or as an Inter-
rupt Output mode using bit 0 of CONFIG (Alert Output
Mode bit). The polarity can also be specified as active-
high or active-low using bit 1 of CONFIG (Alert Polarity
bit). This is an open-drain output and requires a pull-up
resistor.
TLOWER and TCRIT boundary conditions need to be
satisfied in order for the Alert output to deassert.
Comparator mode is useful for thermostat type
applications, such as turning on a cooling fan or
triggering a system shutdown when the temperature
exceeds a safe operating range.
When the ambient temperature increases above the
critical temperature limit, the Alert output is forced to a
comparator output (regardless of CONFIG<0>). When
the temperature drifts below the critical temperature
limit minus hysteresis, the Alert output automatically
returns to the state specified by CONFIG<0> bit.
DS20002203D-page 30
2009-2018 Microchip Technology Inc.
MCP9804
5.2.3.2
Interrupt Mode
5.2.4
TEMPERATURE RESOLUTION
In Interrupt mode, the Alert output is asserted as active-
high or active-low (depending on the polarity
configuration) when TA drifts above or below TUPPER
and TLOWER limits. The output is deasserted by setting
bit 5 (Interrupt Clear bit) of CONFIG. Shutting down the
device will not reset or deassert the Alert output. This
mode cannot be selected when the Alert output is used
as a critical temperature output only, using bit 2 of
CONFIG.
The MCP9804 is capable of providing temperature
data with +0.5°C to +0.0625°C resolution. The resolu-
tion can be selected using the Resolution register
(Register 5-7). It is located at address, ‘00001000’b,
and it provides measurement flexibility. A +0.0625°C
resolution is set as a POR default by the factory.
TABLE 5-2:
TEMPERATURE
CONVERSION TIME
tCONV
(ms)
Samples/sec
(typical)
This mode is designed for interrupt driven
microcontroller-based systems. The microcontroller
receiving the interrupt will have to Acknowledge the
interrupt by setting bit 5 of the CONFIG register from the
MCP9804.
Resolution
+0.5°C
+0.25°C
+0.125°C
30
65
33
15
7
130
250
+0.0625°C
4
(Power-up Default)
2009-2018 Microchip Technology Inc.
DS20002203D-page 31
MCP9804
TCRIT – THYST
TUPPER – THYST
TCRIT
TUPPER – THYST
TUPPER
TA
TLOWER – THYST
TLOWER
TLOWER – THYST
Comparator
Interrupt
S/w Int. Clear
Critical Only
Comparator
Interrupt
S/w Int. Clear
Critical Only
Notes: 1
2
1
3
4
3 5 6
7
4
2
Comparator Interrupt
Critical
TA Bits
14
Alert Output Boundary
Conditions
Notes
Alert Output (Active-Low/High)
15
13
1
2
3
4
5
6
TA TLOWER
High/Low
Low/High
Low/High
High/Low
Low/High
Low/High
Low/High
Low/High
Low/High
Low/High
High/Low
High/Low
High/Low
High/Low
Low/High
0
0
0
0
1
0
0
1
0
1
0
1
0
0
0
TA TLOWER – THYST
TA TUPPER
TA TUPPER – THYST
TA TCRIT
When TA TCRIT, the Alert output is forced to Comparator mode and the CONFIG<0> (Alert
Output Mode bit) is ignored until TA TCRIT – THYST. In the Interrupt mode, if the interrupt is not
cleared (bit 5 of CONFIG), as shown in the diagram at Note 6, then Alert will remain asserted at
Note 7 until the interrupt is cleared by the controller.
7
TA TCRIT – THYST
Low/High
High/Low
High/Low
0
1
0
FIGURE 5-10:
Alert Output Conditions
DS20002203D-page 32
2009-2018 Microchip Technology Inc.
MCP9804
5.3
Summary of Power-on Default
The MCP9804 has an internal Power-on Reset (POR)
circuit. If the power supply voltage, VDD, glitches below
the VPOR threshold, the device resets the registers to
the power-on default settings.
Table 5-3 shows the power-on default summary for the
Temperature Sensor registers.
TABLE 5-3:
POWER-ON RESET DEFAULTS
Registers
Default Register
Data (Hexadecimal)
Power-Up Default
Register Description
Address
(Hexadecimal)
Register Name
0x01
CONFIG
0x0000
Comparator Mode
Active-Low Output
Alert and Critical Output
Output Disabled
Alert Not Asserted
Interrupt Cleared
Alert Limits Unlocked
Critical Limit Unlocked
Continuous Conversion
0°C Hysteresis
0x02
0x03
0x04
0x05
0x06
0x07
0x08
TUPPER
0x0000
0x0000
0x0000
0x0000
0x0054
0x0201
0x03
0°C
TLOWER
0°C
TCRIT
0°C
TA
0°C
Manufacturer ID
Device ID/Device Revision
Resolution
0x0054 (hex)
0x0201 (hex)
0x03 (hex)
2009-2018 Microchip Technology Inc.
DS20002203D-page 33
MCP9804
NOTES:
DS20002203D-page 34
2009-2018 Microchip Technology Inc.
MCP9804
A temperature accuracy error of approximately +0.5°C
could result from self-heating if the communication pins
sink/source the maximum current specified.
6.0
6.1
APPLICATIONS INFORMATION
Layout Considerations
For example, if the event output is loaded to maximum
IOL, Equation 6-1 can be used to determine the effect
of self-heating.
The MCP9804 does not require any additional
components besides the master controller in order to
measure temperature. However, it is recommended
that a decoupling capacitor of 0.1 µF to 1 µF be used
between the VDD and GND pins. A high-frequency
ceramic capacitor is recommended. It is necessary for
the capacitor to be located as close as possible to the
power and ground pins of the device in order to provide
effective noise protection.
EQUATION 6-1:
EFFECT OF
SELF-HEATING
T
= V
I
+ V
I
+ V
I
JA DD DD
OL_SDA OL_SDA
OL_Alert OL_Alert
Where:
T = TJ – TA
In addition, good PCB layout is key for better thermal
conduction from the PCB temperature to the sensor
die. For good temperature sensitivity, add a ground
layer under the device pins, as shown in Figure 6-1.
TJ = Junction Temperature
TA = Ambient Temperature
JA = Package Thermal Resistance
VOL_Alert, SDA = Alert and SDA Output VOL
(0.4 Vmax
IOL_Alert, SDA = Alert and SDA Output IOL
(3 mAmax
)
6.2
Thermal Considerations
A potential for self-heating errors can exist if the
MCP9804 SDA, SCL and Event lines are heavily
loaded with pull-ups (high current). Typically, the
self-heating error is negligible because of the relatively
small current consumption of the MCP9804.
)
At room temperature (TA = +25°C) with maximum
IDD = 500 µA and VDD = 3.6V, the self-heating due to
power dissipation T is +0.2°C for the DFN-8 package
and +0.5°C for the TSSOP-8 package.
VDD
A0
SDA
SCL
EP9
Alert
A1
A2
GND
FIGURE 6-1:
DFN Package Layout (Top View)
2009-2018 Microchip Technology Inc.
DS20002203D-page 35
MCP9804
NOTES:
DS20002203D-page 36
2009-2018 Microchip Technology Inc.
MCP9804
7.0
7.1
PACKAGING INFORMATION
Package Marking Information
Example:
8-Lead DFN (2 x 3)
XXX
YWW
NN
AET
132
25
Example:
8-Lead MSOP
XXXXXX
YWWNNN
9804E
132256
Legend: XX...X Customer-specific information
Y
YY
WW
NNN
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week ‘01’)
Alphanumeric traceability code
e
3
Pb-free JEDEC designator for Matte Tin (Sn)
*
This package is Pb-free. The Pb-free JEDEC designator (
can be found on the outer packaging for this package.
)
e3
Note: In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
2009-2018 Microchip Technology Inc.
DS20002203D-page 37
MCP9804
ꢀꢁꢂꢃꢄꢅꢆꢇꢈꢄꢉꢊꢋꢌꢆꢍꢎꢄꢈꢆꢏꢈꢄꢊꢐꢆꢑꢒꢆꢂꢃꢄꢅꢆꢇꢄꢌꢓꢄꢔꢃꢆꢕꢖꢗꢘꢆMꢆꢙꢚꢛꢚꢜ !ꢆ""ꢆ#ꢒꢅ$ꢆ%ꢍꢏꢑ&
ꢑꢒꢊꢃ' 2ꢌꢊꢅ%ꢎꢉꢅ&ꢌ %ꢅꢍ!ꢊꢊꢉꢄ%ꢅꢑꢇꢍ*ꢇꢐꢉꢅ"ꢊꢇ)ꢃꢄꢐ 'ꢅꢑꢈꢉꢇ ꢉꢅ ꢉꢉꢅ%ꢎꢉꢅꢖꢃꢍꢊꢌꢍꢎꢃꢑꢅꢂꢇꢍ*ꢇꢐꢃꢄꢐꢅꢕꢑꢉꢍꢃ$ꢃꢍꢇ%ꢃꢌꢄꢅꢈꢌꢍꢇ%ꢉ"ꢅꢇ%ꢅ
ꢎ%%ꢑ133)))ꢁ&ꢃꢍꢊꢌꢍꢎꢃꢑꢁꢍꢌ&3ꢑꢇꢍ*ꢇꢐꢃꢄꢐ
e
D
b
N
N
L
K
E2
E
EXPOSED PAD
NOTE 1
NOTE 1
2
1
1
2
D2
BOTTOM VIEW
TOP VIEW
A
NOTE 2
A3
A1
4ꢄꢃ%
ꢖꢙ55ꢙꢖ,ꢗ,ꢘꢕ
ꢓꢃ&ꢉꢄ ꢃꢌꢄꢅ5ꢃ&ꢃ%
ꢖꢙ6
67ꢖ
9
ꢚꢁ.ꢚꢅ/ꢕ0
ꢚꢁꢛꢚ
ꢖꢔ8
6!&(ꢉꢊꢅꢌ$ꢅꢂꢃꢄ
ꢂꢃ%ꢍꢎ
7ꢆꢉꢊꢇꢈꢈꢅ:ꢉꢃꢐꢎ%
ꢕ%ꢇꢄ"ꢌ$$ꢅ
0ꢌꢄ%ꢇꢍ%ꢅꢗꢎꢃꢍ*ꢄꢉ
7ꢆꢉꢊꢇꢈꢈꢅ5ꢉꢄꢐ%ꢎ
7ꢆꢉꢊꢇꢈꢈꢅ;ꢃ"%ꢎ
6
ꢉ
ꢔ
ꢔꢀ
ꢔ+
ꢓ
ꢚꢁ9ꢚ
ꢚꢁꢚꢚ
ꢀꢁꢚꢚ
ꢚꢁꢚ.
ꢚꢁꢚꢏ
ꢚꢁꢏꢚꢅꢘ,2
ꢏꢁꢚꢚꢅ/ꢕ0
+ꢁꢚꢚꢅ/ꢕ0
M
M
ꢚꢁꢏ.
,
,#ꢑꢌ ꢉ"ꢅꢂꢇ"ꢅ5ꢉꢄꢐ%ꢎ
,#ꢑꢌ ꢉ"ꢅꢂꢇ"ꢅ;ꢃ"%ꢎ
0ꢌꢄ%ꢇꢍ%ꢅ;ꢃ"%ꢎ
0ꢌꢄ%ꢇꢍ%ꢅ5ꢉꢄꢐ%ꢎ
0ꢌꢄ%ꢇꢍ%ꢝ%ꢌꢝ,#ꢑꢌ ꢉ"ꢅꢂꢇ"
ꢓꢏ
,ꢏ
(
5
=
ꢀꢁ+ꢚ
ꢀꢁ.ꢚ
ꢚꢁꢏꢚ
ꢚꢁ+ꢚ
ꢚꢁꢏꢚ
ꢀꢁ..
ꢀꢁꢜ.
ꢚꢁ+ꢚ
ꢚꢁ.ꢚ
M
ꢚꢁꢒꢚ
M
ꢑꢒꢊꢃꢉ'
ꢀꢁ ꢂꢃꢄꢅꢀꢅꢆꢃ !ꢇꢈꢅꢃꢄ"ꢉ#ꢅ$ꢉꢇ%!ꢊꢉꢅ&ꢇꢋꢅꢆꢇꢊꢋ'ꢅ(!%ꢅ&! %ꢅ(ꢉꢅꢈꢌꢍꢇ%ꢉ"ꢅ)ꢃ%ꢎꢃꢄꢅ%ꢎꢉꢅꢎꢇ%ꢍꢎꢉ"ꢅꢇꢊꢉꢇꢁ
ꢏꢁ ꢂꢇꢍ*ꢇꢐꢉꢅ&ꢇꢋꢅꢎꢇꢆꢉꢅꢌꢄꢉꢅꢌꢊꢅ&ꢌꢊꢉꢅꢉ#ꢑꢌ ꢉ"ꢅ%ꢃꢉꢅ(ꢇꢊ ꢅꢇ%ꢅꢉꢄ" ꢁ
+ꢁ ꢂꢇꢍ*ꢇꢐꢉꢅꢃ ꢅ ꢇ)ꢅ ꢃꢄꢐ!ꢈꢇ%ꢉ"ꢁ
ꢒꢁ ꢓꢃ&ꢉꢄ ꢃꢌꢄꢃꢄꢐꢅꢇꢄ"ꢅ%ꢌꢈꢉꢊꢇꢄꢍꢃꢄꢐꢅꢑꢉꢊꢅꢔꢕꢖ,ꢅ-ꢀꢒꢁ.ꢖꢁ
/ꢕ01 /ꢇ ꢃꢍꢅꢓꢃ&ꢉꢄ ꢃꢌꢄꢁꢅꢗꢎꢉꢌꢊꢉ%ꢃꢍꢇꢈꢈꢋꢅꢉ#ꢇꢍ%ꢅꢆꢇꢈ!ꢉꢅ ꢎꢌ)ꢄꢅ)ꢃ%ꢎꢌ!%ꢅ%ꢌꢈꢉꢊꢇꢄꢍꢉ ꢁ
ꢘ,21 ꢘꢉ$ꢉꢊꢉꢄꢍꢉꢅꢓꢃ&ꢉꢄ ꢃꢌꢄ'ꢅ! !ꢇꢈꢈꢋꢅ)ꢃ%ꢎꢌ!%ꢅ%ꢌꢈꢉꢊꢇꢄꢍꢉ'ꢅ$ꢌꢊꢅꢃꢄ$ꢌꢊ&ꢇ%ꢃꢌꢄꢅꢑ!ꢊꢑꢌ ꢉ ꢅꢌꢄꢈꢋꢁ
ꢖꢃꢍꢊꢌꢍꢎꢃꢑ ꢗꢉꢍꢎꢄꢌꢈꢌꢐꢋ ꢓꢊꢇ)ꢃꢄꢐ 0ꢚꢒꢝꢀꢏ+0
DS20002203D-page 38
2009-2018 Microchip Technology Inc.
MCP9804
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
2009-2018 Microchip Technology Inc.
DS20002203D-page 39
MCP9804
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS20002203D-page 40
2009-2018 Microchip Technology Inc.
MCP9804
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
2009-2018 Microchip Technology Inc.
DS20002203D-page 41
MCP9804
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS20002203D-page 42
2009-2018 Microchip Technology Inc.
MCP9804
Software License Agreement
The software supplied herewith by Microchip Technology Incorporated (the “Company”) is intended and supplied to you, the
Company’s customer, for use solely and exclusively with products manufactured by the Company.
The software is owned by the Company and/or its supplier, and is protected under applicable copyright laws. All rights are reserved.
Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civil
liability for the breach of the terms and conditions of this license.
THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATU-
TORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICU-
LAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR
SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
APPENDIX A: SOURCE CODE
/********************************************************************
FileName:
Processor:
Complier:
Company:
I2C.c
PIC18 Microcontrollers
Microchip C18 (for PIC18) or C30 (for PIC24)
Microchip Technology, Inc.
#include <p18cxxx.h> // This code is developed for PIC18F2550
//It can be modified to be used with any PICmicro with MSSP module
/** PRIVATE PROTOTYPES *********************************************/
void i2c_init(void);
void i2c_start(void);
void i2c_repStart(void);
void i2c_stop(void);
unsigned char i2c_write( unsigned char i2cWriteData );
unsigned char i2c_read( unsigned char ack );
/********************************************************************
*
*
*
*
*
Function Name: i2c_init
Return Value:
Parameters:
Description:
void
Enable SSP
This function sets up the SSP1 module on a
PIC18CXXX device for use with a Microchip I2C
********************************************************************/
void i2c_init(void) {
TRISBbits.TRISB0 = 1;
TRISBbits.TRISB1 = 1;
// Digital Output (make it input only when reading data)
// Digital Output
SSPCON1 = 0x28;
SSPCON2 = 0x00;
SSPSTAT = 0x80;
// enable I2C Master mode
// clear control bits
// disable slew rate control; disable SMBus
SSPADD = 19;
// set baud rate to 100 kHz (Fosc = 48 MHz)
PIR1bits.SSPIF = 0;
PIR2bits.BCLIF = 0;
SSPCON2bits.SEN = 0;
// force idle condition
}
2009-2018 Microchip Technology Inc.
DS20002203D-page 43
MCP9804
/********************************************************************
*
*
*
*
Function Name:
Return Value:
Parameters:
i2c_start
void
void
Description:
Send I2C Start Command
********************************************************************/
void i2c_start(void) {
PIR1bits.SSPIF = 0; //clear flag
while (SSPSTATbits.BF );
// wait for idle condition
// initiate START condition
// wait for a flag to be set
SSPCON2bits.SEN = 1;
while (!PIR1bits.SSPIF) ;
PIR1bits.SSPIF = 0; // clear flag
}
/********************************************************************
*
*
*
*
*
Function Name:
Return Value:
Parameters:
i2c_repStart
void
void
Description:
Resend I2C Start Command
********************************************************************/
void i2c_repStart(void) {
PIR1bits.SSPIF = 0; // clear flag
while ( SSPSTATbits.BF ) ; // wait for idle condition
SSPCON2bits.RSEN = 1;
// initiate Repeated START condition
while (!PIR1bits.SSPIF) ; // wait for a flag to be set
PIR1bits.SSPIF = 0; // clear flag
}
/********************************************************************
*
*
*
*
*
Function Name:
Return Value:
Parameters:
i2c_stop
void
void
Description:
Send I2C Stop command
********************************************************************/
void i2c_stop(void) {
PIR1bits.SSPIF = 0; // clear flag
while ( SSPSTATbits.BF ) ; // wait for idle condition
SSPCON2bits.PEN = 1;
// Initiate STOP condition
while (!PIR1bits.SSPIF) ; // wait for a flag to be set
PIR1bits.SSPIF = 0; // clear flag
}
DS20002203D-page 44
2009-2018 Microchip Technology Inc.
MCP9804
/********************************************************************
*
*
*
*
*
Function Name:
Return Value:
Parameters:
i2c_write
Status byte for WCOL detection.
Single data byte for I2C2 bus.
This routine writes a single byte to the
I2C2 bus.
Description:
********************************************************************/
unsigned char i2c_write( unsigned char i2cWriteData ) {
PIR1bits.SSPIF = 0; // clear interrupt
while ( SSPSTATbits.BF ) ; // wait for idle condition
SSPBUF = i2cWriteData;
ted)
// Load SSPBUF with i2cWriteData (the value to be transmit-
while (!PIR1bits.SSPIF) ; // wait for a flag to be set
PIR1bits.SSPIF = 0; // clear flag
return ( !SSPCON2bits.ACKSTAT ); // function returns '1' if transmission is acknowledged
}
/********************************************************************
*
*
*
*
Function Name:
Return Value:
Parameters:
i2c_read
contents of SSP2BUF register
ack = 1 and nak = 0
Description:
Read a byte from I2C bus and ACK/NAK device
********************************************************************/
unsigned char i2c_read( unsigned char ack ) {
unsigned char i2cReadData;
PIR1bits.SSPIF = 0;// clear interrupt
while ( SSPSTATbits.BF ) ; // wait for idle condition
SSPCON2bits.RCEN = 1;
// enable receive mode
while (!PIR1bits.SSPIF) ; // wait for a flag to be set
PIR1bits.SSPIF = 0;// clear flag
i2cReadData = SSPBUF;
if ( ack ) {
// Read SSPBUF and put it in i2cReadData
// if ack=1
SSPCON2bits.ACKDT = 0; //
} else {
SSPCON2bits.ACKDT = 1; //
then transmit an Acknowledge
otherwise transmit a Not Acknowledge
}
SSPCON2bits.ACKEN = 1;
// send acknowledge sequence
while (!PIR1bits.SSPIF) ; // wait for a flag to be set
PIR1bits.SSPIF = 0;// clear flag
return( i2cReadData );
// return the value read from SSPBUF
}
2009-2018 Microchip Technology Inc.
DS20002203D-page 45
MCP9804
NOTES:
DS20002203D-page 46
2009-2018 Microchip Technology Inc.
MCP9804
APPENDIX B: REVISION HISTORY
Revision D (April 2018)
The following is the list of modifications:
1. Updated the “Sensor Serial Interface Timing
Specifications” table.
2. Various typographical edits.
Revision C (January 2012)
The following is the list of modifications:
1. Typographical edits were made to the “Digital
Input/Output Pin Characteristics” table.
2. The “Sensor Serial Interface Timing
Specifications” table is updated with the 400
kHz timing specification.
3. Added typical specifications for accuracy drift
and repeatability.
Revision B (December 2009)
The following is the list of modifications:
1. Updated the resolution parameter in the
“Temperature Sensor DC Characteristics”
table.
2. Updated Figure 5-7.
3. Updated Figure 5-10.
4. Updated Source Code in Appendix A.
Revision A (September 2009)
• Original release of this document.
2009-2018 Microchip Technology Inc.
DS20002203D-page 47
MCP9804
NOTES:
DS20002203D-page 48
2009-2018 Microchip Technology Inc.
MCP9804
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
Examples:
PART NO.
Device
X
-X
/XX
a) MCP9804-E/MC:Extended Temperature,
8LD DFN package
Tape and Reel
and/or
Alternate Pinout
Temperature Package
Range
b) MCP9804-E/MS:Extended Temperature,
8LD MSOP package
c) MCP9804T-E/MC:Tape and Reel,
Extended Temperature,
Device:
MCP9804: Digital Temperature Sensor
MCP9804T: Digital Temperature Sensor (Tape and Reel)
8LD DFN package
d) MCP9804T-E/MS:Tape and Reel,
Extended Temperature,
Temperature Range:
Package:
E
=
-40°C to +125°C
8LD MSOP package.
MC
MS
=
=
Plastic Dual Flat No-Lead (DFN) 2x3, 8-lead
Plastic Micro Small Outline (MSOP), 8-lead
2009-2018 Microchip Technology Inc.
DS20002203D-page 49
MCP9804
NOTES:
DS20002203D-page 50
2009-2018 Microchip Technology Inc.
MCP9804
Note the following details of the code protection feature on Microchip devices:
•
Microchip products meet the specification contained in their particular Microchip Data Sheet.
•
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•
•
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights unless otherwise stated.
Trademarks
The Microchip name and logo, the Microchip logo, AnyRate, AVR,
AVR logo, AVR Freaks, BeaconThings, BitCloud, CryptoMemory,
CryptoRF, dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KEELOQ,
KEELOQ logo, Kleer, LANCheck, LINK MD, maXStylus,
maXTouch, MediaLB, megaAVR, MOST, MOST logo, MPLAB,
OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, Prochip
Designer, QTouch, RightTouch, SAM-BA, SpyNIC, SST, SST
Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are registered
trademarks of Microchip Technology Incorporated in the U.S.A.
and other countries.
ClockWorks, The Embedded Control Solutions Company,
EtherSynch, Hyper Speed Control, HyperLight Load, IntelliMOS,
mTouch, Precision Edge, and Quiet-Wire are registered
trademarks of Microchip Technology Incorporated in the U.S.A.
Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any
Capacitor, AnyIn, AnyOut, BodyCom, chipKIT, chipKIT logo,
CodeGuard, CryptoAuthentication, CryptoCompanion,
CryptoController, dsPICDEM, dsPICDEM.net, Dynamic Average
Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial
Programming, ICSP, Inter-Chip Connectivity, JitterBlocker,
KleerNet, KleerNet logo, Mindi, MiWi, motorBench, MPASM, MPF,
MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach,
Omniscient Code Generation, PICDEM, PICDEM.net, PICkit,
PICtail, PureSilicon, QMatrix, RightTouch logo, REAL ICE, Ripple
Blocker, SAM-ICE, Serial Quad I/O, SMART-I.S., SQI,
SuperSwitcher, SuperSwitcher II, Total Endurance, TSHARC,
USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA,
and ZENA are trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in
the U.S.A.
Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
Silicon Storage Technology is a registered trademark of Microchip
Technology Inc. in other countries.
GestIC is a registered trademark of Microchip Technology
Germany II GmbH & Co. KG, a subsidiary of Microchip
Technology Inc., in other countries.
All other trademarks mentioned herein are property of their
respective companies.
QUALITY MANAGEMENT SYSTEM
CERTIFIED BY DNV
© 2009-2018, Microchip Technology Incorporated, All Rights
Reserved.
ISBN: 978-1-5224-2859-6
== ISO/TS 16949 ==
2009-2018 Microchip Technology Inc.
DS20002203D-page 51
Worldwide Sales and Service
AMERICAS
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://www.microchip.com/
support
Asia Pacific Office
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Suites 3707-14, 37th Floor
Tower 6, The Gateway
Harbour City, Kowloon
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
Hong Kong
Tel: 852-2943-5100
Fax: 852-2401-3431
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
Finland - Espoo
Tel: 358-9-4520-820
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
Web Address:
www.microchip.com
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
Germany - Garching
Tel: 49-8931-9700
Germany - Haan
India - Pune
Tel: 91-20-3019-1500
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
Austin, TX
Tel: 512-257-3370
Tel: 49-2129-3766400
Japan - Osaka
Tel: 81-6-6152-7160
Fax: 81-6-6152-9310
Germany - Heilbronn
Tel: 49-7131-67-3636
Boston
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Japan - Tokyo
Tel: 81-3-6880- 3770
Fax: 81-3-6880-3771
Germany - Karlsruhe
Tel: 49-721-625370
China - Dongguan
Tel: 86-769-8702-9880
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
China - Guangzhou
Tel: 86-20-8755-8029
Germany - Rosenheim
Tel: 49-8031-354-560
China - Hangzhou
Tel: 86-571-8792-8115
Fax: 86-571-8792-8116
Korea - Seoul
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Israel - Ra’anana
Tel: 972-9-744-7705
China - Hong Kong SAR
Tel: 852-2943-5100
Fax: 852-2401-3431
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Malaysia - Kuala Lumpur
Tel: 60-3-6201-9857
Fax: 60-3-6201-9859
Detroit
Novi, MI
Tel: 248-848-4000
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
Italy - Padova
Tel: 39-049-7625286
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
Houston, TX
Tel: 281-894-5983
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Indianapolis
Noblesville, IN
Tel: 317-773-8323
Fax: 317-773-5453
Tel: 317-536-2380
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
Norway - Trondheim
Tel: 47-7289-7561
China - Shanghai
Tel: 86-21-3326-8000
Fax: 86-21-3326-8021
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
Poland - Warsaw
Tel: 48-22-3325737
Los Angeles
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Tel: 951-273-7800
Romania - Bucharest
Tel: 40-21-407-87-50
Taiwan - Hsin Chu
Tel: 886-3-5778-366
Fax: 886-3-5770-955
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
China - Shenzhen
Tel: 86-755-8864-2200
Fax: 86-755-8203-1760
Taiwan - Kaohsiung
Tel: 886-7-213-7830
Raleigh, NC
Tel: 919-844-7510
Sweden - Gothenberg
Tel: 46-31-704-60-40
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Taiwan - Taipei
Tel: 886-2-2508-8600
Fax: 886-2-2508-0102
New York, NY
Tel: 631-435-6000
Sweden - Stockholm
Tel: 46-8-5090-4654
San Jose, CA
Tel: 408-735-9110
Tel: 408-436-4270
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
UK - Wokingham
Tel: 44-118-921-5800
Fax: 44-118-921-5820
Canada - Toronto
Tel: 905-695-1980
Fax: 905-695-2078
DS20002203D-page 52
2018 Microchip Technology Inc.
10/10/17
相关型号:
MCP9804T-E/MCVAO
Serial Switch/Digital Sensor, 16 Bit(s), 1Cel, Rectangular, Surface Mount
MICROCHIP
MCP9805-BEMC
DIGITAL TEMP SENSOR-SERIAL, 11BIT(s), 3Cel, RECTANGULAR, SURFACE MOUNT, 2 X 3 MM, PLASTIC, DFN-8
MICROCHIP
MCP9805-TBEMC
DIGITAL TEMP SENSOR-SERIAL, 11BIT(s), 3Cel, RECTANGULAR, SURFACE MOUNT, 2 X 3 MM, PLASTIC, DFN-8
MICROCHIP
MCP9805-TBEST
DIGITAL TEMP SENSOR-SERIAL, 11BIT(s), 3Cel, RECTANGULAR, SURFACE MOUNT, 4.40 MM, PLASTIC, MO-153, TSSOP-8
MICROCHIP
©2020 ICPDF网 联系我们和版权申明