Tool/software:
Hi TI team,
I'm working with the INA228 and trying to use the ALERT pin to wake up an ESP32 from sleep when a bus undervoltage condition is detected.
According to the datasheet, I need to:
-
Set the undervoltage limit (
BUVL, register 0x0F) -
Enable the alert function in
ALERT_ENABLE(register 0x06, bit 3 = VBUS_UV) -
Enable the corresponding bit in
MASK_ENABLE(register 0x03, bit 3 = VBUS_UV) -
Globally enable the ALERT pin by setting bit 14 (
EN_ALERT) inMASK_ENABLE
The I2C write to MASK_ENABLE appears successful (endTransmission() returns 0), but when I read the register back, only bit 3 is set. Bit 14 remains cleared.
Here’s a minimal working example of the write:
Wire.beginTransmission(0x40);
Wire.write(0x03); // MASK_ENABLE
Wire.write(0x40); // MSB: bit 14 = EN_ALERT
Wire.write(0x08); // LSB: bit 3 = VBUS_UV
Wire.endTransmission();
// Read it back
Wire.beginTransmission(0x40);
Wire.write(0x03);
Wire.endTransmission(false);
Wire.requestFrom(0x40, 2);
uint16_t mask = (Wire.read() << 8) | Wire.read(); // Always returns 0x0008
I have tried this on 6 separate INA228 chips from the same reel, and all show the same behavior: EN_ALERT is never set, even though VBUS_UV is.
Other writes to INA228 registers work fine, and I've verified the same I2C code works with 16-bit writable registers on other devices (like MPU6050). So this appears to be specific to INA228.
Questions:
-
Is there any condition under which bit 14 (
EN_ALERT) inMASK_ENABLEcannot be set? -
Are there known silicon revisions or errata that could cause this behavior?
-
Does the INA228 require any other register configuration (e.g.
CONFIG,ALERT_LATCH, etc.) beforeEN_ALERTbecomes writable?
Any help or insight would be greatly appreciated. Thank you!
Best regards