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.

BQ79606A-Q1: Open Wire Detection

Part Number: BQ79606A-Q1

Hi,

We have a question about BQ79606 when we used it in open wire detection.

We write the program according to the following flowchart, but after we configure the VC_CS_CTRL, the voltage cannot be read.

What can we do to solve the problem. Or if there are similar examples that can provide us for reference.

  • The flowchart is as follows:

  • Hi YuWei,

    What do you mean by the voltages cannot be read? What value does VcellnH/L registers have? Can you include a snippet of your code sequence?

    Regards,

    Taylor

  • HI Taylor,

    The problem we have at this stage is,

    According to the sequence on the flowchart, we can read the value of "Result A".

    After we have configured the VC_CS_CTRL register, we cannot read the value of "Result B".

    And when we try to read other registers, there is no data can be returned.

    Whether the VC_CS_CTRL register conflicts with other registers, can you introduce this register in detail?

    Following is our codes

    void BQ79606_Vol_Det(void)
    {
       uint8_t i;
       uint8_t data=0x51;
       uint8_t data1=0x7F;
       uint8_t data2=0x00;

       uint8_t response_frame_Vol_A[(6*2+6)*2];                //Store result A
       uint8_t response_frame_Vol_B[(6*2+6)*2];                //Store result B

       BQ79606A_Write_Reg(0,CONTROL2,&data,1,FRMWRT_ALL_NR);           //CELL_ADC_GO in CONTROL2
       delay_1ms(1);                                                                                                          //Wait  For Vcell measurement to be complete  

       memset(response_frame_Vol_A,0,sizeof(response_frame_Vol_A));

       BQ79606A_Read_Reg(0,VCELL1H,response_frame_Vol_A,6*2,0,FRMWRT_ALL_R);     //Read VCELLnH/L   Store result A

       BQ79606A_Write_Reg(1,VC_CS_CTRL,&data1,1,FRMWRT_ALL_NR);        //Write VC_CS_CTRL to 7Fh each to turn on current sinks and sources
       delay_1ms(2);

       BQ79606A_Write_Reg(0,CONTROL2,&data,1,FRMWRT_ALL_NR);        //CELL_ADC_GO in CONTROL2
       delay_1ms(1);    

       BQ79606A_Read_Reg(0,DEV_STAT,response_frame_DRDY_CELL,1,0,FRMWRT_ALL_R);         //Read DRDY_CELL bit in DEV_STAT

       memset(response_frame_Vol_B,0,sizeof(response_frame_Vol_B));

       BQ79606A_Read_Reg(0,VCELL1H,response_frame_Vol_B,6*2,0,FRMWRT_ALL_R);     //Read VCELLnH/L  Store result B

       BQ79606A_Write_Reg(0,VC_CS_CTRL,&data2,1,FRMWRT_ALL_NR);        //Write VC_CS_CTRL to 00h each

    }

  • Hi YuWei,

    When you say "there is no data can be returned" does that mean there is no data coming back from the BQ79606A-Q1 TX to the MCU? if so, it seems like you are loosing communication with the device in one of the 3 commands you send after reading result A and before reading result B. 

    To debug which one is causing an issue, you can first comment out the "VC_CS_CTRL" write command run the code. If you are able to read DEV_STAT and Read VCELLnH/L, then we can focus on debugging this command.

    If you still see issues, then you can put back that line into the code and comment out the CELL_ADC_GO command. When you do this, notice that the values read back will be 0 because you are not enabling the ADCs, but you shouldn't loose communication. You should still be able to read from other registers. 

    I also suggest that you first read back CONTROL2 register before writing ADC_GO, to make sure you are not overwriting bits in that register. Keep the values in that register and just set ADC_GO (for example, if CONTROL2 is 0x40, then write 0x41 to set ADC_GO). 

    Please let us know your findings.

    Best regards,

    Leslie

  • Hi Leslie,

    We have taken your comments into consideration, and after commenting the VC_CS_CTRL,

    the communication is normal, and the values of DEV_STAT and VCELLnH / L can be read.

    How do we debug afterwards

  • Hi YuWei,

    What are you attempting to debug now if you can read the values? Now you compare A and B results to check if there is an open wire or not just like the flowchart shows.

    Regards,

    Taylor

  • Hi YuWei,

    Is the first parameter of your function the device address? It seems like you put address "1" when it should be address "0":

      BQ79606A_Write_Reg(1,VC_CS_CTRL,&data1,1,FRMWRT_ALL_NR);   

    After you execute that command, can you pause the program and measure the cell that has the open wire? You should be able to see the voltage difference and hence you would know if the command worked or not. Please double check with an oscilloscope that you are actually sending the correct bytes when this line is executed.

    You mentioned you don't get result B when you see the issue. Does this mean you loose communication (no data sent to the MCU), or do you get 00s back?

    Regards,

    Leslie

  • Hi YuWei,

    Do you still need help with this issue?

    Regards,

    Leslie

  • Hi YuWei,

    I'm going to go ahead and close this thread since we haven't heard from you, but feel free to reach out to us again if you are still having issues, if so, please create a new thread.

    Best regards,

    Leslie