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.

BQ35100EVM-795: Can't get INITCOMP flag in CONTROL_STATUS register

Part Number: BQ35100EVM-795
Other Parts Discussed in Thread: BQ35100, BQSTUDIO

I have a BQ35100EVM-795 devboard and I wrote a C program which is continuously requesting BatteryStatus(), BatteryAlert(), and CONTROL_STATUS.

Here's I2C dump of communications with BQ35100 (I got it using Saleae Logic):

write to 0x55 ack data: 0x0A
read to 0x55 ack data: 0x05
write to 0x55 ack data: 0x0B
read to 0x55 ack data: 0x01
write to 0x55 ack data: 0x3E 0x00 0x00
write to 0x55 ack data: 0x40
read to 0x55 ack data: 0x00 0x00


write to 0x55 ack data: 0x0A
read to 0x55 ack data: 0x01
write to 0x55 ack data: 0x0B
read to 0x55 ack data: 0x01
write to 0x55 ack data: 0x3E 0x00 0x00
write to 0x55 ack data: 0x40
read to 0x55 ack data: 0x00 0x00


write to 0x55 ack data: 0x0A
read to 0x55 ack data: 0x01
write to 0x55 ack data: 0x0B
read to 0x55 ack data: 0x01
write to 0x55 ack data: 0x3E 0x00 0x00
write to 0x55 ack data: 0x40
read to 0x55 ack data: 0x00 0x00


write to 0x55 ack data: 0x0A
read to 0x55 ack data: 0x01
write to 0x55 ack data: 0x0B
read to 0x55 ack data: 0x01
write to 0x55 ack data: 0x3E 0x00 0x00
write to 0x55 ack data: 0x40
read to 0x55 ack data: 0x00 0x00


and so on.

As you can see, ALERT is raised because of INITCOMP, but I can't get INITCOMP flag in CONTROL_STATUS register. What am I doing wrong?

  • Hi Nazar,

    Did you set INITCOMP to 1 in the ALERT Configuration register?

    Best,

    Jessica

  • Hi Jessica,

    No, I didn't, but its default value is 0xF3, so INITCOMP in ALERT configuration register is set by default

  • Hi Nazar,

    Can you please share your gg.csv file?

    Best,

    Jessica

  • Hi Jessica,

    At the moment I don't have EV adapter to use bqstudio, but I dumped flash memory (0x4000 - 0x43FF) without it. Is it ok?

    <flash_dump>:	0x7c	0x43	0x4c	0x1b	0x90	0x5d	0xc6	0x73
    <flash_dump+8>:	0xfa	0x88	0x00	0x4c	0x00	0x00	0x00	0x00
    <flash_dump+16>:	0x71	0x48	0x00	0x00	0x00	0x00	0xcf	0xdc
    <flash_dump+24>:	0x17	0xf3	0x00	0x00	0x17	0xf3	0x51	0xf6
    <flash_dump+32>:	0xc9	0xf4	0x14	0x52	0x09	0x21	0x32	0x6d
    <flash_dump+40>:	0x00	0x00	0x3a	0x36	0xfd	0x91	0x00	0x25
    <flash_dump+48>:	0x30	0x01	0x00	0xef	0x10	0x20	0x00	0x00
    <flash_dump+56>:	0x00	0x00	0x00	0x00	0x00	0x00	0x00	0x00
    <flash_dump+64>:	0x00	0x00	0x00	0x00	0x00	0x00	0x00	0x00
    <flash_dump+72>:	0x00	0x00	0x00	0x00	0x00	0x00	0x00	0x00
    <flash_dump+80>:	0x00	0x00	0x00	0x00	0x00	0x00	0x58	0xd2
    <flash_dump+88>:	0x00	0x00	0x00	0x00	0x4c	0x0b	0x3d	0x70
    <flash_dump+96>:	0x07	0x62	0x71	0x33	0x35	0x31	0x30	0x30
    <flash_dump+104>:	0xff	0xff	0x00	0x00	0x00	0x00	0x00	0x00
    <flash_dump+112>:	0x00	0x00	0x00	0x00	0x00	0x06	0x06	0x0c
    <flash_dump+120>:	0x4d	0x0b	0xe3	0x0b	0x63	0x0b	0x4c	0x0b
    <flash_dump+128>:	0x49	0x0b	0x48	0x0b	0x47	0x0b	0x47	0x0b
    <flash_dump+136>:	0x47	0x0b	0x46	0x0b	0x46	0x0b	0x45	0x0b
    <flash_dump+144>:	0x35	0x0b	0x35	0x0b	0x35	0x0b	0x36	0x0b
    <flash_dump+152>:	0x39	0x0b	0x39	0x0b	0x23	0x0b	0x1d	0x0b
    <flash_dump+160>:	0x15	0x0b	0x0c	0x0a	0xfc	0x0a	0xe8	0x0a
    <flash_dump+168>:	0xcc	0x0a	0xb8	0x0a	0xa9	0x0a	0x97	0x0a
    <flash_dump+176>:	0x6b	0x0a	0x52	0x0a	0x44	0x0a	0x38	0x09
    <flash_dump+184>:	0xfb	0x09	0xd9	0x09	0xa2	0x09	0x82	0x09
    <flash_dump+192>:	0x1f	0x08	0x5b	0x07	0xe0	0x07	0x80	0x0e
    <flash_dump+200>:	0xe4	0x0e	0xb0	0x00	0x53	0x0a	0x00	0x16
    <flash_dump+208>:	0xa8	0x22	0x68	0x24	0x2e	0x24	0x50	0x24
    <flash_dump+216>:	0x61	0x24	0x30	0x24	0x10	0x24	0x74	0x24
    <flash_dump+224>:	0x54	0x24	0x9b	0x26	0x4c	0x25	0xa6	0x24
    <flash_dump+232>:	0x1b	0x22	0x46	0x1f	0x86	0x1d	0xce	0x1d
    <flash_dump+240>:	0xbf	0x1c	0x3a	0x19	0x20	0x16	0x81	0x13
    <flash_dump+248>:	0xe5	0x15	0x50	0x18	0x25	0x18	0x40	0x16
    <flash_dump+256>:	0x2e	0x15	0x1b	0x19	0xac	0x19	0xd3	0x1a
    <flash_dump+264>:	0xa5	0x18	0xbc	0x14	0x6d	0x0b	0x49	0xfe
    <flash_dump+272>:	0xf8	0xef	0x63	0xfd	0x3b	0x2b	0x0e	0x0f
    <flash_dump+280>:	0x4e	0xf4	0xc9	0xff	0xd8	0x00	0x1c	0xff
    <flash_dump+288>:	0xc0	0xff	0xda	0xff	0xb1	0xff	0xbe	0xff
    <flash_dump+296>:	0xde	0xff	0xde	0xff	0xe4	0xff	0xef	0xff
    <flash_dump+304>:	0xd7	0xff	0x9a	0xff	0x47	0xff	0x51	0xff
    <flash_dump+312>:	0x40	0xff	0x72	0xff	0x7b	0xff	0x54	0xff
    <flash_dump+320>:	0x4a	0xff	0x8a	0xff	0x2e	0xff	0x12	0xff
    <flash_dump+328>:	0x6f	0xff	0x69	0xff	0x4f	0xff	0x77	0xff
    <flash_dump+336>:	0xe9	0x00	0xcc	0xff	0xa6	0xff	0xf5	0x00
    <flash_dump+344>:	0x00	0x00	0x00	0x00	0x00	0x00	0x00	0x00
    <flash_dump+352>:	0x00	0x00	0x00	0x00	0x00	0x00	0x00	0x00
    <flash_dump+360>:	0x00	0x00	0x00	0x00	0x00	0x00	0x00	0x00
    <flash_dump+368>:	0x00	0x00	0x00	0x00	0x00	0x04	0x66	0x04
    <flash_dump+376>:	0xad	0x04	0xa2	0x04	0x56	0x04	0x85	0x04
    <flash_dump+384>:	0x22	0x04	0x61	0x05	0xdd	0x06	0x6e	0x06
    <flash_dump+392>:	0xd5	0x0b	0x52	0x17	0x00	0x36	0x01	0x49
    <flash_dump+400>:	0xf5	0x66	0xbf	0x00	0x43	0x00	0x47	0x00
    <flash_dump+408>:	0x53	0x00	0x6e	0x00	0x60	0x00	0x4d	0x00
    <flash_dump+416>:	0x60	0x00	0x56	0x00	0x54	0x00	0x52	0x00
    <flash_dump+424>:	0x51	0x00	0x5c	0x00	0x67	0x00	0x7b	0x02
    <flash_dump+432>:	0x92	0x80	0xf3	0x09	0x00	0x14	0x0a	0xf0
    <flash_dump+440>:	0x00	0x32	0x01	0xc2	0x01	0x23	0x45	0x67
    <flash_dump+448>:	0x89	0xab	0xcd	0xef	0xfe	0xdc	0xba	0x98
    <flash_dump+456>:	0x76	0x54	0x32	0x10	0x04	0x14	0x36	0x72
    <flash_dump+464>:	0xff	0xff	0xff	0xff	0x0b	0xa6	0x02	0x58
    <flash_dump+472>:	0x02	0x02	0x26	0x0a	0x8c	0x02	0x0b	0xb8
    <flash_dump+480>:	0x00	0x32	0x02	0x00	0x64	0x00	0x05	0x00
    <flash_dump+488>:	0x00	0x0a	0x00	0x00	0x7f	0xff	0x0a	0xf8
    <flash_dump+496>:	0x30	0x00	0x00	0x19	0x00	0x00	0x00	0x14
    <flash_dump+504>:	0x01	0x00	0x00	0x00	0x14	0x01	0x08	0x98
    <flash_dump+512>:	0x18	0xc0	0x0e	0x74	0x07	0xd0	0x01	0x00
    <flash_dump+520>:	0x32	0x64	0x02	0x64	0xff	0xff	0xff	0xff
    <flash_dump+528>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+536>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+544>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+552>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+560>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+568>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+576>:	0x00	0x00	0x7f	0xff	0xf8	0x30	0x00	0x00
    <flash_dump+584>:	0x00	0x00	0x00	0x14	0x00	0x00	0x00	0x14
    <flash_dump+592>:	0x00	0x00	0x00	0x00	0x00	0x00	0x0f	0xff
    <flash_dump+600>:	0xff	0x02	0xff	0xfb	0xfd	0x14	0x00	0x78
    <flash_dump+608>:	0x00	0x00	0x00	0x00	0x00	0x00	0x00	0x00
    <flash_dump+616>:	0x00	0x00	0xff	0x0a	0xf0	0x80	0x0a	0x07
    <flash_dump+624>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+632>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+640>:	0xff	0x55	0xff	0xff	0xff	0xff	0x7f	0xff
    <flash_dump+648>:	0x00	0x00	0x00	0x00	0x7f	0xfe	0xf1	0xbd
    <flash_dump+656>:	0x5d	0xa5	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+664>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+672>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+680>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+688>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+696>:	0xff	0xff	0xff	0xff	0x00	0x00	0x00	0x00
    <flash_dump+704>:	0x55	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+712>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+720>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+728>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+736>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+744>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+752>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+760>:	0xff	0xff	0xff	0xff	0x00	0x00	0x00	0x00
    <flash_dump+768>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+776>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+784>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+792>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+800>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+808>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+816>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+824>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+832>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+840>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+848>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+856>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+864>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+872>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+880>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+888>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+896>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+904>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+912>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+920>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+928>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+936>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+944>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+952>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+960>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+968>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+976>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+984>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+992>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+1000>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+1008>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    <flash_dump+1016>:	0xff	0xff	0xff	0xff	0xff	0xff	0xff	0xff
    
    

  • Hi Nazar,

    What mode are you using? SOH, ACC, or EOS?

    It is difficult for me to help you debug without a gg file. I encourage you to use our tools for debugging.

    Best,

    Jessica 

  • Hi Jessica,

    The default mode is ACC, and I didn't change it, so probably ACC is what I'm using (and in the flash dump ACC is also selected). What is contained in a gg file apart from a flash dump? I can't generate a gg file, but I can dump necessary info via I2C.

  • Hi Nazar, 

    Looking at your original code again, I don't see where you are reading back the control_status register. Please try reading two bytes from 0x3e.

    Best,

    Jessica 

  • Hi Jessica,

    write to 0x55 ack data: 0x0A 
    read to 0x55 ack data: 0x05
    write to 0x55 ack data: 0x0B 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x3E 0x00 0x00 
    write to 0x55 ack data: 0x3E 
    read to 0x55 ack data: 0x00 0x00 0x00 0x00
    
    write to 0x55 ack data: 0x0A 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x0B 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x3E 0x00 0x00 
    write to 0x55 ack data: 0x3E 
    read to 0x55 ack data: 0x00 0x00 0x00 0x00
    
    write to 0x55 ack data: 0x0A 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x0B 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x3E 0x00 0x00 
    write to 0x55 ack data: 0x3E 
    read to 0x55 ack data: 0x00 0x00 0x00 0x00
    
    write to 0x55 ack data: 0x0A 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x0B 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x3E 0x00 0x00 
    write to 0x55 ack data: 0x3E 
    read to 0x55 ack data: 0x00 0x00 0x00 0x00
    
    and so on

    Is this what is needed?

    Regards,

    Nazar

  • Hello Nazar,

    The CONTROL_STATUS is a subcommand, I think this app note may be helpful for you: https://www.ti.com/lit/an/slua790/slua790.pdf?ts=1632857990055&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FBQ34Z100-G1

    It has many examples of the different commands you can use with the advanced communication tab, but it shows all the data lengths and addresses used.

    Sincerely,

    Wyatt Keller

  • Hello Wyatt,

    I tried to read CONTROL_STATUS as a register with address 0x0000 and it looks like it worked.

    write to 0x55 ack data: 0x0A 
    read to 0x55 ack data: 0x05
    write to 0x55 ack data: 0x0B 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x00 
    read to 0x55 ack data: 0x80 0x20
    
    write to 0x55 ack data: 0x0A 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x0B 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x00 
    read to 0x55 ack data: 0x80 0x20
    
    write to 0x55 ack data: 0x0A 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x0B 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x00 
    read to 0x55 ack data: 0x80 0x20
    
    write to 0x55 ack data: 0x0A 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x0B 
    read to 0x55 ack data: 0x01
    write to 0x55 ack data: 0x00 
    read to 0x55 ack data: 0x80 0x20

    I was trying to read it from MACData because of the following paragraph from BQ35100 technical reference manual:

    """
    Issuing a Control() (or Manufacturer Access Control or MAC) command requires a 2-byte subcommand. The subcommand specifies the particular MAC function desired. The Control() command enables the system to control specific features of the gas gauge during normal operation and additional features when the device is in different access modes, as described below. On this device, Control() commands may also be sent to ManufacturerAccessControl().

    Any subcommand that has a data response will be read back on MACData(). Reading the Control() registers will always report the CONTROL_STATUS() data field, except after the DEVICE_TYPE() and FW_VERSION() subcommands. After these subcommands, CONTROL_STATUS() will report the value 0xFFA5 one time before reverting to the normal data response. This is a flag to indicate that the data response has been moved to MACData(). Writing a 0x0000 to Control() is not necessary to read the CONTROL_STATUS(); however, doing so is okay.
    """

    As CONTROL_STATUS is a subcommand, I assumed it should return response to MACData. The manual is not very clear about it.

    Regards,

    Nazar