PMIC (Power Management IC)
Charge voltage control reg
This is register REG04. It sets the charge voltage limit (VREG), the battery pre-charge to fast-charge threshold (BATLOWV), and the recharge threshold (VRECHG).
See also: batteryChargeVoltage() in the Power Manager API is the recommended way to set the charge voltage, since it also persists the setting and reapplies it at every boot.
setChargeVoltage()
bool setChargeVoltage(uint16_t voltage);
Voltage can be:
- 4112 (4.112 volts), the default
- 4208 (4.208 volts), only safe at lower temperatures
The default charge voltage is 4112, which corresponds to 4.112 volts.
You can also set it 4208, which corresponds to 4.208 volts. This higher voltage should not be used if the battery will be charged in temperatures exceeding 45°C. Using a higher charge voltage will allow the battery to reach a higher state-of-charge (SoC) but could damage the battery at high temperatures.
void setup() {
PMIC power;
power.setChargeVoltage(4208);
}
Note: Do not use 4208 with Device OS 0.4.8 or 0.5.0, as a bug will cause an incorrect, even higher, voltage to be used.
getChargeVoltageValue()
uint16_t getChargeVoltageValue();
Returns the charge voltage constant that could pass into setChargeVoltage, typically 4208 or 4112.
getChargeVoltage()
byte getChargeVoltage();
Returns the charge voltage register. This is the direct register value from the BQ24195 PMIC.
- 155, 0x9b, 0b10011011, corresponds to 4112
- 179, 0xb3, 0b10110011, corresponds to 4208
getRechargeThreshold()
uint16_t getRechargeThreshold();
Returns the recharge threshold (VRECHG, REG04 bit 0), in millivolts below the charge voltage limit at which the PMIC automatically starts a new charge cycle after the battery has been discharged from a full charge. This has no equivalent in the Power Manager API.
setRechargeThreshold()
bool setRechargeThreshold(uint16_t voltage);
Sets the recharge threshold. Valid values are 100 (the default) or 300 (millivolts below the charge voltage limit).