Search This Blog

Dec 27, 2011

iMX508 battery charge issue

   Our customer's iMX508 board battery charge has problem when battery's voltage lower than 3.4v. Their PMIC is MC13892. With USB adapter connected, the board will boot up, u-boot will check battery's voltage, if battery's voltage lower than 3.5V, it will set charge current to 400mA. And then check real charge current whether higher than 300mA, if not, that mean MC13892 in trickle charge mode, which means charge current is about 80mA. It is MC13892 default setting for handling dad battery. At this situation, u-boot will shut down system and MC13892 will charge the battery in trickle charge mode. When battery voltage higher than 3.4V, MC13892 will turn on system, u-boot will check battery voltage and charge current, at this moment, the battery voltage is lower than 3.4V and charge current is still 80mA. And u-boot shut down the system again and MC13892 will power on system when battery voltage higher than 3.4V. It falls into infinite loop.
    I got information from MC13892 expert, we should wait for 2 seconds to measure the charge current after we set 400mA charge current in u-boot code. I add 2 seconds delay between setting charge current and get charge current. I got two result. If  I shorted D+/D-, after 2 seconds, I can see charge current increase to 400mA which let u-boot run and load kernel, every thing works find with battery charge function. But if I keep D+/D- floating, I cannot see charge current increase to 400mA after 2 seconds, it keep 80mA.
   I dump all 64 PMIC registers which two conditions. Only one meaningful difference in reg[6], bit 10 CHRGSE1BS is "0" when D+/D- shorted, CHRGSE1BS is "1" when D+/D- floating. So that is the key point. I checked MC13892 spec, there is description:
   "No distinction can be made between a USB Host or a wall charger. Therefore, when attaching a wall charger, the CHRGSE1B pin must be forced low as a charger attach indicator. The CHRGSE1B pin has a built-in weak pull-up to VCORE. In the application, this pin is preferably pulled low"
   So if the CHRGSE1B is high, the charge current will limited to no more than 100mA which consider USB current limitation. Let's check customer's SCH.

  We can see CHRGSE1B connect to iMX508 CHRG_DETB_TO_PMIC pin, this mean iMX508 checked status of USB cable and inform PMIC by the result. We don't need it, re-work the SCH, removed R27 and C14, change R64 to 0 ohm. Tested it again, we can see no matter D+/D- shorted or floating, the charge current can increase to 400 mA. So the charge function is working now. We will consult this result with MC13892 expert later to know what happens.