English
Language : 

MCP9804_12 Datasheet, PDF (21/52 Pages) Microchip Technology – ±0.25°C Typical Accuracy Digital Temperature Sensor
MCP9804
Reading the CONFIG Register:
SCL
SDA
1 2 34 5678
12345678
S
0
0
1
1
A
2
A
1
A
0
W
A
C
K
0
0
0
0
0
0
0
1
A
C
K
Note:
It is not necessary to
select the Register
Pointer if it was set
from the previous
read/write.
Address Byte
Configuration Pointer
MCP9804
MCP9804
SCL
SDA
1 2 34 5678
12345678
12345678
S
0
0
1
1
A
2
A
1
A
0
A
R
C
K
0
0
0
0
0
0
0
0
A
C
K
0
0
0
0
1
0
0
N
0 AP
K
Address Byte
MCP9804
MSB Data
Master
LSB Data
Master
Note: This is an example routine (see Appendix A: “Source Code”).
i2c_start();
i2c_write(AddressByte & 0xFE);
// send START command
//WRITE Command (see Section 4.1.4 “Address Byte”)
//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
FIGURE 5-3:
Timing Diagram for Reading from the Configuration Register (see Section 4.0 “Serial
Communication”).
© 2009-2012 Microchip Technology Inc.
DS22203C-page 21