PMIC get/setInputCurrentLimit not setting correctly?

No, I mean like with wiring/battery/etc.? At the end of the day I’m not even able to get over like 0.25C charge rate in the best case scenario. I’d think charging at least 0.5-1C should be easily doable with a 2.5A power supply if everything was working properly.

@abatardi,
I agree, it would be nice to see a higher rate when bench testing w/ 2.5A PSU.
But 1 amp is higher than you’ll ever get from the 6-watt panel, correct ?

From Datasheet Section 8.3.1.3 Power Up from DC Source :

  • Checks VBUS, wait 220ms
  • Checks VBUS Voltage > 3.8V while pulling 30 mA, sets status register REG08[2] high
  • D+/D– Detection Sets Input Current Limit
    image
  • After the input current limit detection is done, the host can write to REG00[2:0] to change the input
    current limit.

I’m thinking it may be better to leave the PMIC alone for a few seconds after power-up before making any changes.
For Solar Panels, I think we need pmic.enableDPDM();

For your 2.5amp PSU, You can wait a few seconds after startup, then try :

  pmic.setInputCurrentLimit(2000) ;   // 2000 mA 
  pmic.setChargeVoltage(4208);        //  Set Li-Po charge termination voltage to 4.21V, CAUTION! not for everyone
  pmic.setChargeCurrent(0,1,1,0,0,0); // 2048 mA (1024 + 512 + 512 offset)
  pmic.setInputVoltageLimit(4200);    // just for bench testing....allows higher Voltage Differential for Reg. 
  pmic.enableDPDM(); 

In theory, you should see ~1.5 amps (per table 2, if D+/D- identifies the source as not being a USB host) , or maybe closer to 2 amps, IDK.
Naturally, the setInputVoltageLimit(4200) wouldn’t be optimal when you move back over to a Solar Panel.

Well, to be clear, this is for an application that will either be solar powered or hard wired. I can get over an amp with the input voltage set low like that, but then after a little bit it drops to < 500mA again (and VINDPM is set). But the PMIC will never recognize this as a “Charging port” (only as a USB host) unless I plug in a sacrificed microusb cable into the connector that has been cut and has the D+/D- wires twisted together to trick the BQ24195 into recognizing the input on VUSB pin as a charging port and not a USB host. Then the 6 & 7 bits of the system status register change from 01 to 10, and it seems to maintain the ~1A charge rate rather than drop back down to sub 500mA.

So other than building a little miniature board with a microusb connector on it with D+/D- bridged that I can pop into these, I don’t see any way to force the BQ24195 to recognize this as a charge port and not always a USB host.

1 Like

Looking over the PMIC and Boron Datasheets, it appears that the max input current is limited to 1.5 amps by hardware protection set by the ILIM Pin.

image

.

I could be misunderstanding this, but I figured I’d add it to this thread for safe keeping.

If So, there’s no reason to set the Register any higher than:
pmic.setChargeCurrent(0,0,1,1,1,0); // 1408 mA [0+0+512mA+256mA+128mA+0] + 512 Offset

My interpretation from what @abatardi observed:
If you have a Solar or PSU source that’s capable of more than 500 mA (and you want/need it), the data lines should be connected so the PMIC knows the source is not a USB host device.
The D+ and D- are generally the Green & White wires.

It appears 1.5 amps will be the maximum as a safety precaution.
image .

I think that setting pmic.setChargeCurrent(0,0,1,1,1,0); a few seconds after the VBUS and D+/D– Detection are performed should increase the 500mA to 1408 mA, without needing to tie the data wires. It may required repeated calls on a schedule for a Stand Alone Boron on Solar. I will try to confirm.

Any corrections or thoughts are appreciated.

1 Like

With another TI Charging chip I am using that has I2C communication it allows you to override the resister settings via writing a new charging limit via I2C.

They provide the resistor settings for charging parameters for applications where there is no Microcontroller to set the charging limits or as a fallback if the connected Microcontroller fails.

So from my experience and testing you can get higher charging current than the resistors are set to via programming new settings. This is probably why we have to write new charging settings in setup on every startup of the Microcontroller.

@Rftop - Oh my, good catch. I completely missed that. Perhaps I need to try a modified firmware and try to set some of these registers directly (ones that aren’t exposed now) as @RWB has implied might be possible. That was my next step anyway.

And yes, it seems like no matter what settings you give, it eventually does what it wants anyway… I had it publishing a bunch of register values today every few minutes while charging so I could watch it, and even with voltage/current/charge settings adjusted, at times I would see it seemingly ignore that completely (at least according to what the INA226 was reading)… as soon as you see the DPM flag get set in the status register (bit 3), it seems like all bets are off and it decides what is best for you. :slight_smile:

Per Datasheet :
During DPM mode (either VINDPM or IINDPM), the status register REG08[3] will go high

To me, that means your source (and/or it's path) is overloaded.
[Edit]: VINDPM being the culprit is supported by both of our tests, where we were able to get higher charging currents when we reduced the setInputVoltageLimit.

As soon as REG08[3] goes high, you could manually increase the PSU Voltage as a check.

  • Maybe there is a trace getting warm at these high currents, increasing resistance ?
  • Is there any way to read or measure the Vin at the PMIC?

The PMIC has a good reason to reduce the charging current, but it would be nice to figure out what the bottleneck is - even if we can't mitigate it. :wink:

See I took that to imply that I am getting put into IINDPM mode because ILIM got triggered, and it dropped it back down to a safety current or something. But you’re right, it could be a trace getting warm, but everything feels cool to the touch to me (a very scientific measurement technique, I know). I’m going to try and get around to more testing today but I have another project with a deadline that I’ve been ignoring, so I may have to shelve this for a bit. In any case, thanks for all your help thus far :slight_smile:

1 Like

If you don’t mind sending me your code, I’ll run some tests.
I’ll ramp up the Supply Voltage when REG08[3] goes high to confirm.

I’ve got to go do some paying work today, so it would be this weekend.

Very interesting experiments.
A search on TI E2E forum did not turn up something directly related, but they seem to listen and answer questions.

So this all seems directly related to the D+/D- pins and the BQ recognizing everything as a USB host and limiting it to 500mA. I was able to test this morning with a meter inline with the VUSB pin and just the following settings for PMIC:

pmic.setChargeVoltage(4208);
pmic.setInputVoltageLimit(4520);
pmic.setChargeCurrent(0,0,1,0,0,0); // 1024mA charge current

This is with a battery that reads around 50% full by the fuel gauge, voltage was around 3.85-3.9v

If I leave nothing in the microusb port of the Boron, I get around 466-467mA current draw.
If I plug a modified microusb cable in with D+/D- bridged and restart the device, I get 952mA.
Pull the microusb cable out and reboot, back to ~465mA
Plug back in, back to ~950mA

I checked the system status register and with the microusb cable out, it says the charge source is “01” which is USB Host. When I have the microusb cable plugged in with D+/D- bridged, I get “10” which is “adapter port”. I also tested with a 5v/2.5a microusb power supply plugged in (doesn’t have d+/d- lines) and it also identifies this as a USB Host.

I tested this with a solar panel as well and got the same results. Around 960-970mA in full sun, but dropping to 465mA without the modified usb cable plugged in (4.5v input voltage)

So there is something wrong with how the boron/bq24195 are recognizing the charge source, and any external supply plugged in through VUSB pin is getting recognized as a USB Host and limited to 500mA charge current.

Unfortunately when I set input voltage to 4840mv, it only pulls in around 256mA either way and makes no difference.

1 Like

@abatardi That’s good info. I think we’re getting close.
I’m getting 850 mA without touching the Data Wires. I’m powering the Boron w/ the USB Connector, since that’s how I’ll connect a Solar Panel in the field.
But connecting the Data wires and Restarting had no impact on my measurements, when using the USB connector for power.
I cut the USB cable that’s included with the Boron, and used the Black and Red Wires to power the Boron on it’s USB connector from a PSU.

HOWEVER, if I land my power on the V(USB) and Ground Pins, instead of using the USB connector; I get similar results as yours:
450 mA when D+/D- USB wires NOT connected
1030 mA when D+/D- USB wires ARE connected
So it matters where we land our Power Source.

[Back to my results from today using the USB connector]
I’m able to maintain 850mA charging using the following PMIC Settings and a PSU in Constant Voltage Mode on the USB Connector, charging a 10,000 mAh Li-po @ 3.90 resting voltage, Boron LTE 0.9.0 Manual Mode w/ Modem OFF drawing 7 mA, D+/D- USB wires not connected :

  pmic.setInputVoltageLimit(4200);    //  
  pmic.setInputCurrentLimit(2000) ;   // 2000 mA 
  pmic.setChargeVoltage(4208);        //  Set Li-Po charge termination voltage to 4.21V, CAUTION! not for everyone
  pmic.setChargeCurrent(0,0,1,1,1,0); // 1408 mA [0+0+512mA+256mA+128mA+0] + 512 Offset
  pmic.enableDPDM();  
  pmic.enableBuck();                

The PMIC will start to reduce the charging current if/when the VUSB drops to 4.35V (using pmic.setInputVoltageLimit(4200)). That’s not the supply voltage, but the measured operating voltage at the VUSB pin. I’m supplying power at the USB Connector.

V(PSU)    V(USB)   I(charging)   Notes
5.20V     4.35V      830 mA       This is where DPM kicks in and reduces charging current
5.40V     4.50V      850 mA       850mA appears to be the max for this particular setup
6.25V     5.30V      850 mA       Increasing Supply Voltage doesn't increase charging current beyond 850 MA

My assumption is that in the first line of the results, V(USB) = 4.35 is related to the setting pmic.setInputVoltageLimit(4200). I guess there is a small voltage reduction from V(USB) to the PMIC, because the Current gets reduced when V(USB) drops to slightly higher (~0.15V) than the setInputVoltageLimit setting.

I don’t know why 850 mA is the actual limit when everything “appears” to be good for 1408 mA.

I changed back to pmic.setInputVoltageLimit(5080); which should be the best available setting for a 6 Volt Solar Panel, and the charging current is still 850 mA :sunglasses:
I slowly reduced the Supply Voltage until the PMIC started to reduce the Charging Current.
The V(USB) was 5.20V when this happened, reinforcing the above results.
The Dynamic Power Management of the PMIC kicks-in when V(USB) falls to about 0.10 to 0.15 V above the set-point of pmic.setInputVoltageLimit(x)

I believe to rate any particular 6V Solar panel for a Boron, we’d check the current produced by the Panel at 5.20V, since that’s the highest “actual” Input Voltage that the firmware allows the PMIC to attempt to maintain in DPM when recharging via Solar. This rating would be limited to 4.4 watts maximum for the Boron LTE, per my results if connecting the solar Panel via the USB connector. The Boron LTE is still a good fit for a 6-watt panel if needed.

// This can provide (up-to) 850 mA of Charging Current on my test rig, using the USB connector:
  pmic.setInputVoltageLimit(5080);    // 6V Solar Panel, actual condition is ~ 5.20V for DPM
  pmic.setInputCurrentLimit(2000) ;   // 2000 mA, higher than req'd 
  pmic.setChargeVoltage(4208);        // Set Li-Po charge termination voltage to 4.21V, CAUTION: You MUST Monitor TEMP!
  pmic.setChargeCurrent(0,0,1,1,1,0); // 1408 mA [0+0+512mA+256mA+128mA+0] + 512 Offset
  pmic.enableDPDM();                  // This may be a default, and not req'd

/* Notes: When using pmic.setInputVoltageLimit(5080), the Boron LTE may no longer Boot when only powered from a USB port on some Computers.  
You will need to attach the Li-Po when re-flashing, etc, since some USB ports have trouble maintaining the Voltage when using this setting.   

It appears the charging current can be increased to 1000 mA if you don't use the USB connector, using V(USB) and GND Pins instead.
But you must tie the USB data lines (use a dummy usb connection) together for the PMIC to allow higher than 500 mA in this case. 
*/

Li-Po Charging Results for Boron LTE, when the source has sufficient Voltage & Current Capability:

  • 850 mA using a USB Cable/Connector for recharging, Red and Black wires Only
  • 450 mA using V(USB) and GND Pins for Recharging
  • 1000 mA using V(USB) and GND Pins for Recharging, using a dummy USB that connects the Data Lines together (Green and White).

Very nice, thank you for doing all that and posting. My application is going to be using the VUSB/GND pins to power the Boron, as we have a secondary PCB that will be used and the boron seated on that via the header pins. Basically something like this: https://store.ncd.io/product/feather-screw-terminal-for-particle-and-feather-modules/ but a modified version to include the INA226 we were testing with earlier to be able to track the input current. I guess we could power directly to the microusb port, but we’d lose that.

So right now the plan is just to buy some of these: https://www.amazon.com/gp/product/B07DWN9GNF/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&psc=1 and solder the data pins together and pop them into the boron microusb port.

I’m not sure if it would be possible to fix this via firmware, or if it would require a hardware change on the boron. For all I know this is a ‘feature’, although I can’t imagine the rationale behind that and why you’d want to artificially limit the input current via the header pins. Seems like a small design flaw. Hopefully one that can be fixed via software, but in the meantime, a 50 cent microusb connector and a blob of solder will be my solution. :-/

1 Like

I just measured the current through the Li-Po wire when using the NCD board you referenced.
Using pmic.setInputVoltageLimit(4840); since the NCD board maintains 5V to V(USB) :
The Source is 12V input to NCD board.

  • 530 mA into the Li-Po
  • 1030 mA into the Li-Po with USB Data wires connected and reboot.

FYI, looking at the schematic, there's a diode from the USB connector's power pin to Vin, which is what goes into the PMIC (Vbus pin). The Vusb connector pin is the same as Vin, i.e., it doesn't go through a diode to reach the PMIC (Vbus pin). The schematic doesn't say what kind of diode, but it's not a shottky symbol, so I suspect that explains the 0.5V-0.8V drop observed by @Rftop, specifically between what he labeled as V(PSU) vs V(USB).

Something that strikes me as interesting from the datasheet is:

The bq24195L, bq24195 follows battery charging specification 1.2 (bc1.2) to detect input source through USB D+/D– lines. After the input current limit detection is done, the host can write to REG00[2:0] to change the input current limit.

The interesting part being the "after...". This implies there's a way to override what it detects.

Another option could be to program the D+/D- pins on the nRF to be outputs and to game the detection that way. I believe that would require setting D+ LOW and D- HIGH.

Yet another thing that came up above is the external resistor on the ILIM pin that sets the input current limit. The datasheet says:

The actual input current limit is the lower value between ILIM setting and register setting (REG00[2:0]).

The schematic shows a 333Ohm resistor, which sets a limit of (1V/333Ohm)*530 = 1.6A

1 Like

@tve - thanks for the info -- correct me if I'm wrong but I don't believe the D+/D- lines actually go to the BQ chip, I think they go to the nRF directly (and are then maybe connected to the bq from there -- not sure)?

In terms of setting it after, we've tried changing the settings after a delay, as well as part of the loop and not just in setup, doesn't seem to make a difference, and yes you're correct it is maxed out at 1.6A regardless.

Another option could be to program the D+/D- pins on the nRF to be outputs and to game the detection that way. I believe that would require setting D+ LOW and D- HIGH.

Any idea how to do this? I'd give it a try. Currently my microusb connector w/ solder blob works but it's kind of ugly.

They do. Pins 2&3.

This is the response I finally got after weeks from Particle Support:

I tested on the Boron as well, and the results were the same as the E series, which is not surprising.

I was unable to get an actual charge current of more than 500 mA as measured by the current going into VUSB, regardless of the settings.

So, it seems there is no resolution there.

Woo! https://github.com/particle-iot/device-os/pull/1846

On the Boron I was seeing 800mA during Charging when the USB voltage was 5.45v. The higher voltage seems to increase charging current.