This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ4050: can not charge and discharge

Part Number: BQ4050
Other Parts Discussed in Thread: BQSTUDIO, EV2400,

I'm using STM32 and I2C to write config to BQ4050:

ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.gasGauging.design.designCapacitymAh.addr, 6000);
if(ret == false)
return ret;
ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.gasGauging.design.designVoltage.addr, 14400);
if(ret == false)
return ret;
ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.protections.OCD1.threshold.addr, 6000);
if(ret == false)
return ret;
ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.protections.OCD1.delay.addr, 6);
if(ret == false)
return ret;
ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.gasGauging.state.learnedFCC.addr, 4400);
if(ret == false)
return ret;
ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.settings.permanent.enablePFA.0);
if(ret == false)
return ret;
ret = BQ4050SetNumberCell(4u);

After finish init, I'm using BQStudio to read register:

 no erro in register but the XCHG & XDSG = disble

please support me, I don't know why.

  • Hi Ho,

    Upload your .gg file here.

    Thanks,

  • EVK.gg.csv

    please refer this file. I'm using 4S lion pin, each pin have 6000mAH

  • Hi,

    Refer to 4.12 of the TRM. Have you configured the cell count correctly?

    Your .gg shows chg and dsg are allowed (both low).

    Best,

  • yes, it's already configured to 4 cells ( CC0-CC1 = 1,1 )

    all PF, status, PF alert bit is 0, CHGFET=1, but XCHG, XDSH = 1

    Packet vol= 16800mV. Please check again gg file that I export when connect via I2C. Sorry, last file is original, when I no connect to my ECUEVK_After_connect_I2C.gg.csv

  • yes, it's already configured to 4 cells ( CC0-CC1 = 1,1 )

    all PF, status, PF alert bit is 0, CHGFET=1, but XCHG, XDSH = 1

    Packet vol= 16800mV. Please check again gg file that I export when connect via I2C. Sorry, last file is original, when I no connect to my ECU1104.EVK_After_connect_I2C.gg.csv

  • Hi,

    Have you programmed the correct chemID?

    Best,

  • I don't programmed this.

    this is my step: 

    1. I connect my battery with BQ4050-EVM 561 board, it's charge and discharge normally with BQ studio (setup CC0-CC1 = 4cells, FET_EN= 1 ) => XDSG, XCHG = 0

    2. I using STM32 ECU to write I2C same SMBus ( the code is in above )

    ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.gasGauging.design.designCapacitymAh.addr (0x444D), 6000);

    ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.gasGauging.design.designVoltage.addr (0x4451), 14400);

    ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.protections.OCD1.threshold.addr (0x44A0), -5000);

    ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.protections.OCD1.delay.addr (0x44A2), 6);

    ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.gasGauging.state.learnedFCC.addr (0x4100), 4400);

    ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.settings.permanent.enablePFA (0x44F5), 0);

    ret = BQ4050SetNumberCell(4u); // like  ret = BQ4050WriteFlash(BQ4050_ADDRESS, bq4050_dataFlash.settings.configuration.dAConfiguration.addr (0x457B), 0x03);

    3. remove my ECU and connect I2C line to BQ studio ( via EV2400 ), scan resgiter: XDSG, XCGH = 1 => can't charge/discharge by send command FET_EN = 1 ( CHGFET=1 is already )

  • Hi,

    Sorry about that chemID is for our impedance track gauges. Try this GPCCEDV

    Best,

  • Hi Nick

    you're meaning I must use this tool for update. if I only have ECU and I2C part, how can I do that?

    can you provide the default data of BQ4050-EVM 561 board to reset my EVM board? or .SREC file also.

    I want to confirm my Initialize source code have problem first

  • Refer to below image for loading defaults.

  • hi Nick

    I already did that, after Import default I write all, and click reset device button, the status is same ( XCHG&XDSG still 1 )

  • hi Nick

    when I disable FET_EN by send 0x22 command, after that, Set Charge/discharge by CHG_FET_TOGGLE/DIS_FET_TOGGLE it's can charge and discharge

    what is problem with this? in TRM, it said if FET_EN = 1, device automatic control

  • Wed Nov 11 14:05:44 ICT 2020
    
    Device Version Info = ffffffa5_ffffffff_ffffffa5
    BQZ Device Name = bq4050
    BQZ Firmware Version = 0_01
    
    Design Capacity = 6000
    Design Voltage = 14400
    Specification Info = 0x0031
    Manufacturer Date = 1980-1-1
    Serial Number = 0x0001
    Manufacturer Name = Texas Instruments
    Device Name = bq4050
    Device Chemistry = LION
    
    Sample,DateTime,ElapsedTime,ManufAccess,RemCapAlarm,RemTimeAlarm,BattMode,@Rate(@),@TimeFull,@TimeEmpty,@RateOK,Temperature,Voltage,Current,AvgCurr,MaxErr,RSOC,ASOC,SOH,RemCap,FullChgCap,RunTimeEmty,RunTimeEmty,AvgTimeFull,ChgCurr,ChgVolt,BattStat,CycleCnt,OpStatA,OpStatB,TempRange,ChgStat,GaugeStat,MfgStat,SafetyAlertAB,SafetyStatAB,SafetyAlertCD,SafetyStatCD,PFAlertAB,PFStatAB,PFAlertCD,PFStatCD,CellVolt1,CellVolt2,CellVolt3,CellVolt4,vBAT,vPACK,CellCurr1,CellCurr2,CellCurr3,CellCurr4,CellPower1,CellPower2,CellPower3,CellPower4,Power,AvgPow,IntTemp,TS1Temp,TS2Temp,TS3Temp,TS4Temp,CellTemp,FETTemp,CEDV_RC,DSGCap,CEDVThr,CEDVFltV,ChgDeficit,LogRowTime(ms),LogStatus
    1,2020-11-11 14:05:48,4.001,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16149,0,0,100,90,90,100,5366,6000,65535,65535,65535,0,0,0x00C0,0,0x6181,0x0000,0x08,0x0008,0x40,0x0250,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4071,4038,4018,4023,16156,16750,0,0,0,0,0,0,0,0,0,0,25.5,24.3,24.2,24.2,24.2,24.3,25.5,5366,0,0,0,0,775,SUCCESS
    2,2020-11-11 14:05:52,8.002,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16150,0,0,100,90,90,100,5366,6000,65535,65535,65535,0,0,0x00C0,0,0x6181,0x0000,0x08,0x0008,0x40,0x0240,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4071,4038,4018,4023,16156,16751,0,0,0,0,0,0,0,0,0,0,25.5,24.3,24.2,24.2,24.2,24.3,25.5,5366,0,0,0,0,757,SUCCESS
    3,2020-11-11 14:05:56,12.002,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16150,0,0,100,90,90,100,5366,6000,65535,65535,65535,0,0,0x00C0,0,0x6181,0x0000,0x08,0x0008,0x40,0x0240,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4071,4038,4018,4023,16157,16750,0,0,0,0,0,0,0,0,0,0,25.5,24.3,24.2,24.2,24.2,24.3,25.5,5366,0,0,0,0,757,SUCCESS
    4,2020-11-11 14:06:00,16.003,0x2187,300,10,0x6001,0,65535,65535,1,24.3,16660,618,110,100,90,90,100,5366,6000,65535,65535,346,3520,16400,0x0080,0,0x2187,0x0000,0x08,0x8008,0x10,0x0242,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4194,4163,4142,4163,16662,16708,612,613,615,600,257,255,255,250,1018,235,25.4,24.3,24.2,24.2,24.2,24.3,25.4,5366,0,0,0,0,789,SUCCESS
    5,2020-11-11 14:06:04,20.003,0x2187,300,10,0x6001,0,65535,65535,1,24.3,16662,603,229,100,90,90,100,5366,6000,65535,65535,166,3520,16400,0x0080,0,0x2187,0x0000,0x08,0x8008,0x10,0x0242,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4195,4163,4142,4163,16664,16710,603,606,607,592,253,252,251,246,1000,421,25.4,24.3,24.2,24.2,24.2,24.3,25.4,5367,0,0,0,0,791,SUCCESS
    6,2020-11-11 14:06:08,24.004,0x2187,300,10,0x6001,0,65535,65535,1,24.3,16663,594,318,100,90,90,100,5367,6000,65535,65535,123,3520,16400,0x0080,0,0x2187,0x0000,0x08,0x8008,0x10,0x0242,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4195,4163,4142,4163,16666,16709,593,595,597,583,249,248,247,243,988,559,25.4,24.3,24.2,24.2,24.2,24.3,25.4,5367,0,0,0,0,754,SUCCESS
    7,2020-11-11 14:06:12,28.004,0x6187,300,10,0x6001,0,65535,65535,1,24.3,16312,380,384,100,90,90,100,5368,6000,65535,65535,104,3520,16400,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0240,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4079,4047,4026,4032,16210,16750,10,14,10,1,4,6,4,0,138,605,25.4,24.3,24.2,24.2,24.2,24.3,25.4,5368,0,0,0,0,788,SUCCESS
    8,2020-11-11 14:06:16,32.005,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16170,3,296,100,90,90,100,5368,6000,65535,65535,130,0,0,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0240,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4076,4043,4023,4029,16177,16750,0,0,0,0,0,0,0,0,0,459,25.4,24.3,24.2,24.2,24.2,24.3,25.4,5368,0,0,0,0,754,SUCCESS
    9,2020-11-11 14:06:20,36.006,0x4181,300,10,0x6001,0,65535,65535,1,24.3,16167,0,225,100,90,90,100,5368,6000,65535,65535,169,0,0,0x0080,0,0x4183,0x0000,0x08,0x8008,0x10,0x0244,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4075,4043,4022,4028,16174,16751,0,0,0,0,0,0,0,0,0,349,25.3,24.3,24.2,24.2,24.2,24.3,25.3,5368,0,0,0,0,752,SUCCESS
    10,2020-11-11 14:06:24,40.006,0x4183,300,10,0x6001,0,65535,65535,1,24.3,16165,0,171,100,90,90,100,5368,6000,65535,65535,222,0,0,0x0080,0,0x4183,0x0000,0x08,0x8008,0x10,0x0244,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4075,4042,4021,4027,16171,16751,0,0,0,0,0,0,0,0,0,266,25.4,24.3,24.2,24.2,24.2,24.3,25.4,5368,0,0,0,0,755,SUCCESS
    11,2020-11-11 14:06:28,44.007,0x4183,300,10,0x6001,0,65535,65535,1,24.3,16164,3,130,100,90,90,100,5368,6000,65535,65535,292,0,0,0x0080,0,0x4183,0x0000,0x08,0x8008,0x10,0x0244,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4074,4042,4021,4027,16171,16751,0,0,0,0,0,0,0,0,0,202,25.3,24.3,24.2,24.2,24.2,24.3,25.3,5368,0,0,0,0,754,SUCCESS
    12,2020-11-11 14:06:32,48.008,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16162,0,99,100,90,90,100,5368,6000,65535,65535,383,0,0,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0240,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4074,4042,4021,4026,16168,16750,0,0,0,0,0,0,0,0,0,154,25.3,24.3,24.2,24.2,24.2,24.3,25.3,5368,0,0,0,0,765,SUCCESS
    13,2020-11-11 14:06:36,52.009,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16162,0,75,100,90,90,100,5368,6000,65535,65535,506,0,0,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0240,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4074,4041,4020,4026,16168,16752,0,0,0,0,0,0,0,0,0,117,25.3,24.3,24.2,24.2,24.2,24.3,25.3,5368,0,0,0,0,751,SUCCESS
    14,2020-11-11 14:06:40,56.010,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16161,0,57,100,90,90,100,5368,6000,65535,65535,665,0,0,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0240,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4074,4041,4020,4026,16168,16750,5,8,1,-13,2,3,0,-5,5,89,25.3,24.3,24.2,24.2,24.2,24.3,25.3,5368,0,0,0,0,748,SUCCESS
    15,2020-11-11 14:06:44,60.010,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16160,3,44,100,90,90,100,5368,6000,65535,65535,862,0,0,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0250,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4074,4041,4020,4026,16166,16751,0,0,0,0,0,0,0,0,0,68,25.3,24.3,24.2,24.2,24.2,24.3,25.3,5368,0,0,0,0,751,SUCCESS
    16,2020-11-11 14:06:48,64.011,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16159,0,33,100,90,90,100,5368,6000,65535,65535,1149,0,0,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0250,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4073,4041,4020,4026,16165,16752,0,0,0,0,0,0,0,0,0,52,25.3,24.3,24.2,24.2,24.2,24.3,25.2,5368,0,0,0,0,750,SUCCESS
    17,2020-11-11 14:06:52,68.011,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16159,0,25,100,90,90,100,5368,6000,65535,65535,1517,0,0,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0250,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4073,4041,4020,4026,16165,16751,0,0,0,0,0,0,0,0,0,39,25.3,24.3,24.2,24.2,24.2,24.3,25.3,5368,0,0,0,0,746,SUCCESS
    18,2020-11-11 14:06:56,72.011,0x6181,300,10,0x6001,0,65535,65535,1,24.3,16158,3,19,100,90,90,100,5368,6000,65535,65535,1996,0,0,0x0080,0,0x6181,0x0000,0x08,0x8008,0x10,0x0250,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,4073,4040,4020,4026,16165,16750,0,0,0,0,0,0,0,0,0,30,25.2,24.3,24.2,24.2,24.2,24.3,25.2,5368,0,0,0,0,761,SUCCESS
    

    please refer the logging

  • Hi Ho,

    So to confirm you are able to charge and discharge now?

    Best regards,

  • Hi Nick

    Its only charge&discharge when you disable FET_EN bit and write CHG_FET_TOGGLE. But if enable FET_EN bit, its not charge

  • The PRES pin has to be asserted (Pulled to ground) to turn on the FETs once FET_EN is set, unless the pack is configured as a non-removable pack.
    To configure the pack as a non-removable pack you will have to set the [NR] bit (Bit2 in "DA Configuration" under "Settings" in the Data Memory.

    Best regards,

  • Hi Nick

    this PIN already connected to GND. The status of ManufatureStatus PRES bit is 1 now

  • hi Nick, 1 more points I see:

     I see in sluuqa3.pdf page 128 have GAUGE_EN bit

    but in BQ studio, in Setting:

    what's wrong now?

  • Hi,

    Follow the instruction here to upload images. 

    Best regards,

  • in sluuqa3 page 128

    but in BQ studio, in Setting Data Flash

    And status of PRES in my side is already LOW

    please support me to find the reason

    1 more point: in BQ4050-EVM 561 manual, in Firmware update, I see the bq4050_xx_22.srec. if possible, could you please give this SREC file to write default value to data flash

    thanks

  • Hi,

    not sure what your asking, please clarify.

    Best regards,

  • hi Nick, my question is :

    1. if I disable FET_EN, send command CHG_FET_TOGGLE, BQ4050-EVM 561 can charge, send command DSG_FET_TOGGLE, BQ4050-EVM 561 can discharge. But when I enable FET_EN, it's not charge/discharge. The PRES pin is already pulled to GND ( PRES status is 1). No error in PF bit, same in Status Alert, PF Alert. See the picture below ( I don't know why XCHG&XDSG bit alway 1 )

    2. In TRM (sluuaq3.pdf file) page 128, the manufacture status init data flash have GAUGE_EN bit, but why in BQ studio software, don't have this bit?

    please see in picture below

    3. in BQ4050EVM-561 user manual (sluubf9) , in 3.5 Firmware Screen, could you please give me bq4050_v0_01_build_22.srec. I want to reset Dataflash to default by write this file

      

    thank you very much

  • Hi Ho,

    Upload the current .gg and I will take a look, also can you upload image showing all bit registers.

    No need for a new srec and you can reset defaults within bqstudio.

    Best regards,

  • Hi Nick, please refer gg file here

    4606.EVK_After_connect_I2C.gg.csv

    and the picture of register is below

  • Hi,

    can you upload an image showing all bit register, the bottom are missing.

    Thanks,

  • Hi Nick

    please refer the picture below

  • Hi Ho,

    I loaded your config and everything working ok. Make sure to pull sys-press to pack -  if NR bit is 0.

    Can also try sending the reset command.

    Best regards,

  • Hi Nick

    I try to export srec file from another evk, after that import srec file to my board, it's can charge

    maybe the I2C command wrong