MCP 9804

Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

2009 Microchip Technology Inc.

DS22203A-page 1
MCP9804
Features
Accuracy:
- 0.25C (typical) from -40C to +125C
- 1C (maximum) from -40C to +125C
User Selectable Measurement Resolution:
- 0.5C, 0.25C, 0.125C, 0.0625C
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: I
2
C/SMBus Compatible
Available Packages: 2x3 DFN-8, MSOP-8
Typical Applications
General Purpose
Industrial Applications
Industrial Freezers and Refrigerations
Food Processing
Personal Computers and Servers
PC Peripherals
Consumer Electronics
Hand-held/Portable Devices
Temperature Accuracy
Description
Microchip Technology Inc.s MCP9804 digital
temperature sensor converts temperatures between
-40C and +125C to a digital word with 0.25C/1C
(typical/maximum) accuracy.
The MCP9804 comes with user-programmable
registers that provide flexibility 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 an Alert 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 temperature Alert interrupt output for
microprocessor-based systems. The Alert output can
also be configured as a Critical temperature output
only.
This sensor has an industry standard 100 kHz 2-wire,
SMBus/I
2
C 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.
Package Types
0%
10%
20%
30%
40%
-
1
.
0
-
0
.
8
-
0
.
6
-
0
.
4
-
0
.
2
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
1
.
0
Temperature Accuracy (C)
O
c
c
u
r
r
e
n
c
e
s
T
A
= -40C to 125C
V
DD
= 3.3V
2787 units
8-Pin 2x3 DFN *
1
2
3
4
8-Pin MSOP
8
7
6
5
* Includes Exposed Thermal Pad (EP); see Table 3-1.
A1
A0
A2
SCL
Alert
1
2
3
4
8
7
6
5 GND
SDA V
DD
EP
9
SCL
Alert
GND
SDA
A1
A0
A2
V
DD
0.25C Typ. Accuracy Digital Temperature Sensor
MCP9804
DS22203A-page 2 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 3
MCP9804
1.0 ELECTRICAL
CHARACTERISTICS
Absolute Maximum Ratings
V
DD
.................................................................................. 6.0V
Voltage at All Input/Output Pins .............. GND 0.3V to 6.0V
Storage Temperature ....................................-65C to +150C
Ambient Temperature with Power Applied....-40C to +125C
Junction Temperature (T
J
) .......................................... +150C
ESD Protection on All Pins (HBM:MM) ................ (4 kV:400V)
Latch-Up Current at Each Pin (25C)....................... 200 mA
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.
TEMPERATURE SENSOR DC CHARACTERISTICS
Electrical Specifications: Unless otherwise indicated, V
DD
= 2.7V to 5.5V, GND = Ground, and T
A
= -40C to
+125C.
Parameters Sym Min Typ Max Unit Conditions
Temperature Sensor Accuracy
+40C < T
A
+125C T
ACY
-1.0 0.25 +1.0 C V
DD
= 3.3V
Temperature Conversion Time
0.5C/bit t
CONV
30 ms 33s/sec (typical)
0.25C/bit 65 ms 15s/sec (typical)
0.25C/bit 130 ms 7s/sec (typical)
0.25C/bit 250 ms 4s/sec (typical)
Power Supply
Operating Voltage Range V
DD
2.7 5.5 V
Operating Current I
DD
200 400 A
Shutdown Current I
SHDN
0.1 2 A
Power On Reset (POR) V
POR
2.2 V Threshold for falling V
DD
Power Supply Rejection,
T
A
= +25C
C/V
DD
-0.1 C/V V
DD
= 2.7V to 5.5V
0.15 C V
DD
= 3.3V+150 mV
PP AC
(0 to 1 MHz)
Alert Output (Open-Drain output, external pull-up resistor required), see Section 5.2.3
High-level Current (leakage) I
OH
1 A V
OH
= V
DD
(Active-Low, Pull-up Resistor)
Low-level Voltage V
OL
0.4 V I
OL
= 3 mA (Active-Low, Pull-up Resistor)
Thermal Response, from +25C (Air) to +125C (oil bath)
DFN-8 t
RES
0.7 s Time to 63% (89C)
MSOP-8 1.4 s
MCP9804
DS22203A-page 4 2009 Microchip Technology Inc.
GRAPHICAL SYMBOL DESCRIPTION
DIGITAL INPUT/OUTPUT PIN CHARACTERISTICS
Electrical Specifications: Unless otherwise indicated, V
DD
= 2.7V to 5.5V, GND = Ground, and T
A
= -40C to
+125C.
Parameters Sym Min Typ Max Units Conditions
Serial Input/Output (SCL, SDA, A0, A1, A2)
Input
High-level Voltage V
IH
2.1 V
Low-level Voltage V
IL
0.8 V
Input Current I
IN
5 A
Output (SDA)
Low-level Voltage V
OL
0.4 V I
OL
= 3 mA
High-level Current (leakage) I
OH
1 A V
OH
= 5.5V
Low-level Current I
OL
6 mA V
OL
= 0.6V
SDA and SCL Inputs
Hysteresis V
HYST
0.5 V
Spike Suppression t
SP
50 ns
Capacitance C
IN
5 pF
V
DD
V
IH
V
IL
I
IN
Voltage
Current
time
V
DD
I
OH
Voltage
Current
time
INPUT
OUTPUT
V
OL
I
OL
TEMPERATURE CHARACTERISTICS
Electrical Specifications: Unless otherwise indicated, V
DD
= 2.7V to 5.5V and GND = Ground.
Parameters Sym Min Typ Max Units Conditions
Temperature Ranges
Specified Temperature Range T
A
-40 +125 C Note 1
Operating Temperature Range T
A
-40 +125 C
Storage Temperature Range T
A
-65 +150 C
Thermal Package Resistances
Thermal Resistance, 8L-DFN
JA
41 C/W
Thermal Resistance, 8L-MSOP
JA
206 C/W
Note 1: Operation in this range must not cause T
J
to exceed Maximum Junction Temperature (+150C).
2009 Microchip Technology Inc. DS22203A-page 5
MCP9804
TIMING DIAGRAM
SENSOR SERIAL INTERFACE TIMING SPECIFICATIONS
Electrical Specifications: Unless otherwise indicated, V
DD
= 2.7V to 5.5V, T
A
= -40C to +125C, GND = Ground,
and C
L
= 80 pF (Note).
Parameters Sym Min Max Units Conditions
2-Wire SMBus/Standard Mode I
2
C Compatible Interface (Note)
Serial Port Clock Frequency f
SC
10 100 kHz
Low Clock t
LOW
4.7 s
High Clock t
HIGH
4.0 s
Rise Time t
R
1000 ns
Fall Time t
F
300 ns
Data Setup Before SCL High t
SU-DATA
250 ns
Data Hold After SCL Low t
HD-DATA
300 ns
Start Condition Setup Time t
SU-START
4.7 s
Start Condition Hold Time t
HD-START
4.0 s
Stop Condition Setup Time t
SU-STOP
4.0 s
Bus Free t
B-FREE
4.7 s
Time Out t
OUT
20 27 35 ms
Note: The serial interface specification min./max. limits are specified by characterization (not production tested).
t
SU-START
t
H-START
t
SU-DATA
t
SU-STOP
t
B-FREE
SCL
SDA
t
H-DATA
t
HIGH
t
LOW
t
OUT
t
R
, t
F
START Condition
Data Transmission STOP Condition
MCP9804
DS22203A-page 6 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 7
MCP9804
2.0 TYPICAL PERFORMANCE CURVES
Note: Unless otherwise indicated, V
DD
= 2.7V to 5.5V, GND = Ground, SDA/SCL pulled-up to V
DD
, and
T
A
= -40C to +125C.
FIGURE 2-1: Temperature Accuracy.

FIGURE 2-2: Temperature Accuracy
Histogram, T
A
= -40C to +125C.

FIGURE 2-3: Temperature Accuracy
Histogram, T
A
= +25C.
FIGURE 2-4: Temperature Accuracy
Histogram, T
A
= +45C.

FIGURE 2-5: Temperature Accuracy
Histogram, T
A
= +125C.

FIGURE 2-6: Temperature Accuracy
Histogram, T
A
= -40C.
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.
-1.0
-0.5
0.0
0.5
1.0
-40 -20 0 20 40 60 80 100 120
T
A
(C)
T
e
m
p
e
r
a
t
u
r
e

A
c
c
u
r
a
c
y

(

C
)
VDD = 3.3V
722 units at -40C, +45C, +125C
64 units at other temperatures
+Std. Dev.
Average
-Std. Dev.



0%
10%
20%
30%
40%
-
1
.
0
-
0
.
8
-
0
.
6
-
0
.
4
-
0
.
2
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
1
.
0
Temperature Accuracy (C)
O
c
c
u
r
r
e
n
c
e
s
T
A
= -40C to +125C
VDD = 3.3V
2787 units
0%
10%
20%
30%
40%
50%
60%
-
1
.
0
-
0
.
8
-
0
.
6
-
0
.
4
-
0
.
2
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
1
.
0
Temperature Accuracy (C)
O
c
c
u
r
r
e
n
c
e
s
T
A
= +25C
VDD = 3.3V
64 units
0%
10%
20%
30%
40%
50%
60%
-
1
.
0
-
0
.
8
-
0
.
6
-
0
.
4
-
0
.
2
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
1
.
0
Temperature Accuracy (C)
O
c
c
u
r
r
e
n
c
e
s
T
A
= +45C
V
DD
= 3.3V
722 units
0%
10%
20%
30%
40%
50%
60%
-
1
.
0
-
0
.
8
-
0
.
6
-
0
.
4
-
0
.
2
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
1
.
0
Temperature Accuracy (C)
O
c
c
u
r
r
e
n
c
e
s
T
A
= +125C
V
DD
= 3.3V
722 units
0%
10%
20%
30%
40%
50%
60%
-
1
.
0
-
0
.
8
-
0
.
6
-
0
.
4
-
0
.
2
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
1
.
0
Temperature Accuracy (C)
O
c
c
u
r
r
e
n
c
e
s
T
A
= -40C
V
DD
= 3.3V
722 units
MCP9804
DS22203A-page 8 2009 Microchip Technology Inc.
Note: Unless otherwise indicated, V
DD
= 2.7V to 5.5V, GND = Ground, SDA/SCL pulled-up to V
DD
, and
T
A
= -40C to +125C.

FIGURE 2-7: Supply Current vs.
Temperature.
FIGURE 2-8: Shutdown Current vs.
Temperature.

FIGURE 2-9: Power-on Reset Threshold
Voltage vs. Temperature.

FIGURE 2-10: Temperature Accuracy vs.
Supply Voltage.

FIGURE 2-11: Power Supply Rejection vs.
Frequency.

FIGURE 2-12: Temperature Conversion
Time vs. Temperature.
100
150
200
250
300
350
400
-40 -20 0 20 40 60 80 100 120
Temperature (C)
I
D
D

(

A
)



0.00
0.50
1.00
1.50
2.00
-40 -20 0 20 40 60 80 100 120
Temperature (C )
I
S
H
D
N

(

A
)
1
1.5
2
2.5
3
-40 -20 0 20 40 60 80 100 120
Temperature (C)
V
P
O
R

(
V
)
-1.00
-0.50
0.00
0.50
1.00
-40 -20 0 20 40 60 80 100 120
Temperature (C)
T
e
m
p
e
r
a
t
u
r
e

A
c
c
u
r
a
c
y

(

C
)
C/V
DD
= 0.1C/V
VDD = 2.7V
V
DD
= 3.3V
VDD = 5.5V
-1.0
-0.5
0.0
0.5
1.0
100 1,000 10,000 100,000 1,000,000
Frequency (Hz)
N
o
r
m
a
l
i
z
e
d

T
e
m
p
.

E
r
r
o
r

(

C
)
C/V
DD
, V
DD
= 3.3V + 150 mV
PP (AC)
TA = 25C
1k 10k 100k 1M 100k 1M 10k 100k 1M 1k 10k 100k 1M
100 1k 10k 100k 1M
T
A
= +25C
No decoupling capacitor
10
100
1000
-40 -20 0 20 40 60 80 100 120
Temperature (C)
t
C
O
N
V

(
m
s
)
0.0625C
0.125C
0.25C
0.5C
2009 Microchip Technology Inc. DS22203A-page 9
MCP9804
Note: Unless otherwise indicated, V
DD
= 2.7V to 5.5V, GND = Ground, SDA/SCL pulled-up to V
DD
, and
T
A
= -40C to +125C.

FIGURE 2-13: SDA & Alert output V
OL
vs.
Temperature.

FIGURE 2-14: SDA I
OL
vs. Temperature.

FIGURE 2-15: Package Thermal
Response.

FIGURE 2-16: SMBus Timeout vs.
Temperature.



0
0.1
0.2
0.3
0.4
-40 -20 0 20 40 60 80 100 120
Temperature (C)
S
D
A

&

A
l
e
r
t

O
u
t
p
u
t

V
O
L

(
V
)
Alert V
OL
SDA VOL
IOL = 3 mA
6
12
18
24
30
36
42
48
-40 -20 0 20 40 60 80 100 120
Temperature (C)
S
D
A

I
O
L

(
m
A
)
V
OL
= 0.6V
0%
20%
40%
60%
80%
100%
120%
-2 0 2 4 6 8 10 12 14 16
Time (s)
T
h
e
r
m
a
l

R
e
s
p
o
n
s
e

(
%
)
Room to +125C (Oil bath)
MSOP-8
DFN-8
20
25
30
35
-40 -20 0 20 40 60 80 100 120
Temperature (C)
S
M
B
u
s
/
I
2
C

B
u
s

t
O
U
T

(
m
s
)
MCP9804
DS22203A-page 10 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 11
MCP9804
3.0 PIN DESCRIPTION
The descriptions of the pins are listed in Table 3-1.
3.1 Address Pins (A0, A1, A2)
These pins are device address input pins.
The address pins correspond to the Least Significant
bits (LSb) of address bits. The Most Significant bits
(MSb) (A6, A5, A4, A3). This is shown in Table 3-2.
3.2 Ground Pin (GND)
The GND pin is the system ground pin.
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).
3.4 Serial Clock Line (SCL)
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).
3.5 Temperature Alert, Open-Drain
Output (Alert)
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).
3.6 Power Pin (V
DD
)
V
DD
is the power pin. The operating voltage range, as
specified in the DC electrical specification table, is
applied on this 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).
TABLE 3-1: PIN FUNCTION TABLE
DFN MSOP Symbol Pin Function
1 1 SDA Serial Data Line
2 2 SCL Serial Clock Line
3 3 Alert Temperature Alert Output
4 4 GND Ground
5 5 A2 Slave Address
6 6 A1 Slave Address
7 7 A0 Slave Address
8 8 V
DD
Power Pin
9 EP Exposed Thermal Pad (EP); must be connected to GND.
TABLE 3-2: MCP9804 ADDRESS BYTE
Device Address Code Slave
Address
A6 A5 A4 A3 A2 A1 A0
MCP9804 0 0 1 1 X
(1)
X X
MCP9804
(2)
1 0 0 1 X X X
Note 1: User-selectable address is shown by X.
A2, A1 and A0 must match the
corresponding device pin configuration.
2: Contact Factory for this Address Code.
MCP9804
DS22203A-page 12 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 13
MCP9804
4.0 SERIAL COMMUNICATION
4.1 2-Wire Standard Mode I
2
C
Protocol-Compatible Interface
The MCP9804 serial clock input (SCL) and the
bidirectional serial data line (SDA) form a 2-wire
bidirectional Standard mode I
2
C compatible
communication port (refer to the Digital Input/Output
Pin Characteristics table and Sensor Serial
Interface Timing Specifications table).
The following bus protocol has been defined:
4.1.1 DATA TRANSFER
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).
Repeated communication is initiated after t
B-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).
4.1.2 MASTER/SLAVE
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.
4.1.3 START/STOP CONDITION
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.
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.
4.1.4 ADDRESS BYTE
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 V
DD
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).
FIGURE 4-1: Device Addressing.
TABLE 4-1: MCP9804 SERIAL BUS
PROTOCOL DESCRIPTIONS
Term Description
Master The device that controls the serial bus,
typically a microcontroller.
Slave The device addressed by the master,
such as the MCP9804.
Transmitter Device sending data to the bus.
Receiver Device receiving data from the bus.
START A unique signal from master to initiate
serial interface with a slave.
STOP A unique signal from the master to
terminate serial interface from a slave.
Read/Write A read or write to the MCP9804
registers.
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).
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.
1 2 3 4 5 6 7 8 9 SCL
SDA
0 1 1 A2 A1 A0
Start
Address Byte
Slave Address
R/W
MCP9804 Response
Code Address
A
C
K
0
See TABLE 3-2: MCP9804 Address Byte
MCP9804
DS22203A-page 14 2009 Microchip Technology Inc.
4.1.5 DATA VALID
After the Start condition, each bit of data in
transmission needs to be settled for a time specified by
t
SU-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, is obliged to
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
t
SU-DATA
before the low-to-high transition of SCL from
the master. SDA also needs to remain pulled down for
t
H-DATA
after a high-to-low transition of SCL.
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.
4.1.7 TIME OUT
If the SCL stays low or high for the time specified by
t
OUT
, the MCP9804 temperature sensor resets the
serial interface. This dictates the minimum clock speed
as specified in the specification.
2009 Microchip Technology Inc. DS22203A-page 15
MCP9804
5.0 FUNCTIONAL DESCRIPTION
The MCP9804 temperature sensors consists of a
band-gap type temperature sensor, a Delta-Sigma
Analog-to-Digital Converter ( ADC), user-
programmable registers and a 2-wire SMBus/I
2
C
protocol compatible serial interface. Figure 5-1 shows a
block diagram of the register structure.

FIGURE 5-1: Functional Block Diagram.
Clear Alert
0.5C
0.25C
0.125C
0.0625C
Temperature
T
UPPER

T
LOWER

Configuration
ADC
Band-Gap
Temperature
Sensor
Alert Status
Output Control
Critical Alert only
Alert Polarity
Alert Comp/Int
T
CRIT

Register
Pointer
Critical Trip Lock
Alarm Win. Lock Bit
Shutdown
Hysteresis
Manufacturer ID
Resolution
Device ID/Rev
SMBus/Standard I
2
C
Interface
A0 A1 A2 Alert SDA SCL
V
DD
GND
MCP9804
DS22203A-page 16 2009 Microchip Technology Inc.
5.1 Registers
The MCP9804 has several registers that are
user-accessible. These registers include the
Temperature register, Configuration register,
Temperature Alert Upper-Boundary and
Lower-Boundary Limit registers, Critical Temperature
Limit register, Manufacturer Identification register and
Device Identification register.
The Temperature register is read-only, used to access
the ambient temperature data. This register is double
buffered and it is updated every t
CONV
. The
Temperature Alert Upper-Boundary and
Lower-Boundary Limit registers are read/writes
registers. If the ambient temperature drifts beyond the
user-specified limits, the MCP9804 outputs a signal
using the Alert pin (refer to Section 5.2.3). In addition,
the Critical Temperature Limit register is used to
provide an additional critical temperature limit.
The Configuration register provides access to
configure the MCP9804s various features. These
registers are described in further detail in the following
sections.
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
(bits 7-3) 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 W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 7-4 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.
bit 3-0 Pointer Bits:
0000 = RFU, reserved for future use (Read Only Register)
0001 = Configuration register (CONFIG)
0010 = Alert Temperature Upper-Boundary Trip register (T
UPPER
)
0011 = Alert Temperature Lower-Boundary Trip register (T
LOWER
)
0100 = Critical Temperature Trip register (T
CRIT
)
0101 = Temperature register (T
A
)
0110 = Manufacturer ID register
0111 = Device ID/Revision register
1000 = Resolution register
1XXX = RFU (Note)
Note: Some registers contain calibration codes and should not be accessed. Accessing these registers could
cause permanent sensor decalibration.
2009 Microchip Technology Inc. DS22203A-page 17
MCP9804
TABLE 5-1: BIT ASSIGNMENT SUMMARY FOR ALL REGISTERS (SEE SECTION 5.3 FOR
POWER-ON DEFAULTS)
Register
Pointer
(Hex)
MSB/
LSB
Bit Assignment
7 6 5 4 3 2 1 0
0x00 MSB 0 0 0 0 0 0 0 0
LSB 0 0 0 1 1 1 1 1
0x01 MSB 0 0 0 0 0 Hysteresis SHDN
LSB Crt Loc Win Loc Int Clr Alt Stat Alt Cnt Alt Sel Alt Pol Alt Mod
0x02 MSB 0 0 0 SIGN 2
7
C 2
6
C 2
5
C 2
4
C
LSB 2
3
C 2
2
C 2
1
C 2
0
C 2
-1
C 2
-2
C 0 0
0x03 MSB 0 0 0 SIGN 2
7
C 2
6
C 2
5
C 2
4
C
LSB 2
3
C 2
2
C 2
1
C 2
0
C 2
-1
C 2
-2
C 0 0
0x04 MSB 0 0 0 SIGN 2
7
C 2
6
C 2
5
C 2
4
C
LSB 2
3
C 2
2
C 2
1
C 2
0
C 2
-1
C 2
-2
C 0 0
0x05 MSB T
A
T
CRIT
T
A
> T
UPPER
T
A
< T
LOWER
SIGN 2
7
C 2
6
C 2
5
C 2
4
C
LSB 2
3
C 2
2
C 2
1
C 2
0
C 2
-1
C 2
-2
C 0 0
0x06 MSB 0 0 0 0 0 0 0 0
LSB 0 1 0 1 0 1 0 0
0x07 MSB 0 0 0 0 0 0 1 0
LSB 0 0 0 0 0 0 0 0
0x08 LSB 0 0 0 0 0 0 1 1
MCP9804
DS22203A-page 18 2009 Microchip Technology Inc.
5.1.1 SENSOR CONFIGURATION
REGISTER (CONFIG)
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
thru 0 are used to select 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 T
UPPER
and T
LOWER
temperature boundary or T
CRIT
only),
Alert output status and Alert output polarity and mode
(Comparator Output or Interrupt Output mode) are user
configurable.
The temperature hysteresis bits 10 and 9 can be used
to prevent output chatter when the ambient
temperature gradually changes beyond the
user-specified temperature boundary (see
Section 5.2.2. The Continuous Conversion or
Shutdown mode is selected using bit 8. In Shutdown
mode, the band gap temperature sensor circuit stops
converting temperature and the Ambient Temperature
register (T
A
) holds the previous temperature data (see
Section 5.2.1). Bits 7 and 6 are used to lock the user-
specified boundaries T
UPPER
, T
LOWER
and T
CRIT
to
prevent an accidental rewrite. The Lock bits are cleared
by reseting power. Bits 5 thru 0 are used to configure
the temperature Alert output pin. All functions are
described in Register 5-2 (see Section 5.2.3).

REGISTER 5-2: CONFIGURATION REGISTER (CONFIG) ADDRESS 0000 0001b
U-0 U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0
T
HYST
SHDN
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R-0 R/W-0 R/W-0 R/W-0 R/W-0
Crit. Lock Win. Lock Int. Clear Alert Stat. Alert Cnt. Alert Sel. Alert Pol. Alert Mod.
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 15-11 Unimplemented: Read as 0
bit 10-9 T
UPPER
and T
LOWER
Limit Hysteresis (T
HYST
):
00 = 0C (power-up default)
01 = 1.5C
10 = 3.0C
11 = 6.0C
(Refer to Section 5.2.3)
This bit can not be altered when either of the lock bits are set (bit 6 and bit 7).
This bit can be programmed in shutdown mode.
bit 8 Shutdown Mode (SHDN):
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 1 when either of the lock bits is set (bit 6 and bit 7). However, it can be cleared
0 for Continuous Conversion while locked. (Refer to Section 5.2.1).
2009 Microchip Technology Inc. DS22203A-page 19
MCP9804
bit 7 T
CRIT
Lock Bit (Crit. Lock):
0 = Unlocked. T
CRIT
register can be written (power-up default).
1 = Locked. T
CRIT
register can not be written.
When enabled, this bit remains set 1 or locked until cleared by internal reset (Section 5.3). This bit
does not require a double-write.
This bit can be programmed in shutdown mode.
bit 6 T
UPPER
and T
LOWER
Window Lock Bit (Win. Lock):
0 = Unlocked. T
UPPER
and T
LOWER
registers can be written (power-up default).
1 = Locked. T
UPPER
and T
LOWER
registers can not be written.
When enabled, this bit remains set 1 or locked until cleared by power-on Reset (Section 5.3). This
bit does not require a double-write.
This bit can be programmed in shutdown mode.
bit 5 Interrupt Clear (Int. Clear) Bit:
0 = No effect (power-up default)
1 = Clear interrupt output. When read this bit returns 0
This bit can not be set 1 in shutdown mode, but it can be cleared after the device enters shutdown
mode.
bit 4 Alert Output Status (Alert Stat.) 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 can not be set 1 or cleared 0 in shutdown mode. However, if the Alert output is configured
as interrupt mode, and if the host controller clears 0 the interrupt using bit 5 while the device is in
shutdown mode then this bit will also be cleared 0.
bit 3 Alert Output Control (Alert Cnt.) Bit:
0 = Disabled (power-up default)
1 = Enabled
This bit can not be altered when either of the lock bits is set (bit 6 and bit 7).
This bit can be programmed in shutdown mode, but the Alert output will not assert or de-assert.
bit 2 Alert Output Select (Alert Sel.) Bit:
0 = Alert output for T
UPPER
, T
LOWER
and T
CRIT
(power-up default)
1 = T
A
> T
CRIT
only. (T
UPPER
and T
LOWER
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 de-assert.
bit 1 Alert Output Polarity (Alert Pol.) 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 is set (bit 6 and bit 7).
This bit can be programmed in shutdown mode, but the Alert output will not assert or de-assert.
bit 0 Alert Output Mode (Alert Mod.) Bit:
0 = Comparator output (power-up default)
1 = Interrupt output
This bit cannot be altered when either of the lock bits is set (bit 6 and bit 7).
This bit can be programmed in shutdown mode, but the Alert output will not assert or de-assert.
REGISTER 5-2: CONFIGURATION REGISTER (CONFIG) ADDRESS 0000 0001b
MCP9804
DS22203A-page 20 2009 Microchip Technology Inc.
FIGURE 5-2: Timing Diagram for Writing to the Configuration Register (See Section 4.0.
Writing to the CONFIG Register to Enable the Event Output pin <0000 0000 0000 1000>b.
SDA
A
C
K
0 0 1 1
A
0 0 0 0
A
C
K
S
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SCL
0
Address Byte
W
MCP9804 MCP9804
MSB Data
A
C
K
A
C
K
P
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
LSB Data
Configuration Pointer
MCP9804 MCP9804
0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
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)
//also, make sure bit 0 is cleared 0
i2c_write(0x01); // Write CONFIG Register
i2c_write(0x00); // Write data
i2c_write(0x08); // Write data
i2c_stop(); // send STOP command
2009 Microchip Technology Inc. DS22203A-page 21
MCP9804
FIGURE 5-3: Timing Diagram for Reading from the Configuration Register (See Section 4.0).
SDA
A
C
K
0 0 1 1
A
Configuration Pointer
0 0 0 0
A
C
K
S
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SCL
0
Address Byte
A
C
K
0 0 1 1
A
MSB Data
A
C
K
N
A
K
S P
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Address Byte LSB Data
R
MCP9804 MCP9804
MCP9804
Master
Master
W
SDA
SCL
0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
Reading the CONFIG Register.
Note: It is not necessary to
select the register
pointer if it was set from
the previous read/write.
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)
//also, make sure bit 0 is cleared 0
i2c_write(0x01); // Write CONFIG Register
i2c_start(); // send Repeat START command
i2c_write(AddressByte | 0x01); //READ Command
//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
MCP9804
DS22203A-page 22 2009 Microchip Technology Inc.
5.1.2 UPPER/LOWER/CRITICAL
TEMPERATURE LIMIT REGISTERS
(T
UPPER
/T
LOWER
/T
CRIT
)
The MCP9804 has a 16-bit read/write Alert Output
Temperature Upper-Boundary register (T
UPPER
), a 16-
bit Lower-Boundary register (T
LOWER
) and a 16-bit
Critical Boundary register (T
CRIT
) that contains 11-bit
data in twos complement format (0.25C). This data
represents 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) and the ambient temperature exceeds
the specified boundary or window, the MCP9804
asserts an Alert output. (Refer to Section 5.2.3).

REGISTER 5-3: UPPER/LOWER/CRITICAL TEMPERATURE LIMIT REGISTER (T
UPPER
/T
LOWER
/
T
CRIT
) ADDRESS 0000 0010b/0000 0011b/0000 0100b (NOTE)
U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
Sign 2
7
C 2
6
C 2
5
C 2
4
C
bit 15 bit 8
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 U-0 U-0
2
3
C 2
2
C 2
1
C 2
0
C 2
-1
C 2
-2
C
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 15-13 Unimplemented: Read as 0
bit 12 Sign:
0 = T
A
0C
1 = T
A
< 0C
bit 11-2 T
UPPER
/T
LOWER
/T
CRIT
:
Temperature boundary trip data in twos complement format.
bit 1-0 Unimplemented: Read as 0
Note: This table shows two 16-bit registers for T
UPPER
, T
LOWER
and T
CRIT
located at 0000 0010b,
0000 0011b and 0000 0100b, respectively.
2009 Microchip Technology Inc. DS22203A-page 23
MCP9804
FIGURE 5-4: Timing Diagram for Writing and Reading from the T
UPPER
Register (See Section 4.0).
SDA
A
C
K
0 0 1 1
A
T
UPPER
Pointer
0 0 0 0
A
C
K
S
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SCL
0
Address Byte
A
C
K
0 0 1 1
A
MSB Data
A
C
K
N
A
K
S P
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Address Byte LSB Data
R
MCP9804 MCP9804
MCP9804
Master
Master
W
SDA
SCL
0 1 0
0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0
Reading from the T
UPPER
Register.
Writing 90C to the T
UPPER
Register <0000 0101 1010 0000>b.
SDA
A
C
K
0 0 1 1
A
0 0 0 0
A
C
K
S
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SCL
0
Address Byte
W
MCP9804 MCP9804
MSB Data
A
C
K
A
C
K
P
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
LSB Data
T
UPPER
Pointer
MCP9804 MCP9804
0 1 0
0 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0
Note: It is not necessary to
select the register
pointer if it was set from
the previous read/write.
MCP9804
DS22203A-page 24 2009 Microchip Technology Inc.
5.1.3 AMBIENT TEMPERATURE
REGISTER (T
A
)
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 (T
A
) that contains 13-bit temperature data in
twos complement format.
The T
A
register bits (bits 12 thru 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 T
A
register at t
CONV
refresh rate.
In addition, the T
A
register uses three bits (bits 15, 14
and 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); bit 15 is set to 1 if T
A
is greater than or
equal to T
CRIT
, bit 14 is set to 1 if T
A
is greater than
T
UPPER
and bit 13 is set to 1 if T
A
is less than T
LOWER
.
The T
A
register bit assignment and boundary
conditions are described in Register 5-4.

REGISTER 5-4: AMBIENT TEMPERATURE REGISTER (T
A
) ADDRESS 0000 0101b (NOTE 1)
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
T
A
vs. T
CRIT
T
A
vs. T
UPPER
T
A
vs. T
LOWER
SIGN 2
7
C 2
6
C 2
5
C 2
4
C
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
2
3
C 2
2
C 2
1
C 2
0
C 2
-1
C 2
-2
C 2
-3
C 2
-4
C
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 15 T
A
vs. T
CRIT
(Note 1)
Bit:
0 = T
A
< T
CRIT
1 = T
A
T
CRIT
bit 14 T
A
vs. T
UPPER

(Note 1)
Bit:
0 = T
A
T
UPPER
1 = T
A
> T
UPPER
bit 13 T
A
vs. T
LOWER

(Note 1)
Bit:
0 = T
A
T
LOWER
1 = T
A
< T
LOWER
bit 12 SIGN Bit:
0 = T
A
0C
1 = T
A
< 0C
bit 11-0 Ambient Temperature (T
A
) Bits:
(Note 2)
12-bit Ambient Temperature data in twos complement format.
Note 1: Bits 15, 14 and 13 are not affected by the status of the Alert output configuration (bits 5 to 0 of CONFIG)
(Register 5-2).
2: Bits 2, 1, and 0 may remain clear '0' depending on the status of the resolution register (Register 5-7).
The Power-up default is 0.25C/bit, bits 1 and 0 remain clear '0'.
2009 Microchip Technology Inc. DS22203A-page 25
MCP9804
5.1.3.1 T
A
bits to Temperature Conversion
To convert the T
A
bits to decimal temperature, the
upper three boundary bits (bits 15, 14 and 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 32C while the lower byte
contains data for temperature less than 32C, including
fractional data. When combining the upper and lower
bytes, the upper byte must be Right-shifted by 4 bits (or
multiply by 2
4
) 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 twos compliment format,
therefore, positive temperature data and negative
temperature data are computed differently. Equation 5-
1 shows the temperature computation. The example
instruction code outlined in Figure 5-5 shows the
communication flow, also see Figure 5-6 for timing
diagram.
EQUATION 5-1: BYTES TO
TEMPERATURE
CONVERSION
FIGURE 5-5: Example Instruction Code.
Where:
T
A
= Ambient Temperature (C)
UpperByte = T
A
bit 15 to bit 8
LowerByte = T
A
bit 7 to bit 0
Temperature

0C
Temperature < 0C
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)
//also, make sure bit 0 is cleared 0
i2c_write(0x05); // Write T
A
Register Address
i2c_start(); //Repeat START
i2c_write(AddressByte | 0x01); // READ Command (see Section 4.1.4)
//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){ //T
A
T
CRIT
}
if ((UpperByte & 0x40) == 0x40){ //T
A
> T
UPPER
}
if ((UpperByte & 0x20) == 0x20){ //T
A
< T
LOWER
}
UpperByte = UpperByte & 0x1F; //Clear flag bits
if ((UpperByte & 0x10) == 0x10){ //T
A
< 0C
UpperByte = UpperByte & 0x0F; //Clear SIGN
Temperature = 256 - (UpperByte x 16 + LowerByte / 16);
}else //T
A
0C
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)
MCP9804
DS22203A-page 26 2009 Microchip Technology Inc.

FIGURE 5-6: Timing Diagram for Reading +25.25C Temperature from the T
A
Register (See
Section 4.0).
SDA
A
C
K
0 0 1 1
A
T
A
Pointer
0 0 0 0
A
C
K
S
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SCL
0
Address Byte
A
C
K
0 0 1 1
A
MSB Data
A
C
K
N
A
K
S P
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Address Byte LSB Data
R
MCP9804 MCP9804
MCP9804
Master
Master
W
SDA
SCL
1 0 1
0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0
Note: It is not necessary to
select the register
pointer if it was set from
the previous read/write.
2009 Microchip Technology Inc. DS22203A-page 27
MCP9804
5.1.4 MANUFACTURER ID REGISTER
This register is used to identify the manufacturer of the
device in order to perform manufacturer specific
operation. The Manufacturer ID for the MCP9804 is
0x0054 (hexadecimal).


FIGURE 5-7: Timing Diagram for Reading the Manufacturer ID Register (See Section 4.0).
REGISTER 5-5: MANUFACTURER ID REGISTER (READ-ONLY) ADDRESS 0000 0110b
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Manufacturer ID
bit 15 bit 8
R-0 R-1 R-0 R-1 R-0 R-1 R-0 R-0
Manufacturer ID
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 15-0 Device Manufacturer Identification Bits
.
SDA
A
C
K
0 0 1 1
A
Manuf. ID Pointer
0 0 0 0
A
C
K
S
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SCL
0
Address Byte
A
C
K
0 0 1 1
A
MSB Data
A
C
K
N
A
K
S P
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Address Byte LSB Data
R
MCP9804 MCP9804
MCP9804
Master
Master
W
SDA
SCL
1 1 0
0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0
Note: It is not necessary to
select the register
pointer if it was set from
the previous read/write.
MCP9804
DS22203A-page 28 2009 Microchip Technology Inc.
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 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.


FIGURE 5-8: Timing Diagram for Reading Device ID and Device Revision Register (See Section 4.0).
REGISTER 5-6: DEVICE ID AND DEVICE REVISION (READ-ONLY) ADDRESS 0000 0111b
R-0 R-0 R-0 R-0 R-0 R-0 R-1 R-0
Device ID
bit 15 bit 8
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Device Revision
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 15-8 Device ID: Bit 15 to bit 8 are used for device ID
bit 7-0 Device Revision: Bit 7 to bit 0 are used for device revision
SDA
A
C
K
0 0 1 1
A
Device ID Pointer
0 0 0 0
A
C
K
S
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SCL
0
Address Byte
A
C
K
0 0 1 1
A
MSB Data
A
C
K
N
A
K
S P
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Address Byte LSB Data
R
MCP9804 MCP9804
MCP9804
Master
Master
W
SDA
SCL
1 1 1
0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0
Note: It is not necessary to
select the register
pointer if it was set from
the previous read/write.
2009 Microchip Technology Inc. DS22203A-page 29
MCP9804
5.1.6 RESOLUTION REGISTER
This register allows the user to change the sensor
resolution (see Section 5.2.4). The POR default
resolution is 0.25C. The selected resolution is also
reflected in the Capability register (see Register 5-2).


FIGURE 5-9: Timing Diagram for Changing T
A
Resolution to 0.0625C <0000 0011>b (See
Section 4.0).
REGISTER 5-7: RESOLUTION ADDRESS 0000 1000b
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 W = Writable bit U = Unimplemented bit, read as 0
-n = Value at POR 1 = Bit is set 0 = Bit is cleared x = Bit is unknown
bit 7-3 Unimplemented: Read as 0
bit 2-0 Resolution:
00 = LSB = 0.5C (t
CONV
= 30 ms typical)
01 = LSB = 0.25C (t
CONV
= 65 ms typical)
10 = LSB = 0.125C (t
CONV
= 130 ms typical)
11 = LSB = 0.0625C (power up default, t
CONV
= 250 ms typical)
SDA
A
C
K
0 0 1 1
A
A
C
K
S
2
A
1
A
0
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
SCL
Address Byte
W
MCP9804 MCP9804
A
C
K
P
1 2 3 4 5 6 7 8
Data
Resolution Pointer
MCP9804
0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1
MCP9804
DS22203A-page 30 2009 Microchip Technology Inc.
5.2 SENSOR FEATURE DESCRIPTION
5.2.1 SHUTDOWN MODE
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 I
SHDN
. It remains in this mode
until bit 8 is cleared 0 to enable Continuous
Conversion mode, or until power is recycled.
The Shutdown bit (bit 8) cannot be set to 1 while bits
6 and 7 of CONFIG (Lock bits) are set to 1. However,
it can be cleared 0 or returned to Continuous
Conversion while locked.
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.
5.2.2 TEMPERATURE HYSTERESIS
(T
HYST
)
A hysteresis of 0C, 1.5C, 3C or 6C can be selected
for the T
UPPER
, T
LOWER
and T
CRIT
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.
The hysteresis bits can not be changed if either of the
lock bits, bits 6 and 7 of CONFIG, are set to 1.
The T
UPPER
, T
LOWER
and T
CRIT
boundary conditions
are described graphically in Figure 5-11.
5.2.3 ALERT OUTPUT CONFIGURATION
The Alert output can be enabled using bit 3 of CONFIG
(Alert output control bit) and can be configured as
either a comparator output or as Interrupt Output mode
using bit 0 of CONFIG (Alert mode). The polarity can
also be specified as an active-high or active-low using
bit 1 of CONFIG (Alert polarity). This is an open drain
output and requires a pull-up resistor.
When the ambient temperature increases above the
critical temperature limit, the Alert output is forced to a
comparator output (regardless of bit 0 of CONFIG).
When the temperature drifts below the critical
temperature limit minus hysteresis, the Alert output
automatically returns to the state specified by bit 0 of
CONFIG.

FIGURE 5-10: Active-Low Alert Output
Configuration.
The status of the Alert output can be read using bit 4 of
CONFIG (Alert status). This bit can not be set to 1 in
shutdown mode.
Bit 7 and 6 of the CONFIG register can be used to lock
the T
UPPER
, T
LOWER
and T
CRIT
registers. The 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
temperature output using bit 2 of CONFIG (critical
output only). When this feature is selected, the Alert
output becomes a comparator output. In this mode, the
interrupt output configuration (bit 0 of CONFIG) is
ignored.
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-11 shows
the conditions that toggle the Alert output.
If the device enters Shutdown mode with asserted Alert
output, the output remains asserted during Shutdown.
The device must be operating in Continuous
Conversion mode for t
CONV
; the T
A
vs. T
UPPER
,
T
LOWER
and T
CRIT
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.
5.2.3.2 Interrupt Mode
In the Interrupt mode, the Alert output is asserted as
active-high or active-low (depending on the polarity
configuration) when T
A
drifts above or below T
UPPER
and T
LOWER
limits. The output is deasserted by setting
bit 5 (Interrupt Clear) of CONFIG. Shutting down the
device will not reset or deassert the Alert output. This
mode can not be selected when the Alert output is used
as critical temperature output only, using bit 2 of CONFIG.
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 CONFIG register from the MCP9804.
MCP9804
Alert Output
R
PU
V
DD
2009 Microchip Technology Inc. DS22203A-page 31
MCP9804
5.2.4 TEMPERATURE RESOLUTION
The MCP9804 is capable of providing a temperature
data with 0.5C to 0.0625C resolution. The Resolution
can be selected using the Resolution register
(Register 5-7) which is located in address
00001000b. It provides measurement flexibility. A
0.0625C resolution is set as POR default by factory.
TABLE 5-2: TEMPERATURE
CONVERSION TIME
Resolution
t
CONV
(ms)
Samples/sec
(typical)
0.5C 30 33
0.25C 65 15
0.125C 130 7
0.0625C
(Power-up default)
250 4
MCP9804
DS22203A-page 32 2009 Microchip Technology Inc.
FIGURE 5-11: Alert Output Condition.
T
UPPER
T
LOWER
A
l
e
r
t

O
u
t
p
u
t
T
CRIT
T
A
T
UPPER
- T
HYST
(
A
c
t
i
v
e
-
L
o
w
)
Comparator
Interrupt
S/w Int. Clear
Critical Only
T
CRIT
- T
HYST
1 2 3 4 5 6
TABLE 5-3: ALERT OUTPUT CONDITIONS
Note
Alert Output Boundary
Conditions
Alert Output T
A
Bits
Comparator Interrupt Critical 15 14 13
1 T
A
T
LOWER
H L H 0 0 0
2 T
A
< T
LOWER
- T
HYST
L L H 0 0 1
3 T
A
> T
UPPER
L L H 0 1 0
4 T
A
T
UPPER
- T
HYST
H L H 0 0 0
5 T
A
T
CRIT
L L L 1 1 0
6 T
A
< T
CRIT
- T
HYST
L H H 0 1 0
* When T
A
T
CRIT
and T
A
< T
CRIT
- T
HYST
the Alert output is Comparator mode and bits 0 of
CONFIG (Alert output mode) is ignored. Also, in Interrupt mode, if Interrupt Clear bit is not set
then when temperature drops below the critical limit (note 6), the Alert output remains asserted.
T
LOWER
-T
HYST
T
LOWER
-T
HYST
T
UPPER
- T
HYST
1 3 4 2
Note: *
2009 Microchip Technology Inc. DS22203A-page 33
MCP9804
5.3 Summary of Power-on Default
The MCP9804 has an internal Power-on Reset (POR)
circuit. If the power supply voltage V
DD
glitches below
the V
POR
threshold, the device resets the registers to
the power-on default settings.
Table 5-4 shows the power-on default summary for the
temperature sensor registers.
TABLE 5-4: 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
0C Hysteresis
0x02 T
UPPER
0x0000 0C
0x03 T
LOWER
0x0000 0C
0x04 T
CRIT
0x0000 0C
0x05 T
A
0x0000 0C
0x06 Manufacturer ID 0x0054 0x0054 (hex)
0x07 Device ID/ Device Revision 0x0200 0x0200 (hex)
0x08 Resolution 0x03 0x03 (hex)
MCP9804
DS22203A-page 34 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 35
MCP9804
6.0 APPLICATIONS INFORMATION
6.1 Layout Considerations
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 V
DD
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.
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.
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. A
temperature accuracy error of approximately 0.5C
could result from self-heating if the communication pins
sink/source the maximum current specified.
For example, if the Event output is loaded to maximum
I
OL
, Equation 6-1 can be used to determine the effect
of self-heating.
EQUATION 6-1: EFFECT OF
SELF-HEATING
At room temperature (T
A
= +25C) with maximum
I
DD
= 500 A and V
DD
= 3.6V, the self-heating due to
power dissipation T

is 0.2C for the DFN-8 package


and 0.5C for the TSSOP-8 package.

FIGURE 6-1: DFN Package Layout (Top View).
T

JA
V
DD
I
DD
V
OL_Alert
I
OL_Alert
V
OL_SDA
I
OL_SDA
+ + ( ) =
Where:
T

= T
J
- T
A
T
J
= Junction Temperature
T
A
= Ambient Temperature

JA
= Package Thermal Resistance
V
OL_Alert, SDA
= Alert and SDA Output V
OL
(0.4 V
max
)
I
OL_Alert, SDA
= Alert and SDA Output I
OL
(3 mA
max
)
SDA
SCL
Alert
GND
V
DD
A0
A1
A2
EP9
MCP9804
DS22203A-page 36 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 37
MCP9804
7.0 PACKAGING INFORMATION
7.1 Package Marking Information
8-Lead MSOP
Example:
XXXXXX
YWWNNN
9804E
933256
Legend: XX...X Customer-specific information
Y Year code (last digit of calendar year)
YY Year code (last 2 digits of calendar year)
WW Week code (week of January 1 is week 01)
NNN Alphanumeric traceability code
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.
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.
3 e
3 e
8-Lead DFN (2 x 3)
Example:
XXX
YWW
NN
AET
933
25
MCP9804
DS22203A-page 38 2009 Microchip Technology Inc.
8-Lead PIastic DuaI FIat, No Lead Package (MC) - 2x3x0.9 mm Body [DFN]
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package may have one or more exposed tie bars at ends.
3. Package is saw singulated.
4. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Units MLLMETERS
Dimension Limits MN NOM MAX
Number of Pins N 8
Pitch e 0.50 BSC
Overall Height A 0.80 0.90 1.00
Standoff A1 0.00 0.02 0.05
Contact Thickness A3 0.20 REF
Overall Length D 2.00 BSC
Overall Width E 3.00 BSC
Exposed Pad Length D2 1.30 1.55
Exposed Pad Width E2 1.50 1.75
Contact Width b 0.20 0.25 0.30
Contact Length L 0.30 0.40 0.50
Contact-to-Exposed Pad K 0.20
D
N
E
NOTE 1
1 2
EXPOSED PAD
NOTE 1
2 1
D2
K
L
E2
N
e
b
A3 A1
A
NOTE 2
BOTTOM VIEW
TOP VIEW
Microchip Technology Drawing C04-123C
2009 Microchip Technology Inc. DS22203A-page 39
MCP9804
8-Lead PIastic DuaI FIat, No Lead Package (MC) - 2x3x0.9 mm Body [DFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
MCP9804
DS22203A-page 40 2009 Microchip Technology Inc.
8-Lead PIastic Micro SmaII OutIine Package (MS) [MSOP]
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.15 mm per side.
3. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Units MLLMETERS
Dimension Limits MN NOM MAX
Number of Pins N 8
Pitch e 0.65 BSC
Overall Height A 1.10
Molded Package Thickness A2 0.75 0.85 0.95
Standoff A1 0.00 0.15
Overall Width E 4.90 BSC
Molded Package Width E1 3.00 BSC
Overall Length D 3.00 BSC
Foot Length L 0.40 0.60 0.80
Footprint L1 0.95 REF
Foot Angle I 0 8
Lead Thickness c 0.08 0.23
Lead Width b 0.22 0.40
D
N
E
E1
NOTE 1
1 2
e
b
A
A1
A2
c
L1 L

Microchip Technology Drawing C04-111B


2009 Microchip Technology Inc. DS22203A-page 41
MCP9804
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
MCP9804
DS22203A-page 42 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 43
MCP9804
Software License Agreement
The software supplied herewith by Microchip Technology Incorporated (the Company) is intended and supplied to you, the
Companys 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: I2C.h
Dependencies: I2C.c
Processor:PIC18 Microcontrollers
Complier: Microchip C18 (for PIC18) or C30 (for PIC24)
Company:Microchip Technology, Inc.
Software License Agreement:
The software supplied herewith by Microchip Technology Incorporated
(the Company) for its PIC Microcontroller is intended and
supplied to you, the Companys customer, for use solely and
exclusively on Microchip PIC Microcontroller products. 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 STATUTORY, INCLUDING, BUT NOT LIMITED
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
**************************************************************/
#define ACK 1
#define NACK 0
#define SLAVE_7 6 /* I2C Slave mode, 7-bit address */
#define SLAVE_10 7 /* I2C Slave mode, 10-bit address */
#define MASTER 8 /* I2C Master mode */
/* SSPSTAT REGISTER */
#define SLEW_OFF 0xC0 /* Slew rate disabled for 100kHz mode */
#define SLEW_ON 0x00 /* Slew rate enabled for 400kHz mode */
extern void OpenI2C(unsigned char sync_mode, unsigned char slew);
extern void I2CStart(void);
extern void I2CReStart(void);
extern void I2CStop(void);
extern unsigned char WriteI2C(unsigned char data_out);
extern unsigned char ReadI2C(unsigned char ACK);
extern void ACKI2C(void);
extern void nACK(void);
extern void WaitForACK(void);
extern unsigned char I2CDataReady(void);
MCP9804
DS22203A-page 44 2009 Microchip Technology Inc.
/********************************************************************
FileName: I2C.c
Dependencies: I2C.h
Processor:PIC18 Microcontrollers
Complier: Microchip C18 (for PIC18) or C30 (for PIC24)
Company:Microchip Technology, Inc.
Software License Agreement:
The software supplied herewith by Microchip Technology Incorporated
(the Company) for its PIC Microcontroller is intended and
supplied to you, the Companys customer, for use solely and
exclusively on Microchip PIC Microcontroller products. 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 STATUTORY, INCLUDING, BUT NOT LIMITED
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
**************************************************************/
#include"p18f2550.h" // This code is developed for PIC18F2550
//It can be modified to be used with any PICmicro with MSSP module
#include "I2C.h"
/********************************************************************
* Function Name: OpenI2C1 *
* Return Value: void *
* Parameters: SSP1 peripheral setup bytes *
* Description: This function sets up the SSP1 module on a *
* PIC18CXXX device for use with a Microchip I2C *
* EEPROM device or I2C bus device. *
********************************************************************/
void OpenI2C(unsigned char sync_mode, unsigned char slew)
{
SSPSTAT &= 0x3F; // power on state
SSPCON1 = 0x00; // power on state
SSPCON2 = 0x00; // power on state
SSPCON1 |= sync_mode; // select serial mode
SSPSTAT |= slew; // slew rate on/off
SSPCON1bits.SSPEN = 1; // enable synchronous serial port
}
/********************************************************************
* Function Name: I2CStart
* Return Value: void
* Parameters: void
* Description: *
********************************************************************/
void I2CStart(void)
{
PIR1bits.SSPIF = 0;//Clear Interrupt
SSPCON2bits.SEN=1;
while(!PIR1bits.SSPIF);//Wait for data received Interrupt
PIR1bits.SSPIF = 0;//Clear Interrupt
}
2009 Microchip Technology Inc. DS22203A-page 45
MCP9804
/********************************************************************
* Function Name: I2CReStart
* Return Value: void
* Parameters: void
* Description:
*
********************************************************************/
void I2CReStart(void)
{
PIR1bits.SSPIF = 0;//Clear Interrupt
SSPCON2bits.RSEN = 1;
while(!PIR1bits.SSPIF);//Wait for data received Interrupt
PIR1bits.SSPIF = 0;//Clear Interrupt
}
/********************************************************************
* Function Name: I2CStop
* Return Value: void
* Parameters: void
* Description: Stop bit
*
********************************************************************/
void I2CStop(void)
{
PIR1bits.SSPIF = 0;//Clear Interrupt
if (!SSPSTATbits.P)
{
SSPCON2bits.PEN = 1; //Stop condition
while(SSPCON2bits.PEN); //wait for STOP
if (PIR2bits.BCLIF)
PIR2bits.BCLIF = 0;
while(!PIR1bits.SSPIF); //Wait for flag to set
PIR1bits.SSPIF = 0;
}
}
/********************************************************************
* Function Name: WriteI2C2 *
* Return Value: Status byte for WCOL detection. *
* Parameters: Single data byte for I2C2 bus. *
* Description: This routine writes a single byte to the *
* I2C2 bus. *
********************************************************************/
unsigned char WriteI2C( unsigned char data_out )
{
SSPBUF = data_out; // write single byte to SSP2BUF
if ( SSPCON1bits.WCOL ) // test if write collision occurred
return ( -1 ); // if WCOL bit is set return negative #
else
{
while( SSPSTATbits.BF ); // wait until write cycle is complete
WaitForACK();//wait for ACK from device
return ( 0 ); // if WCOL bit is not set return non-negative #
}
}
MCP9804
DS22203A-page 46 2009 Microchip Technology Inc.
/********************************************************************
* Function Name: ReadI2C2 *
* Return Value: contents of SSP2BUF register *
* Parameters: ACK = 1 and NAK = 0 *
* Description: Read a byte from I2C bus and ACK/NAK *
********************************************************************/
unsigned char ReadI2C(unsigned char ACK)
{
while (SSPSTATbits.BF);
SSPCON2bits.RCEN = 1; // enable master for 1 byte reception
while (!SSPSTATbits.BF); // wait until byte received
if ACK //
ACKI2C(); // Give ACK
else
nACK();
return (SSPBUF); // return with read byte
}
/********************************************************************
* Function Name: AckI2C *
* Return Value: void *
* Parameters: void *
* Description: Initiate ACK bus condition. *
********************************************************************/
void ACKI2C(void)
{
PIR1bits.SSPIF = 0;
SSPCON2bits.ACKDT = 0; // set acknowledge bit state for ACK
SSPCON2bits.ACKEN = 1; // initiate bus acknowledge sequence
while(!PIR1bits.SSPIF);
PIR1bits.SSPIF = 0;
}
/********************************************************************
* Function Name: nACKI2C *
* Return Value: void *
* Parameters: void *
* Description: Initiate no-ACK bus condition. *
********************************************************************/
void nACK(void)
{
PIR1bits.SSPIF = 0;
SSPCON2bits.ACKDT = NACK; //Disable ACK
SSPCON2bits.ACKEN = 1; //Start ACK sequence
while(!PIR1bits.SSPIF); //Wait for flag to set
PIR1bits.SSPIF = 0;
}
/********************************************************************
* Function Name: WaitForACK
* Return Value: void
* Parameters: void
* Description: *
********************************************************************/
void WaitForACK(void)
{
PIR1bits.SSPIF = 0; //Clear Interrupt
while(!PIR1bits.SSPIF); //Wait for data received Interrupt
PIR1bits.SSPIF = 0;//Clear Interrupt
}
2009 Microchip Technology Inc. DS22203A-page 47
MCP9804
/********************************************************************
* Function Name: I2CDataReady *
* Return Value: Buffer Full (BF) flag *
* Parameters: void *
* Description: Checks if data is in the SSPBUF *
********************************************************************/
unsigned char I2CDataReady(void)
{
if (SSPSTATbits.BF) // test if buffer full bit is set
return ( +1 ); // data in SSP2BUF register
else
return ( 0 ); // no data in SSP2BUF register
}
MCP9804
DS22203A-page 48 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 49
MCP9804
APPENDIX B: REVISION HISTORY
Revision A (September 2009)
Original Release of this Document.
MCP9804
DS22203A-page 50 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 51
MCP9804
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.

Device: MCP9804: Digital Temperature Sensor
MCP9804T: Digital Temperature Sensor (Tape and Reel)
Temperature Range: E = -40C to +125C
Package: MC = Plastic Dual Flat No-Lead (DFN) 2x3, 8-lead
MS = Plastic Micro Small Outline (MSOP), 8-lead
PART NO. -X /XX
Package Temperature
Range
Device
Examples:
a) MCP9804-E/MC: Extended Temperature
8LD DFN package.
b) MCP9804-E/MS: Extended Temperature
8LD MSOP package.
c) MCP9804T-E/MC: Tape and Reel,
Extended Temperature
8LD DFN package.
d) MCP9804T-E/MS:: Tape and Reel,
Extended Temperature
8LD MSOP package.
X
Tape and Reel
Alternate Pinout
and/or
MCP9804
DS22203A-page 52 2009 Microchip Technology Inc.
NOTES:
2009 Microchip Technology Inc. DS22203A-page 53
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 buyers 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.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART,
rfPIC and UNI/O are registered trademarks of Microchip
Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial
Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified
logo, MPLIB, MPLINK, mTouch, Octopus, Omniscient Code
Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,
PICtail, PIC
32
logo, REAL ICE, rfLAB, Select Mode, Total
Endurance, TSHARC, UniWinDriver, WiperLock 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.
All other trademarks mentioned herein are property of their
respective companies.
2009, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
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 Microchips 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 Microchips 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.
Microchip received ISO/TS-16949:2002 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 Companys 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, Microchips quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
DS22203A-page 54 2009 Microchip Technology Inc.
AMERICAS
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://support.microchip.com
Web Address:
www.microchip.com
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Kokomo
Kokomo, IN
Tel: 765-864-8360
Fax: 765-864-8387
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
ASIA/PACIFIC
Asia Pacific Office
Suites 3707-14, 37th Floor
Tower 6, The Gateway
Harbour City, Kowloon
Hong Kong
Tel: 852-2401-1200
Fax: 852-2401-3431
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8528-2100
Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
China - Hong Kong SAR
Tel: 852-2401-1200
Fax: 852-2401-3431
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
ASIA/PACIFIC
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4080
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Malaysia - Kuala Lumpur
Tel: 60-3-6201-9857
Fax: 60-3-6201-9859
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
Taiwan - Hsin Chu
Tel: 886-3-6578-300
Fax: 886-3-6578-370
Taiwan - Kaohsiung
Tel: 886-7-536-4818
Fax: 886-7-536-4803
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
EUROPE
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
WORLDWIDE SALES AND SERVICE
03/26/09

You might also like