5.2 Sensor Configuration Register (CONFIG)

The MCP9808 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.

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 Temperature Hysteresis (THYST). 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 (TA) holds the previous temperature data (see 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 Table 5-3 (see Alert Output Configuration).

Table 5-3. CONFIG: Configuration Register (→ address ‘0000 0001’b)
U-0U-0U-0U-0U-0R/W-0R/W-0R/W-0
THYSTSHDN
bit 15bit 8
R/W-0R/W-0R/W-0R-0R/W-0R/W-0R/W-0R/W-0
Crit. LockWin. LockInt. ClearAlert Stat.Alert Cnt.Alert Sel.Alert Pol.Alert Mod.
bit 7bit 0
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
-n = Value at POR‘1’ = Bit is set‘0’ = Bit is clearedx = Bit is unknown
15-11Unimplemented: Read as ‘0
10-9THYST: 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 Alert Output Configuration.)

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.

8SHDN: Shutdown Mode bit

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 Shutdown Mode).

7Crit. Lock: TCRIT Lock bit

0 = Unlocked. TCRIT register can be written (power-up default)

1 = Locked. TCRIT register can not be written

When enabled, this bit remains set to ‘1’ or locked until cleared by an internal Reset (Summary of Power-on Default).

This bit can be programmed in Shutdown mode.

6Win. 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 can not be written

When enabled, this bit remains set to ‘1’ or locked until cleared by a Power-on Reset (Summary of Power-on Default).

This bit can be programmed in Shutdown mode.

5Int. Clear: Interrupt Clear bit

0 = No effect (power-up default)

1 = Clear interrupt output; when read, this bit returns to ‘0

This bit can not be set to ‘1’ in Shutdown mode, but it can be cleared after the device enters Shutdown mode.

4Alert 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 can not 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’.

3Alert Cnt.: Alert Output Control bit

0 = Disabled (power-up default)

1 = Enabled

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, but the Alert output will not assert or deassert.

2Alert 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.

1Alert 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.

0Alert 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.

Figure 5-2. Timing Diagram for Writing to the Configuration Register (see Serial Communication).
Note: This is an example routine (see Appendix A Source Code).
i2c_start(); // send START command
i2c_write(AddressByte & 0xFE); //WRITE Command (see Table 3-2)
//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
Figure 5-3. Timing Diagram for Reading from the Configuration Register (see Serial Communication).
Note: It is not necessary to select the Register Pointer if it was set from the previous read/write.
Note: Note: This is an example routine (see Appendix A Source Code).
i2c_start(); // send START command
i2c_write(AddressByte & 0xFE); //WRITE Command (see Table 3-2)
//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