I am currently powering mkr 1500 via powerbank using usb port. But the CHRG indicator is always blinking. I would like to disable Li-Po charging circuit. How can I do it? How much power is consumed when no Li-Po battery is connected and CHRG indicator continously blinks?
Hi abnair,
I recently posted about this here: MKR NB 1500 charge light flashing powered by VIN - MKR Family / MKRNB1500 - Arduino Forum
I'm also looking for a way to disable the charge light, I'll be able to do a bit more digging over the coming weeks and will post back here if I find anything.
You can disable charging by setting bit 4&5 of REG01 to zero through I2C of the bq24195L. The problem is that the arduino core handles some of these settings, so you have to set them after the arduino core initializes the bq24195L.
#define PMIC_REG07 0x07
static inline void enable_battery_charging() {
PERIPH_WIRE.initMasterWIRE(100000);
PERIPH_WIRE.enableWIRE();
pinPeripheral(PIN_WIRE_SDA, g_APinDescription[PIN_WIRE_SDA].ulPinType);
pinPeripheral(PIN_WIRE_SCL, g_APinDescription[PIN_WIRE_SCL].ulPinType);
PERIPH_WIRE.startTransmissionWIRE( PMIC_ADDRESS, WIRE_WRITE_FLAG );
PERIPH_WIRE.sendDataMasterWIRE(PMIC_REG01);
PERIPH_WIRE.sendDataMasterWIRE(0x1B); // Charge Battery + Minimum System Voltage 3.5V
PERIPH_WIRE.prepareCommandBitsWire(WIRE_MASTER_ACT_STOP);
PERIPH_WIRE.disableWIRE();
}
static inline void set_voltage_current_thresholds() {
PERIPH_WIRE.initMasterWIRE(100000);
PERIPH_WIRE.enableWIRE();
pinPeripheral(PIN_WIRE_SDA, g_APinDescription[PIN_WIRE_SDA].ulPinType);
pinPeripheral(PIN_WIRE_SCL, g_APinDescription[PIN_WIRE_SCL].ulPinType);
This is the part of variant.cpp that enables charging.
abnair
June 24, 2021, 12:33pm
6
Thank you @zbelding . I will try your suggestion and post the results.
This seems to be working (stop 'STAT' LED flashing after 60 minutes)
opened 12:03AM - 27 May 21 UTC
type: enhancement
topic: code
Hi All,
Lately I work with Arduino MKR WAN 1310 board.
I power it up from US… B and do not use a battery charger.
After a boot up a charge LED (the orange one) is off and it stays off only for an hour and it starts blinking ;)
I read many other peoples' posts that they encounter the same problem and no one know what causes it.
I dug a little bit and I found that in the BQ24195's documentation:
> The safety timer is 1 hour when the battery is below BATLOWV threshold. The user can program fast charge safety timer through I2C (REG05[2:1]). When safety timer expires, the fault register REG09[5:4] goes 11 and an INT is asserted to the host. The safety timer feature can be disabled via I2C (REG05[3]).
>
> The following actions restart the safety timer:
>
> - At the beginning of a new charging cycle
> - Toggle the CE pin HIGH to LOW to HIGH (charge enable)
> - Write REG01[5:4] from 00 to 01 (charge enable)
> - Write REG05[3] from 0 to 1 (safety timer enable)
I assume when there is no battery connected the battery voltage indeed is below BATLOWV and after an hour the charge LED starts blinking (1Hz).
Currently I disabled it locally by zeroing third (3) bit in `CHARGE_TIMER_CONTROL_REGISTER` in `disableWatchdog` function:
```cpp
bool PMICClass::disableWatchdog(void) {
int DATA = readRegister(CHARGE_TIMER_CONTROL_REGISTER);
if (DATA == -1) { return 0; }
return writeRegister(CHARGE_TIMER_CONTROL_REGISTER, (DATA & 0b11000110));
}
```
I changed `0b11001110` into `0b11000110` and right now I can wait as long as I want, and no LED is blinking at me ;)
Would you be so kind to include such an option in the library itself? :)
Best regards
system
Closed
October 25, 2021, 6:53am
8
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.