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.

BQ78350-R1A: Problems with reading data from DataFlash registers

Part Number: BQ78350-R1A
Other Parts Discussed in Thread: BQSTUDIO, BQ78350-R1

Hi

I'm running some embedded application and my MCU is connected to BQ78350-R1A and I'm trying to read the data for specific registers in DataFlash in it.

(for example Device Chemistry from 0x4099 address)

I'm using (0x44) ManufacturerBlockAccess for reading and  I don't use checksum.

As I understand I always need to read 35 bytes in I2C read  (1 byte for length + 2 bytes for address + 32 bytes for data ). Am I right?

When I read the data for a first time after MCU reset from above register I get the data (LION in my case), but when I'm trying to do the same read one more time I get some garbage data.

I get the same results for other registers (Device Name,Manufacturer Name...)

What can be wrong in my code?

Also I tried to use bqStudio to compare I2C data on logic analyzer, but there is no possibility in it to read data from specific register in flash (or maybe I didn't find it)

  • Hi Yuri,

    If you have BQStudio connected note that its dashboard will periodically read data and may not leave the registers the same as you expected.  Disable the dashboard update by clicking on the Auto Refresh banner and also stop polling.  Or disconnect the interface from the SMBus during your operation so it can't interfere with your MCU transactions.

    The block access is the correct method to access. The data format changes with the data type. Typically command 0x44 will give you the command as the first 2 bytes. See the BQ78350-R1 technical reference manual section 17.2:

    In BQStudio the Advanced Comm SMB tool will allow you to read blocks, that may be useful for logic analyzer comparisons.  For example with the read of 0x4099:

    It shows the command sent and read back of data.  The data contains the command "99 40" followed by the data, here a string of 5, the length "04" and 4 characters "4C 49 4F 4E" or L I O N.

    The buffer will always have the 32 byte size, but you do not need to read all bytes.

  • Thanks for a reply.

    I tried to use the block read for 0x4099 in BQStudio but I didn't see any particular changes in logic analyzer data between my read of 0x4099 and BQStudio read of 0x4099.

    The only change as I understand that BQStudio uses checksum at the end of every sent I2C packet and I don't use it.

    So the question - do I need to use checksum or not to read block data from battery ?

    Is there any configuration register that enables/disables using of checksum ?

  • Hi Yuri,

    There is a register setting that enables PEC (packet error checking). BQStudio will always send a PEC byte even if this is not enabled, but it is not required (if not enabled in your data flash setting). 

    Regards,

    Matt

  • Thanks

    I found another diff between my block read and BQStudio block read.

    I noticed that when BQStudio send a block read sequence there is some delay between Write packet and Read packet. In my code I send a read packet immediately after write packet.

    Maybe this is wrong.

    Is there some minimum delay required between write and read packets?

  • Hi Yuri,

    I do not know of any requirements beyond Section 7.12 of the datasheet. 

    Have you verified that all of the bytes communicated are the same? I have seen other users who did not include the number of bytes in their read. Here is an example: https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/939010/bq78350-r1-bq78350-r1-communicate-error

    Best regards,

    Matt

  • Thanks Matt

    I finally resolved my problem.

    I inserted 1 ms delay between write packet and read packet and it's working now.

    According to Section 7.12 there is a Tbuf time, maybe it was to small in my code.