MCP9808 Alert 問題

作者 Jie 於 2017年04月19日 21:58:07
各位先進 好:

我照著MCP9808 溫度Sensor datasheet的範例去實做,發現無論TA高於或低於TUPPER Limit與TCRITICAL Limit,Alert都會觸發,
Alert會觸發是因為 TA vs. TCRIT bit 是 always High,請問 TA vs. TCRIT bit always High的原因是什麼?

附上相關暫存器的設定,請各位先進指點一二,謝謝您。


void writeConfig
()
{
   
StartI2C2(); // send START command
   
WriteMI2C2((MCP9808_I2CADDR_DEFAULT << 1) & 0xFE); //WRITE Command also, make sure bit 0 is cleared ‘0’
   
WriteMI2C2(MCP9808_REG_CONFIG); // Write CONFIG Register
   
WriteMI2C2(0x00); // Write data
   
WriteMI2C2(0x80); // Write data
   
StopI2C2(); // send STOP command
}
void writeTupper()
{
   
StartI2C2(); // send START command
   
WriteMI2C2((MCP9808_I2CADDR_DEFAULT << 1) & 0xFE); //WRITE Command also, make sure bit 0 is cleared‘0’
   
WriteMI2C2(CP9808_REG_UPPER_TEMP); // Write CONFIG Register
   
WriteMI2C2(0x04); // Write data   70 C
   
WriteMI2C2(0x60); // Write data
   
StopI2C2(); // send STOP command
}
void writeTlower()
{
   
StartI2C2(); // send START command
   
WriteMI2C2((MCP9808_I2CADDR_DEFAULT << 1) & 0xFE); //WRITE Command also, make sure bit 0 is cleared ‘0’
   
WriteMI2C2(MCP9808_REG_LOWER_TEMP); // Write CONFIG Register
   
WriteMI2C2(0x00); // Write data   0 C
   
WriteMI2C2(0x00); // Write data
   
StopI2C2(); // send STOP command
}
void writeTcrit()
{
   
StartI2C2(); // send START command
   
WriteMI2C2((MCP9808_I2CADDR_DEFAULT << 1) & 0xFE); //WRITE Command also, make sure bit 0 is cleared ‘0’
   
WriteMI2C2(MCP9808_REG_CRIT_TEMP); // Write CONFIG Register
   
WriteMI2C2(0x05); // Write data   80 C
   
WriteMI2C2(0x00); // Write data
   
StopI2C2(); // send STOP command
}

來自: http://www.microchip.com.tw/newbb/viewtopic.php?forum=2&topic_id=20624&post_id=74935