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.

BQ79616-Q1: not being able to set up daisy chain communication

Part Number: BQ79616-Q1
Other Parts Discussed in Thread: BQ79616

we have setup a custom pcb with bq79616 and bq79656, we tried communicating with UART from MCU. the communication was success with single balancer ic. we have checked CVDD on both pcb and evm its same.

individual both IC to communicate with MCU and that was success over UART. But the communication of daisy chain cant be established. We kinda gave away 3-4 days for this. But its not able to communicate however same code communicate with single chip evm or custom PCB. the daisy chain synchronization , that is to read OTP_ECC_DATAIN1 data byte and we receive nothing on UART. it just that same piece of code works with single IC setting

For Daisy chain pairing we have used capacitive coupling under section 10.2.1.2.7.1 Devices Connected on the Same PCB

I would like to know if there are any troubleshooting guidelines to know what is wrong, is it either hardware or firmware end. The bq796xx is new IC for us and we dont have much experience dealing with IC.

Let me know if you require anything from my end.

@ramchandra.bhosale@igrenenergi.com

  • Hi,

    Have you performed auto addressing? Please get the details on datasheet, and download TI sample code for 616. If you believe your code is correct, can you draw a simple block diagram? I am not pretty sure of your configuration. 

  • So, we have 2 IC, BQ79656 and BQ79616, we have connected BQ79656 to ISO and than to MCU UART.

    Here is the block diagram,

    Following is code snippets,

    // daisy chain sync start
    BroadcastWrite(OTP_ECC_DATAIN1, 0);
    WaitTx();
    BroadcastWrite(OTP_ECC_DATAIN2, 0);
    WaitTx();
    BroadcastWrite(OTP_ECC_DATAIN3, 0);
    WaitTx();
    BroadcastWrite(OTP_ECC_DATAIN4, 0);
    WaitTx();
    BroadcastWrite(OTP_ECC_DATAIN5, 0);
    WaitTx();
    BroadcastWrite(OTP_ECC_DATAIN6, 0);
    WaitTx();
    BroadcastWrite(OTP_ECC_DATAIN7, 0);
    WaitTx();
    BroadcastWrite(OTP_ECC_DATAIN8, 0);
    WaitTx();
    // auto addressing
    
    BroadcastWrite(CONTROL1, 0x1);
    WaitTx();
    for(i=0;i<BQ_COUNT;i++)
    BroadcastWrite(DIR0_ADDR, i);
    WaitTx();
    BroadcastWrite(COMM_CTRL, 0x2);
    WaitTx();
    SingleWrite(0, COMM_CTRL, 0x0);
    WaitTx();
    SingleWrite(1, COMM_CTRL, 0x3);
    WaitTx();
    // daisy chain sync stop
    BroadcastRead(OTP_ECC_DATAIN1, 1);
    WaitRx();   
    // This is where code hangs as i dont receive anything on UART

    Same code works with BQ_COUNT as 1 and with single one to one communication.

    download TI sample code for 616

    I have the sample code from TI along with that only we build our API, it works with single bq79616/656 but not on daisy chain, this is our concern right now.

    This is the circuit we have used to achieve daisy chain between 2 ICs,

    Also with respect to support from TI, is there a way to get support as per IST time zone ? the problem is i have to post a query and response will be during night time for us. this adds delay.

  • Have you connected RX to CVDD.for stack device?

    You can get TI local sales team's support. Please just contact with them

  • Have you connected RX to CVDD.for stack device?

    Yes

    We have also added 1K terminating resistor to unused COMHx and COMLx pair

  • I don't see a complete auto addressing process on your code, can you please check on datasheet Table 9-19. Auto-Addressing?

  • // auto addressing
    
    BroadcastWrite(CONTROL1, 0x1);
    WaitTx();
    for(i=0;i<BQ_COUNT;i++)
    BroadcastWrite(DIR0_ADDR, i);
    WaitTx();
    BroadcastWrite(COMM_CTRL, 0x2);
    WaitTx();
    SingleWrite(0, COMM_CTRL, 0x0);
    WaitTx();
    SingleWrite(1, COMM_CTRL, 0x3);
    WaitTx();

    Are you telling me this is not auto addressing ? this i picked right from sample code

    The read OTP_ECC_DATAIN1 for doesnt give any response so code wont move ahead i have read for OTP_ECC_DATAIN1 - OTP_ECC_DATAIN8 in sequence

    same code works with Single device,  BQ_COUNT = 1

  • Not sure where you copied the sample code, i just copied it as below

    //**********************
    //AUTO ADDRESS SEQUENCE
    //**********************
    void AutoAddress()
    {
    //DUMMY WRITE TO SNCHRONIZE ALL DAISY CHAIN DEVICES DLL (IF A DEVICE RESET OCCURED PRIOR TO THIS)
    WriteReg(0, OTP_ECC_DATAIN1, 0X00, 1, FRMWRT_ALL_W);
    WriteReg(0, OTP_ECC_DATAIN2, 0X00, 1, FRMWRT_ALL_W);
    WriteReg(0, OTP_ECC_DATAIN3, 0X00, 1, FRMWRT_ALL_W);
    WriteReg(0, OTP_ECC_DATAIN4, 0X00, 1, FRMWRT_ALL_W);
    WriteReg(0, OTP_ECC_DATAIN5, 0X00, 1, FRMWRT_ALL_W);
    WriteReg(0, OTP_ECC_DATAIN6, 0X00, 1, FRMWRT_ALL_W);
    WriteReg(0, OTP_ECC_DATAIN7, 0X00, 1, FRMWRT_ALL_W);
    WriteReg(0, OTP_ECC_DATAIN8, 0X00, 1, FRMWRT_ALL_W);

    //ENABLE AUTO ADDRESSING MODE
    WriteReg(0, CONTROL1, 0X01, 1, FRMWRT_ALL_W);

    //SET ADDRESSES FOR EVERY BOARD
    for(currentBoard=0; currentBoard<TOTALBOARDS; currentBoard++)
    {
    WriteReg(0, DIR0_ADDR, currentBoard, 1, FRMWRT_ALL_W);
    }

    WriteReg(0, COMM_CTRL, 0x02, 1, FRMWRT_ALL_W); //set everything as a stack device first

    if(TOTALBOARDS==1) //if there's only 1 board, it's the base AND top of stack, so change it to those
    {
    WriteReg(0, COMM_CTRL, 0x01, 1, FRMWRT_SGL_W);
    }
    else //otherwise set the base and top of stack individually
    {
    WriteReg(0, COMM_CTRL, 0x00, 1, FRMWRT_SGL_W);
    WriteReg(TOTALBOARDS-1, COMM_CTRL, 0x03, 1, FRMWRT_SGL_W);
    }

    //SYNCRHONIZE THE DLL WITH A THROW-AWAY READ
    ReadReg(0, OTP_ECC_DATAIN1, response_frame2, 1, 0, FRMWRT_ALL_R);
    ReadReg(0, OTP_ECC_DATAIN2, response_frame2, 1, 0, FRMWRT_ALL_R);
    ReadReg(0, OTP_ECC_DATAIN3, response_frame2, 1, 0, FRMWRT_ALL_R);
    ReadReg(0, OTP_ECC_DATAIN4, response_frame2, 1, 0, FRMWRT_ALL_R);
    ReadReg(0, OTP_ECC_DATAIN5, response_frame2, 1, 0, FRMWRT_ALL_R);
    ReadReg(0, OTP_ECC_DATAIN6, response_frame2, 1, 0, FRMWRT_ALL_R);
    ReadReg(0, OTP_ECC_DATAIN7, response_frame2, 1, 0, FRMWRT_ALL_R);
    ReadReg(0, OTP_ECC_DATAIN8, response_frame2, 1, 0, FRMWRT_ALL_R);

    /*//OPTIONAL: read back all device addresses
    for(currentBoard=0; currentBoard<TOTALBOARDS; currentBoard++)
    {
    ReadReg(currentBoard, DIR0_ADDR, response_frame2, 1, 0, FRMWRT_SGL_R);
    printf("board %d\n",response_frame2[4]);
    }*/

    //RESET ANY COMM FAULT CONDITIONS FROM STARTUP
    WriteReg(0, FAULT_RST2, 0x03, 1, FRMWRT_ALL_W);

    return;
    }
    //**************************
    //END AUTO ADDRESS SEQUENCE
    //**************************

  • the code gets stuck at this step as there is no response from BQ IC, we checked the same on DSO, there is no activity on TX line of BQ

    ReadReg(0, OTP_ECC_DATAIN1, response_frame2, 1, 0, FRMWRT_ALL_R);

    Again same works with single BQ79xxx

  • I will invite our software expert to check it. 

  • HI Naik,

    Are you sending the wake tone command 'SingleWrite(0, CONTROL1, 0x20)', to wake up the stack device i.e 616, are you seeing the LED 'ON' on BQ79616 ( device id 1). 

    Can you try to do single device read from device id '0' and device id '1', check if you get response.

    Can you capture the UART logs using  logic analyzer and also the scope shots of the COMH and COML lines between 656 and 616,  and share with us.

    Can you please share the pic of your setup.

    Thanks,

    Ravi

  • Are you sending the wake tone command 'SingleWrite(0, CONTROL1, 0x20)', to wake up the stack device i.e 616, are you seeing the LED 'ON' on BQ79616 ( device id 1)

    as per sample code Wake79616 should be used for waking up devices, We can see 5.0V on AVDD. When in shutdown, AVDD is 0V

    we dont have LED on set up, its custom HW. We have 1 EVM board of 616.

    SingleWrite(0, CONTROL1, 0x20)

    This command will be accepted before Daisy chain sync and auto addressing ? cause we are getting stuck in Daisy chain read operation.

    Can you try to do single device read from device id '0' and device id '1', check if you get response.

    This again depends on daisy chain sync

  • 'SingleWrite(0, CONTROL1, 0x20)' should be send after sending 'Wake ping to BQ79656, also you should add 1ms of delay after sending this command and before doing auto addressing. To really understand what commands are sent to BQ devices and their timing, can you please share the UART logs captured via logic analyzer.

  • The problem is not resolved, it kinda persisting. we dont have Logic analyzer.

  • I think that we have noticed the BQ Slave 1 and 2 wakeup on power properly on First wake TONE. But after that if we send shutdown tone theres is no effect on slave2 but slave1 is shutdown. After if we send wake tone slave1 wakes up again, however slave 2 is stays wake

    Shutdown tone Width is 9ms verified on DSO

    wakeup tone is 2ms verified with DSO

  • Shutdown tone doesn't propagate so the behavior is expected. Host has to talk to the neighboring device and sets the CONTROL1[SEND_SHUTDOWN] = 1
    or CONTROL2[SEND_HW_RESET] = 1 to instruct the neighboring device to issue the corresponding tone, meaning to shutdown stack 2, you have to send a command to stack 1. then stack 1 send HWRESET tone to stack 2. 

  • I have gone through but i dont understand the behaviour i had to resend the WAKEUP twice to see any data from  both slave

    Wake796xx();
    
        vTaskDelay(pdMS_TO_TICKS(11 * MAX_BQ796XX_COUNT));
    
    Wake796xx();
    
        vTaskDelay(pdMS_TO_TICKS(11 * MAX_BQ796XX_COUNT));

    Wake up tone routine

    void Wake796xx(void) {
    
    	// set GPIO as OUTPUT and pull low
    	// delay should be 2.5ms
    	SET_TX_IO_OUTPUT()
    	;
    
    	DEASSERT_TX_IO(); // Set TX as High
    #if USE_RTOS_DELAY
    	vTaskDelay( pdMS_TO_TICKS(10) )
    #else
    	OSIF_TimeDelay(10);
    #endif
    
    	ASSERT_TX_IO(); // Set TX as LOW
    #if USE_RTOS_DELAY
    	vTaskDelay( pdMS_TO_TICKS(3) )
    #else
    	delayMircoseconds(2700); // WAKE ping = 2.5ms
    #endif
    
    	DEASSERT_TX_IO();   // Set TX as High
    	SET_TX_IO_UART()
    	;
    }

  • Hi Naik,

    Apologies for the delayed response. 

    So if you are sending 'Wake796xx(); once' both BQ79656 and BQ79616 are not waking up ?

    The normal sequence is below, are you following this sequence.

    1) Wake796xx(); // To wake up the BQ79656

    2) delayus(100);

    If COMH of BQ79656 is connected to COML of BQ79616

    3) 'SingleWrite(0, CONTROL1, 0x20)' // Single write to BQ79656 to send wake tones to BQ79616

    If COML of BQ79656 is connected to COMH of BQ79616

    3) 'SingleWrite(0, CONTROL1, 0x80)' // Single write to BQ79656 to change the direction to reverse

    4) delayus(100);

    5) 'SingleWrite(0, CONTROL1, 0xA0)' // Single write to BQ79656 to send wake tones to BQ79616 in reverse directioni

    With the above sequence you should see both the BQ79656 and BQ79616 should power up, then you should do auto addressing.

    Can you probe the UART lines using oscilloscope and measure the wake ping, also can you probe the COMH line and see what you see when you send 'SingleWrite(0, CONTROL1, 0x20)

    Thanks,

    Ravi