MCP9808
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
MCP9808 MCP9808
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
MCP9808
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’
// Write CONFIG Register
// send Repeat START command
//READ Command
i2c_write(0x01);
i2c_start();
i2c_write(AddressByte | 0x01);
//also, make sure bit 0 is set ‘1’
// READ 8 bits
UpperByte = i2c_read(ACK);
LowerByte = i2c_read(NAK);
i2c_stop();
//and Send ACK bit
// READ 8 bits
//and Send NAK bit
// send STOP command
FIGURE 5-3:
Timing Diagram for Reading from the Configuration Register (see Section 4.0 “Serial
Communication”).
© 2011 Microchip Technology Inc.
DS25095A-page 21