Home - Getting Started - Constructor - Initialization - Functions - Examples
deviceFound() - findFirstDevice() - address() - adc() - voltage() - percent() - version() - compensation() - sleep() - isSleeping() - wake() - reset() - quickstart() - alertIsActive() - clearAlert() - threshold()
threshold()
Description
Gets/sets the alert threshold. The value can be between 1% and 32%. The default is 4%.
Parameters
Get: None
Set: threshold :uint8_t
Returns
Get threshold : uint8_t
Set None
Example
This snippet of code increments the current threshold value.
void incrementThreshold()
{
uint8_t threshold = FuelGauge.threshold();
FuelGauge.threshold(++threshold);
Serial.print("The alert threshold has been incremented to "); Serial.print(FuelGauge.threshold()); Serial.println(",");
}
Notes
The MAX17043/MAX17044 have an interrupt feature that alerts a host microprocessor whenever the cell’s state of charge, as defined by the SOC register, falls below a predefined alert threshold set at address 0Dh of the CONFIG register. When an alert is triggered, the IC drives the ALRT pin to logic-low and sets the ALRT bit in the CONFIG register to logic 1. The ALRT pin remains logic-low until the host software writes the ALRT bit to logic 0 to clear the interrupt. Clearing the ALRT bit while SOC is below the alert threshold does not generate another interrupt. The SOC register must first rise above and then fall below the alert threshold value before another interrupt is generated. Note that the alert function is not disabled at IC powerup. If the first SOC calculation is below the threshold setting, an interrupt is generated. Entering Sleep mode does not clear the interrupt.
See also alertIsActive(), clearAlert()