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: BQ79600 REVERSE ADDRESSING QUESTION

Part Number: BQ79616
Other Parts Discussed in Thread: USB2ANY

Tool/software:

Hi teams:

I want to implement reverse addressing through BQ79600. Referring to the example, I cannot collect data correctly. The example is as follows:

My system is 1 MCU plus 1 BQ79600 plus 4 BQ79616

My instructions are as follows

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SpiWake79600(); //wake up BQ79600
delay_us(500);
delay_ms(3);
SpiWriteReg(NULL_BQ, CONTROL1, 0x20, Length_1, FRMWRT_SGL_W); //wake BQ79616
delay_ms(80);
SpiWriteReg(NULL_BQ, OTP_ECC_DATAIN1, DummyValue, Length_1, FRMWRT_STK_W);
SpiWriteReg(NULL_BQ, OTP_ECC_DATAIN2, DummyValue, Length_1, FRMWRT_STK_W);
SpiWriteReg(NULL_BQ, OTP_ECC_DATAIN3, DummyValue, Length_1, FRMWRT_STK_W);
SpiWriteReg(NULL_BQ, OTP_ECC_DATAIN4, DummyValue, Length_1, FRMWRT_STK_W);
SpiWriteReg(NULL_BQ, OTP_ECC_DATAIN5, DummyValue, Length_1, FRMWRT_STK_W);
SpiWriteReg(NULL_BQ, OTP_ECC_DATAIN6, DummyValue, Length_1, FRMWRT_STK_W);
SpiWriteReg(NULL_BQ, OTP_ECC_DATAIN7, DummyValue, Length_1, FRMWRT_STK_W);
SpiWriteReg(NULL_BQ, OTP_ECC_DATAIN8, DummyValue, Length_1, FRMWRT_STK_W);
SpiWriteReg(NULL_BQ, CONTROL1, 0x80, Length_1, FRMWRT_REV_ALL_W);
//brdcast Write 0x02 to address 0x308(1)
SpiWriteReg(NULL_BQ, COMM_CTRL, 0x02, Length_1, FRMWRT_ALL_W);
//brdcast Write 0x81 to address 0x309 (enable BQ7961X-Q1 auto addressing)
SpiWriteReg(NULL_BQ, CONTROL1, 0x81, Length_1, FRMWRT_ALL_W);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The data cannot be collected normally. Please help me find out where the problem is.

  • Hello Xi,

    Mind sharing a logic-analyzer capture of this command sequence? 

    I can also test things from my side as well to check your sequence.

    Best Regards,

    Luis Hernandez Salomon

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    void ReverseAddressing()
    {
    uint16_t test_response_frame[(1+6)*TOTALBOARDS] ;
    //CHANGE BASE DEVICE DIRECTION
    SpiWriteReg(0, CONTROL1, 0x80, 1, FRMWRT_SGL_W);
    //CHANGE REST OF STACK DIRECTION
    SpiWriteReg(0, CONTROL1, 0x80, 1, FRMWRT_REV_ALL_W);
    //DO NORMAL AUTO ADDRESS SEQUENCE, BUT FOR DIR1_ADDR
    //DUMMY WRITE TO SNCHRONIZE ALL DAISY CHAIN DEVICES DLL (IF A DEVICE RESET OCCURED PRIOR TO THIS)
    SpiWriteReg(0, OTP_ECC_DATAIN1, 0X00, 1, FRMWRT_ALL_W);
    SpiWriteReg(0, OTP_ECC_DATAIN2, 0X00, 1, FRMWRT_ALL_W);
    SpiWriteReg(0, OTP_ECC_DATAIN3, 0X00, 1, FRMWRT_ALL_W);
    SpiWriteReg(0, OTP_ECC_DATAIN4, 0X00, 1, FRMWRT_ALL_W);
    SpiWriteReg(0, OTP_ECC_DATAIN5, 0X00, 1, FRMWRT_ALL_W);
    SpiWriteReg(0, OTP_ECC_DATAIN6, 0X00, 1, FRMWRT_ALL_W);
    SpiWriteReg(0, OTP_ECC_DATAIN7, 0X00, 1, FRMWRT_ALL_W);
    SpiWriteReg(0, OTP_ECC_DATAIN8, 0X00, 1, FRMWRT_ALL_W);
    //ENABLE AUTO ADDRESSING MODE, WHILE KEEPING REVERSE DIRECTION
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    hello,I transplanted the reverse addressing code in the routine into my code, and the logic analyzer waveform of the test is as follows:

    Before calling the ReverseAddressing function, all I did was wake up the BQ79600, and then wake up the BQ79616 with the command SpiWriteReg(NULL_BQ, CONTROL1, 0x20, Length_1, FRMWRT_SGL_W)

    (1) wake BQ79616

    90 00 03 09 20 13 95

    (2) change base device direction 

    90 00 03 09 80 13 ED

    (3) change stack device direction

    E0 03 09 80 C0 14

    (4) After this, all the commands I send will show 0x32

    (Theoretically it should be a dummy write to synchronize all daisy chained device DLLs)

    Could you help me figure out why this is?

  • Hello Xi,

    That is rather strange. MOSI is what is being sent by your MCU, so is there something going on in the MCU to cause this? 

    Have you tried using an EVM or USB2ANY to run this test using the command sequence?

    Best Regards,

    Luis Hernandez Salomom

  • Hello Luis,

    Thanks for your patience. I have found the cause of the problem and solved it.

  • Hello Xi, 

    Glad to hear that Slight smile. What was the problem? 

    Best Regards,

    Luis Hernandez Salomon