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/BQ76PL455EVM: bFrame Data and Its Indice

Part Number: BQ76PL455EVM

Tool/software: Code Composer Studio

Hi everyone,

I am trying to understand what includes bFrame and what is the indice of data inside it. I am changing register values of 13 and 3 but all changes same.

nSent = WriteReg(0, 13, 0x01, 1, FRMWRT_SGL_NR);

nSent = WriteReg(0, 3, 0x00010000, 4, FRMWRT_SGL_NR);

I depicted inside of bFrame below. Can you help me on that topic?

0.Deger : 0
. 1.Deger : 0
. 2.Deger : 0
. 3.Deger : 0
. 4.Deger : 0
. 5.Deger : 0
. 6.Deger : 0
. 7.Deger : 0
. 8.Deger : 0
. 9.Deger : 0
. 10.Deger : 0
. 11.Deger : 0
. 12.Deger : 0
. 13.Deger : 0
. 14.Deger : 0
. 15.Deger : 0
. 16.Deger : 0
. 17.Deger : 0
. 18.Deger : 0
. 19.Deger : 0
. 20.Deger : 0
. 21.Deger : 0
. 22.Deger : 0
. 23.Deger : 0
. 24.Deger : 0
. 25.Deger : 0
. 26.Deger : 0
. 27.Deger : 0
. 28.Deger : 0
. 29.Deger : 0
. 30.Deger : 0
. 31.Deger : 0
. 32.Deger : 0
. 33.Deger : 0
. 34.Deger : 0
. 35.Deger : 0
. 36.Deger : 0
. 37.Deger : 0
. 38.Deger : 0
. 39.Deger : 0
. 40.Deger : 0
. 41.Deger : 0
. 42.Deger : 0
. 43.Deger : 0
. 44.Deger : 0
. 45.Deger : 0
. 46.Deger : 0
. 47.Deger : 0
. 48.Deger : 0
. 49.Deger : 0
. 50.Deger : 0
. 51.Deger : 0
. 52.Deger : 0
. 53.Deger : 0
. 54.Deger : 0
. 55.Deger : 0
. 56.Deger : 0
. 57.Deger : 0
. 58.Deger : 0
. 59.Deger : 0
. 60.Deger : 0
. 61.Deger : 0
. 62.Deger : 0
. 63.Deger : 0
. 64.Deger : 0
. 65.Deger : 0
. 66.Deger : 0
. 67.Deger : 0
. 68.Deger : 0
. 69.Deger : 0
. 70.Deger : 0
. 71.Deger : 0
. 72.Deger : 0
. 73.Deger : 0
. 74.Deger : 0
. 75.Deger : 0
. 76.Deger : 0
. 77.Deger : 0
. 78.Deger : 0
. 79.Deger : 0
. 80.Deger : 0
. 81.Deger : 0
. 82.Deger : 0
. 83.Deger : 0
. 84.Deger : 0
. 85.Deger : 0
. 86.Deger : 0
. 87.Deger : 0
. 88.Deger : 0
. 89.Deger : 0
. 90.Deger : 0
. 91.Deger : 0
. 92.Deger : 0
. 93.Deger : 0
. 94.Deger : 0
. 95.Deger : 0
. 96.Deger : 0
. 97.Deger : 0
. 98.Deger : 0
. 99.Deger : 24
. 100.Deger : 0
. 101.Deger : 0
. 102.Deger : 0
. 103.Deger : 0
. 104.Deger : 0
. 105.Deger : 0
. 106.Deger : 0
. 107.Deger : 0
. 108.Deger : 0
. 109.Deger : 0
. 110.Deger : 182
. 111.Deger : 168
. 112.Deger : 0
. 113.Deger : 0
. 114.Deger : 182
. 115.Deger : 168
. 116.Deger : 8
. 117.Deger : 0
. 118.Deger : 30
. 119.Deger : 252
. 120.Deger : 0
. 121.Deger : 0
. 122.Deger : 162
. 123.Deger : 184
. 124.Deger : 0
. 125.Deger : 0
. 126.Deger : 0
. 127.Deger : 0
. 128.Deger : 0
. 129.Deger : 0
. 130.Deger : 0
. 131.Deger : 0

  • Hi Yusuf,

    Thank you for your question!

    bFrame is short for "Byte Frame". This frame stores the byte response packet during a read (or commands that have "response" option).

    The code you have provided is only doing a "write" command (you have put "WriteReg" and "FRMWRT_SGL_NR"), and so bFrame is not being updated. You must do a ReadReg command, or a command with "FRMWRT_***_R".

    Once you do a ReadReg command, the bFrame will be updated in the microcontroller and Code Composer Studio.

    The following document is an excellent starting point for programming and reading values from the device!

    http://www.ti.com/lit/an/slva617a/slva617a.pdf

    Let me know if this answers your questions!

    Regards,

    Vince

  • Hi Vince,

    Thanks for your support.

    There are two questions I need to ask.

    There is only 6 cells are connected.

    1.  I already use these handsome codes. Problem is when I assign total cell as as 6 ( Register 13) and assign 003F0000  (0011-1111) to Register 3, bFrame returns as above. When I change 13-> 0x06 and 3-> 00FF0000, bFrame returns with voltage data.

    First code does not work but second works.

    nSent = WriteReg(0, 13, 0x06, 1, FRMWRT_SGL_NR);
    
    nSent = WriteReg(0, 3, 0x003F0000, 4, FRMWRT_SGL_NR);
    
    
    nSent = WriteReg(nDev_ID, 2, 0x01, 1, FRMWRT_SGL_R); 
    nSent = WaitRespFrame(bFrame, 35, 0);

    
    
    
    
    nSent = WriteReg(0, 13, 0x06, 1, FRMWRT_SGL_NR);
    
    nSent = WriteReg(0, 3, 0xFFFF0000, 4, FRMWRT_SGL_NR);
    
    
    nSent = WriteReg(nDev_ID, 2, 0x01, 1, FRMWRT_SGL_R); 
    nSent = WaitRespFrame(bFrame, 35, 0);

    Why first code does not work?

    2. bFrame is totally 132 byte. How will I know which cell voltage is on which byte in bFrame. Same goes for Temperature and errors. How will I know which indice in bFrame carries error and temperature data?

    Thanks.

  • Hi Yusuf,

    On your first code, the 2nd parameter of the "WaitRespFrame" is the length of the frame you are expecting to receive. On this case, you are only reading 6 channels (since you are writing 0x003F0000 to register 3), so your frame length is 6 data bytes + 1 packet header + 2 CRC = 9. Can you please change your function as below see if that works:

    nSent = WaitRespFrame(bFrame, 9, 0);

    Regarding your 2nd question, on your first code (once you fix it) you should only receive 9 bytes of data. For your 2nd code you should only receive 35 bytes of data. First byte is the packet header, followed by the data bytes, and then 2 CRC bytes at the end. The order in which the data bytes are received from the 455 device is the same order in which they are displayed on the datasheet description of register 3 (CHANNELS 0x03–06 (3–6) Channel Select) page 73. bFrame array is bigger so that it can handle all the different response sizes needed, but the actual data read back depends on the number of bytes you are reading. For example, if you are expecting 35 bytes, then the data will be stored on the first 35 bytes of bFrame. 

    Best regards,

    Leslie

  • Great explanation Leslie.

    Thanks a lot.

  • You're welcome! I'm glad you got it to work. 

    Regards,

    Leslie