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.

BQ27742-G1: Issue In Bq27742-G1 To write set capacity into flash

Part Number: BQ27742-G1
Other Parts Discussed in Thread: ENERGIA, MSP430G2553, BQ27441-G1, BQSTUDIO

Hello Tech Support,

Currently I’m Working On BQ27742-G1  Fuel Gauge. My battery configuration is 3.7 v 4400 mAh.
I have made sample code on MSP430 board using ENERGIA IDE.

I'm successfully CONNECTED To BQ27742-G1 using MSP430g2553 Launchpad.

I'm successfully write and Read some data as per below table. 

Command 

    Read / Write

Hex or Data

Device ID  

     WRITE : DEVICE_TYPE   

   0x01

READ : DEVICE_TYPE

 0x0742

State Of Charge

 WRITE

0x2C 

READ  

  64 (%)

Voltage 

WRITE  

0x08 

READ  

3948 (millivolt)

 

Then after i'm try to set capacity of Battery to 4400 mAh So , i'm trying to write Extend data

 

offset =10  , data = 4000

 

Unseal the IC

 

i2cWriteBytes( 0x00 , 0x13 , 2)       //config cca in control mode// arg (address, data, byte)

 

 i2cWriteBytes(0x61, 00, 1)             //enable block data memory control

 

i2cWriteBytes(0x3e, 82, 1);         //Write class ID using DataBlockClass

 

i2cWriteBytes(0x3f, (offset/32), 1);    // Write 32-bit block offset (usually 0)

 

i2cWriteBytes(offset + 0x40,&data , 2);   // Write class ID using DataBlockClass()

seal the Ic

 

 

 

 

 

 

 

Hardware schematic as shown above.
when i'm applying  vcc to pack+ my device is started and  i get the vcc voltage at Pack+  then after i'm successfully read data.

But when i'm writing data the ic pack+ voltage level to 0 v.

In this case i have question that if I’m unseal the ic  voltage avail at pack+ or not.??



Thanks and regards
kalarav

 

 

 

 

 

  • Hi Kalarav,

    You want to apply power to the VPWR pin while programming (preferably through the battery header instead of the Pack+ pin). Make sure to write the updated checksum (0x60) after writing the new capacity. After programming check your flags register if CHG and DSG are set or cleared.

    Best Regards,
    Ben Lough
  • Hello Benjamin, 

    Thanks a lot for response.

    Right Now i'm giving supply from Battery pack already. but not getting output +vcc directly to pack+ if i'm provide vcc voltage to +pack manually thereafter pack+ give vcc output same as battery voltage level.

    I want to change "Design Energy Scale " through I2c interface.

    When I'm Trying to write Data into control()  (address 0x00)   (data (0x13))  after that device is not giving acknowledgement.

    and output  of voltage level at Pack+ down To the 0 Volt. 

    i have question that after write to the control()  (address 0x00)  to 0x13 to Q max update fuel gauge is in sleep mode or working in normal mode.

    when i'm  writing 0x13 it is going to sleep as per datasheet register description so after sleep mode we can communicate over i2c or not.

    if i'm going to write only 0x03 in this register so there after i can update the Design Energy Scale " through I2c interface.

    if yes  how it is possible in simple manner please guide me.

    i have attached zip file of CCS Project .which code is made in energia. 



    thanks & Regads
    Kalarav
    BQ27441_Basic_BATTERY.zip

  • Hi Kalarav,

    On the bq27742, writing 0x0013 to the control register is actually the SET_SHUTDOWN command. The code in your .zip is for a bq27441-G1 which is a different gauge. Some of the commands are similar between the two gauges, but many are different.To modify Design Energy Scale, you want to access Subclass 48 (0x30), Offset 23.

    Best Regards,
    Ben Lough
  • Hello Benjamin,

    Thank you for response.

    I have some doubts in accessing data flash like, after the unsealing press of fuel gauge.

    There is requirement of any kind of bit setting like CFG_UPDATE in bq27441 ?.

    if yes then how to done to modify Design Capacity in bq27742-g1.?

    I want to modify Design Capacity also , so access Subclass 48 (0x30), Offset 12. after updating that value require the soft reset or not.?

    after modifying Design Capacity value can read the value which is entered by host from 0x3c address.?

    Thanks & Regards
     Kalarav

  • Hello Technical Support ,

    I am Successfully Read Data like Voltage , SOC , Remaining capacity. but i can't able write set capacity into flash please provide me some steps write set capacity into flash using Micro controller as a host.i'm using MSP430g2553 as a host Micro controller.

    bq-27742-g1 have Impedance track algorithm how it would be helpful to me. how it is worked for me.

    thanks in advance.

    best regards
    kalarav
  • Hi Kalarav

    My attached snap shot shows two methods for updating the design capacity.

    The first method is as follows:

    The subclass id for design capacity on the gauge i am testing on (bq27520) is 0x30.  The offset for design capacity is 10. The  data flash command code is 0X3E. Block data checksum is 0X60. in example data flash design capacity was 20000. in hex 4E 20. I am changing to 20001.My checksum of the data block is 97. In hex that would be 4E 21. My checksum i calculated would be 96

    W 3E 30 00

    W 4A 4E 21

    W 60 96.

    The other option would be to write the entire block data (block data is from 0x40 to 5F), and then write the new calculataed check sum . This method is useful if multiple parameters within the same block of data needs to be  changed.

    W 30 00

    W 40 entire data block with the changed parameter

    W 60 96

    I have attached an excel document for calculating the check sum of data blocks.

    DataFlash_write_checksumcalculator.xls

    thanks

    Onyx

  • Hello, onyx

    Thanks a lot for response.
    as per your suggestion i'm successfully write design capacity and Read same from its address.

    i want to know about impedance track algorithm . how it is useful for me .

    Right now i'm Controlling fuel gauge Using MSP430G2553 Launchpad As A host. but we will going to manufacture our product in bulk so there is requirement of any EVM With bqstudio when we are in production phase. ?

    Best Regards
    Kalarav
  • the EVM is useful for evaluation of your battery and application. It allows you perform chem id identification and learning cycle, afterwhich you can extract your golden srec or dffs file and program multiple devices. You will have to write code to do the mass programming using your host.

    thanks
    Onyx