# MKR1310 Power issues - input current too low

Hi all, sorry in advance for the english, it's not my native language.

I am struggling with the new MKR1310 battery charger BQ24195L (same than on MKR 1010).

Problematic:
I wish to create a system self-sufficient in energy using a battery and charging it with a dynamo.
Before considering powering the MKR with the dynamo, I wanted to make sure the board can input enough current to :

1. fast-charge my battery (between 1 & 2A)
2. power my peripherals (500mA)

Current stage:
I must say I have been disapointed on both points. I haven't been able to measure more than :

1. 150mA of charging current
2. 250mA out of Vcc pin

I will try various things and post my outcomes here, but if someone have already figured-out the issue, feel free to help me

researches:
I first wanted to understand what components are involved in the power distribution and how they are wired together. I checked the schematic and saw that the USB signal always go through the BQ24195L charger and then through a 3.3V AP2112 regulator. After reading the datasheets, here are the interesting points I noticed:

• AP2112 regulator: can guarantee at least 600mA output current.
• BQ24195L charger: able to input enough current, but a current limit can be set with a resistor Rlim (set to 330 Ohms = 1,6A limit) or with REG0. The charge current can be set by REG2 and REG8 can indicate the charging phase. The charger is also able to communicate with it's power source via OTG to set a current limit.

Measurements:

1. I wired my 1800mAh LiPo battery with a multimeter in serie to measure the current flow. I made sure my battery was not fully charged or fully discharged to avoid being in the "precharge" or "charge termination" phases. At 3,8V, I could only measure a charge current of 150mA…

2. To measure the maximum output on Vcc pin, I thought "let's put a resistor between Vcc and Gnd and try smaller R values until I reach the current limit". I decided to try with 10R, 4.7R and 1R and to vary the power-source as well: my PCs USB3 or a 2A wall USB adapter, both with OTG cable or power-only cable. I never managed to measure more than 250mA. I could notice that there is effectivelly an OTG communication that impacts the current flow, cause when I plug a too small resistor (4.7 or 1R), my PC makes the USB peripheral detection sound and the current lower slightly.
I tried to plug the battery too, then I could climb to 1,2A with a 1R resistor. As the battery current goes through the 3.3V regulator too I interpret this as a proof that the limit is not set by the regulator but by the BQ24195L charger.
Finally, I've tried to power the MKR by the Vin port still using the 2A adapter, then I've been able to get 500mA with a 4.7R, but the current went down again to 250mA with a 1R resistor, so I don't know how to interprete that.

Do you agree with my analysis ? Anyone understand what is wrong ?

Computing:
I have been able to read the BQ24195L registers:
Register 0 = 0x37 Bits (0-7) : 00110111
Register 1 = 0x1B Bits (0-7) : 00011011
Register 2 = 0x00 Bits (0-7) : 00000000
Register 3 = 0x11 Bits (0-7) : 00010001
Register 4 = 0x9A Bits (0-7) : 10011010
Register 5 = 0x8A Bits (0-7) : 10001010
Register 6 = 0x03 Bits (0-7) : 00000011
Register 7 = 0x4B Bits (0-7) : 01001011
Register 8 = 0x2C Bits (0-7) : 00101100
Register 9 = 0x00 Bits (0-7) : 00000000

First we could see that the Reg0 sets an input current limit to 3A, so no issue on this side. The Reg8 effectivelly says that I am currently in "fast-charge" phase. The surprising thing is Reg2 which is supposed to set a charging current limit. I changed its value for the default 0x60 which is supposed to allow 2A charging current, but when I back to my measurements, I still have only 150mA...

I am really runing out of idea now... Is there anyone here who spotted something I've missed ? Can the arduino team come to my rescue ?