Re: MCP9808 Alert 問題

作者 Jie 於 2017年04月20日 16:40:38
Adam Syu 您好:


我有將Bit3, Alert Output Control Bit打開,Alert腳位確實有觸發,謝謝。


當 Alert Output Control Bit 打開,TA < TUPPER Limit 與 TA < TCRITICAL Limit 時,
請問為什麼Alert腳位還是會觸發?

我測量到TA(26度C)是 小於TUPPER Limit(70度C); 小於TCRITICAL Limit(80度C); 也大於TLOWER Limit(0度C),
而且用示波器量波形發現是 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);
   
WriteMI2C2(0x08); // Alert Output Control Bit set 1
   
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=74945