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.

BQ27220: Technical Reference Manual (sluubd4) is missing "Extended Data Commands" chapter

Part Number: BQ27220
Other Parts Discussed in Thread: BQ27441-G1,

There are alot of references in the TRM to extended data commands in chapter 5, but that chapter seems to be missing: 

If I look at a TRM for another gauge,e.g. bq27441-G1, the chapter is there: 

Are they identical, i.e. can I look at the Extended Data Commands for the bq27441-G1?

Thanks,

Mark

  • Hi Mark,

    I am checking to see if those commands were actually stripped out which I suspect they were. In the meanwhile can you also do the same.

    thanks

    Onyx

  • Hi Onyx.

    I talked to our FAE and he I should look at the TRM of the bq27621 which is very similar to the bq27220, which I did.

    There, I found a clear description of the subcommands (p22), especially the 0x3E DataClass() is mentioned. In the bq27220 manual, the 0x3E command is nowhere explicitly described, but only mentioned at several places with "write 0xXX to 0x3E".

    Also, there is no table with subclass IDs like for the bq27621 on pp.26. Instead each memory has an explicit address (pp.28). Does this mean that I don't need to start at the beginning of a subclass, but can transfer an arbitrary block of 32 bytes by using the explicit memory address? (at least it looks like this from the example on p.65, where memory address for "Design Capacity" is set as the start of the BlockData, but on page 30 you can see that it's not the start of the "Gas Gauging" -> "CEDV Profile 1" class / subclass.)

    But maybe I'm just confused, because the description on how to access the data memory on p.27 and the example on p.65 don't seem to match. In addition, these to sections talk about BlockData(), while on page 25. the same command is called MACData.

    Thanks for some clarification (or maybe an updated TRM),
    Mark
  • The bq27220's data memory isn't accessed the exact same way as other gauges like the bq27621.

    It doesn't use the data class/block structure but instead it uses direct addressing. The access method is as follows:

    You write the address to registers ("commands") 0x3E/3F followed by the data for this address (for comparison, the bq27621 would use subclass and block instead of an address).

    Then you calculate the check sum and write it to 0x60, followed by the total length to 0x61.

    It is possible to write just one parameter or up to 32 bytes (incremental, starting from the address that was written to 0x3E/3F).

    For example, if you want to set design capacity (address 0x929F) to 4043mAh (=0x0FCB), you have to execute the following sequence:

    1. Enter CFG_UPDATE mode
    2. Write the address AND the parameter data to 0x3E+ (auto increment)
    3. Calculate the check sum: 0xFF - (sum of address and data) OR 0xFF
    4. Write the check sum to 0x60 and the total length of (address + parameter data + check sum + length) to 0x61
    5. Exit CFG_UPDATE mode

    w aa 00 90 00 #CFG_UPDATE
    w aa 3e 9f 92 0f cb # design capacity = 0x0FCB
    w aa 60 f4 06 # 0x9F + 0x92 + 0x0F + 0xCB = 0x020B. 0x020B OR 0xFF = 0x0B. CS = 0xFF - 0x0B = 0xF4; 2 bytes address, 2 bytes data, 1 byte check sum, 1 byte length = 6
    w aa 00 92 00 #EXIT_CFG_UPDATE

    Note that the address is in little endian but that parameters (e.g. the actual design capacity) are in big endian.

  • Hi Dominik

    Thanks for the reply! Your description is much clearer than what is written in the manual and solved now lot of confusion! (Might make sense to update the manual with this).

    Thanks and have a nice weekend,
    Mark