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.

BQ27510 Need help with writing data flash. Operation Configuration registr.

Other Parts Discussed in Thread: BQ27510, BQ27510-G1

Hello!

 I'm using bq27510 without external thermistor. I connected the resistance of 10K between the GND and the TS. Also connected 18K resistance between TC and BI / TOUT. I need to set a flag TEMPS register operation configuration in 0. I'm trying to rewrite the value in the data flash, but after writing the value and the checksum in BlockData and BlockDataCheckSum there was no transfer from BlockData to Data Flash. BQ is in unsealed mode.

I could not write the values in the data flash

Flags() = 0x0139

Status Control() = 0x0003

Battery voltage near 3.9V

Operation Configuration 0x0979. I need 0x0978.

if (w_1b_func(0x61,0x00)!= 0)  { I2C_error(); }//write value 0x00 into 0x61

 if (w_1b_func(0x3e,0x40)!= 0){ I2C_error();  }//write subclass 0x40 into 0x3e

 if (w_1b_func(0x3f,0x00)!= 0) { I2C_error(); }//write offset 0x00 into 0x3f

  if ( w_1b_func(0x41,0x78)!= 0) { I2C_error();}//write value 0x78 into 0x41

if (w_1b_func(0x60,0xCA)!= 0) { I2C_error(); }//write checksum.

What am I doing wrong?

I can't use EVM.

Sorry for my bad English.

  • hi Andrew,

     

    Your English is not bad.

     

    Your sequence is ok but make sure the checksum is calculated correct. Also write 0x78 in 0x41 and 0x09 in 0x40, then add 0x09, 0x78 and write the sum into 0x60. Please make sure you allow some delay in between each write, particularly on writing 0x0978.

     

    Thanks

    Ming

  • Hi Ming!

    Then I write 0x78 in 0x41 and 0x09 in 0x40 I can read these value from address 0x40 0x41 from DataBlock and they are 0x09 0x78. But then I write the value of checksum 0xCA and read it - it doesn't change. I get old value - 0xC9. And data doesn't transfer from datablock to data flash.

    Thanks for trying to help me.

  • Andrew,

    The checksum should be for 32 byte data only. How the 0xCA is calculated? Also make sure the reset of 32byte block is initialized to zero first. The checksum I got is 0x78+0x09 = 0x81.

     

    Ming

  • Ming,

    I read all data from blockdata and they are 09 79 04 2E 00 6E 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -checksum = C9

    If I write 0x78 into 0x41, checksum is CA. Checksum = FF - (least-significant byte of sum all data from blockdata)

    What should I do?

     

    Andrew

  • Andrew,

     

    If you want to only change 79 to 78, then the check sum is CA. After write 0x78 to 0x41, then write 0xCA to 0x60 so the command can execute. I have tested this procedure using EVSW I2C pro and successfully changed the op config form 0x0979 to 0x0978 without any issue.

     

    Thanks

    Ming

  • Ming, I try to write new value of ckechsum(CA) but checksum don't update. What can be the reason of this? What are required parametrs for good writing data flash? In datasheet I find only two conditions. The first condition is Voltage() must be more than Flash update voltage from data flash(2800mV). And the second condition is bq27510 must stay in unsealed mode. I meet the both conditions. Andrew.
  • Andrew, I am running out of ideas. Are you using EVSW? Can you update other DF item by directly change them using EVSW DataFlash screen?

     

  • Ming, I can't use EVSW. I can't update any information in data flash. Does bq27510 have bit that allow writing in data flash or special delays between writing? Information in Blockdatachecksum doesn't change after writing correct checksum for datablock.
  • Andrew,

    In the EVSW Data Flash screen, under the System Data tab, you should be able to click in one of the "Value" boxes next to the Block Data, type in a value, then hit the Enter key on your keyboard.  This will write the data to that location. 

    Can you do this or is it also not working for you?  Click Read All to confirm it was changed.

  • David Maxwell,

    I wrote in the first post here,that I can't use EVSW. I send I2C commands using AVR. That's why I can't use your special programs.

    It isn't working for me.
  • Andrew,

     

    are you still having problem with this? I can send you some sample code which is not using EVSW if you can send me your email address.

    Thanks

    Ming

  • Ming,

    I changed bq27510 on the other one and I could wrote into the data flash. But I don't know, What was the problem with the first bq27510. Thanks for help.

    P.S. Where can I find nominal of sensetive resistor in the data flash? I want to change it.

    Andrew.

  • Andrew,

     

    It sounds like the first bq27510 IC had been SEALED.  This means you can't write or read most of the dataflash locations. 

    Does this sound possible?

    Refer to pages 16 & 17 of the bq27510-G1 datasheet for more information about these access modes.

     

  • Andrew, i would like to answer your other question about changing the sense resistor value.  The sense resistor value is not directly programmed into any dataflash location.  Actually, when you do Pack Current Calibration using EVSW it will account for your sense resistor and the values stored in these two dataflash locations are changed:

    CC Gain and CC Delta

    If you can't use EVSW to do calibration, then there is no easy way documented to calibrate using your host.  One workaround for you is to apply a known current load and read the AverageCurrent() from the gauge.  Then modify the CC Gain and CC Delta until your AverageCurrent() matches your known current.

    I'm sorry there is not an easier way, but is there any way that you can solder some wires to the I2C bus and use EV2300 and EVSW to talk to your gauge?

    Remember that you don't need to calibrate every board in production.  Just take calibration data from 20-30 sample boards and then use that average data for your golden image.

  • David, First bq27510 was in unsealed and full access mode. There is no way to connect my bq with EVSW. What is type of function between Sense Resistor and AverageCurrent. How does this function depend on CC delta and CC Gain? Andrew.
  • Andrew,

     

    The sense resistor need to be calibrated and the calibrated value is store in the data flash as CC Gain and CC Delta. CC gain is to make the gain correction for current measurement. CC Delta is the calibration factor for capacity measurement.

     

    Thanks

    Ming

  • Ming, I cuoldn't find right values for CC Gain, CC Delta. I'm using 10mohms resistor. What are defaults values for 10mohms resistor? Andrew.
  • you have to go through the calibration process to get CC gain and CC delta updated. The app note in following link will provide more details on calibration.

     

    http://focus.ti.com/lit/an/slua449c/slua449c.pdf

    http://focus.ti.com/lit/an/slua544/slua544.pdf

     

    BR

    Ming