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.

CCS/BQ79606A-EXAMPLE-CODE: Not working properly

Part Number: BQ79606A-EXAMPLE-CODE
Other Parts Discussed in Thread: LAUNCHXL-TMS57004

Tool/software: Code Composer Studio

Good afternoon,

We have been working with the BQ79606A and recently we have tryed to upload the Example code, using the micro TMS57004, as we are supposed to. The initiation of the code works well, because the BQ wakes up correctly, the problem comes when trying to read the values of each's cell voltage. As we have understood the code should return this values without any modification, but our program just reads 0 V on each cell. One problem we have noticed is that the array "response frame" in sys_main.c has a constant value of 0 and we think that this shouldn't be at 0, should it?

Also, we don't understand how does the ReadReg function work, because in the bq79606.c it is defined in order to always return 7 (because bLen is 1), so how can we see the actual value of what we're trying to read?

Best regards,

Alex

  • Hello User,

    So far HQ is in long holiday.

    Please wait until they come back office.

    Thanks!

  • Hello User,

    Sorry for the delay.

    We will get back to you tomorrow.

    Roger

  • Hi Alex,

    Thank you for your patience. Can you confirm that you have updated the "TOTALBOARDS" variable in the BQ79606.h file? The response frame should not be all 0, there should be at least two bytes (CRC) that are non-zero at the end of the response (not always non-zero, but will be non-zero if the rest is zero).

    To answer your second question, to read the data, you do not read the bRes variable. The bRes variable is only to determine the number of bytes that were received.

    To read the data response, you must look at the array of data that gets stored in pData. The array that you pass to the ReadReg function (pData) gets overwritten with the bytes you read.

    This will always be 6 bytes longer (per board) than the number of data bytes, because there is:

    init (1 byte)
    board ID (1 byte)
    register ID bytes (2 bytes)
    [DATA BYTES HERE]
    CRC (2 bytes)

    ^THIS IS FOR EVERY BOARD

    Please review the "Command and Response Protocol Layer" section of the datasheet for more details.

    Regards,

    Vince

  • Dear Vince,

    I can confirm you that we have updated the "TOTALBOARDS" variable to 1, as we have just one BQ79606.

    In the response frame issue, here I show you how we just recieve 0'\x00' even everything is well connected (at least as shown in the typical applications of the data sheet). Could this be a hardware issue of the TMS57004? Because we have read a pair of posts in this forum, where they recommended to remove the R8 and R9 resistences, which is also said in the EXAMPLE-CODE's sys_main.c's description. Should we do this? Why?

    Best regards,

    Alex

  • Hi Alex,

    Yes, it is required to remove R8 resistor on the launchpad otherwise the UART communication will not work as intended. Please follow ALL of the instructions that are in section 4.1 of the user guide here: http://www.ti.com/lit/ug/slou471e/slou471e.pdf. Section 4.1.1 mentioned to remove this resistor.

    Regards,

    Taylor

  • Dear Taylor,

    We have removed the R8 from the LAUNCHXL-TMS57004 as required but nothing has changed, because we still recieve all 0 in the response frame, as showed in the previous comment. We don't know what more to try, because we have read everything online and the only user we found that had this problem, had it solved by removing the R8 resistor, but what shocked us from the answers from that post, hosted in this forum, was this particular answer where the writer suggests to remove both R8 and R9 and also connect J4-1 to pin 39 of the U2 and J4-2 to pin 38 of also the U2. Should we try this in order to make our UART connection work?

    The post's link:

    Best regards,

    Alex

  • Hi Alex,

    From the image it looks like “i” is still zero. Have you pressed run on the program (green play button at top of code composer studio window)?

    If so, can you see what happens when you instead step through the code using the buttons next to the play button, and see if the any values are getting updated during that part of the code?

    Lastly, please probe RX/TX of the microcontroller to see if the commands are being sent and the response is being sent (check if one of the two is not happening).

    Regards,

    Vince

  • Hi Alex,

    I hope all is well, and that my previous suggestions were able to help in your debug process!

    We will be closing this thread now. If you have follow up questions, please create a new thread with these follow up questions, and refer to this thread.

    Thanks, and have a great week!

    Vince