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.

BQ76972: Issue regarding the delay in between the transaction.

Part Number: BQ76972
Other Parts Discussed in Thread: EV2400

Tool/software:

Hello Ti Team,

I am using the STM32U535RET6 as the host controller to communicate with the BQ7697204 AFE via SPI, using CRC-enabled transactions. The host SPI clock is configured at 1.25 MHz.

The SPI transaction sequence is as follows:

SPI_SLAVE_SELECT(RESET);

HAL_SPI_TransmitReceive(&hspi2,SPI_Tx,SPI_Rx,3,HAL_MAX_DELAY);

SPI_SLAVE_SELECT(SET);

delay_us(800);

SPI_SLAVE_SELECT(RESET);

HAL_SPI_TransmitReceive(&hspi2,SPI_Tx,SPI_Rx,3,HAL_MAX_DELAY);

SPI_SLAVE_SELECT(SET);

For example, to read CellVoltage1, I send the address bytes 0x14, 0x00, and a CRC byte in the first transaction, and then repeat the same transaction to receive the voltage data.

When I reduce the inter-transaction delay to 200 µs or 500 µs, the readings from the AFE become highly unstable and vary frequently. Even with an 800 µs delay, I still observe occasional abnormal values, but they are significantly less frequent compared to the shorter delays.

Since my AFE read task runs every 100 ms and I need to fetch all 16 cell voltages, 3 temperatures, current, and various status registers, a huge delay like 800µs to 1000 µs or higher adds considerable overhead, which is not acceptable for my application.

I would appreciate guidance on how to reduce this inter-transaction delay without compromising the reliability of SPI communication with the AFE.




Best Regards,

SAI VARUN.

  • Hello Sai,

    I have not seen of a method to reduce this operational time but let me confer with my team and get back to you.

    However, I do have a quick question.

    Is there any particular reason as to why you are not using I2C for communications? I2C would allow less transactions required to do the same operation, and time spent waiting on an operation to complete would be minimized if utilizing clock stretching within the device. Additionally, it supports block reads and writes. Switching to I2C could be better for your application.

    Regards,
    Rohin Nair

  • Hi Rohin,

    We have chosen SPI because the max operating frequency of SPI in AFE(BQ7697204) is 2MHzwhereas for I2C it is 400kHz.

    Best Regards,

    SAI VARUN

  • Hello Sai,

    Yes, the max operating frequency is higher for SPI, but I2C on our device is still faster. There are fewer transactions required, and as mentioned before I2C supports block reads/writes.

    For your question above, I have not found any method in reducing this operational time on SPI.

    Regards,

    Rohin Nair

  • Hello Rohin,

    I got your point. Now the current architecture is built and tested on SPI. Changing that to I2C is a bit difficult. 

    So, can you tell me what is the delay that needs to be given in between so that I can avoid the fluctuations in the readings that I am getting from AFE. Or can you tell me how exactly it can be calculated? Because I have verified the SPI lines when the MSP430-controlled EV2400 is communicating with the AFE, it is giving only 232us, and no fluctuations are observed in the readings. But in my case, even if I give 800us, I am getting abnormal values. If I reduce that time to 250us frequency of those incorrect readings increased rapidly.

    Best Regards,

    SAI VARUN.

  • Hello Sai,

    Let me take a look at this and come back with an answer tomorrow.

    Regards,

    Rohin Nair

  • Hello Sai,

    I am curious about this timing you are reading by probing the SPI lines. Do you have any waveforms I can view? Or possibly a logic analyzer file?

    To answer your question, unfortunately there is no specific way in terms of calculating the exact delay required as this varies based on the system you have built. We typically recommend around 2 ms of delay for the most reliable data.

    Also, I recommend going to Section 3.1 of the TRM and trying to read data from a subcommand using the method displayed there. It will help minimize bus traffic and could help with your issue.

    Please let me know if you have any other questions or if anything remains unclear.

    Regards,

    Rohin Nair

  • Hi Rohin, 

    I am attaching the logic analyzer file, which got generated by probing SPI lines when the MSP430-controlled EV2400 is communicating with the AFE(BQ7697204). 



    As you said, is it possible to fetch the voltage, current, and temperature data using subcommands? I am unable to fetch those readings using subcommands.BQStudio Timing.zip



    Best Regards,

    SAI VARUN.

  • Hello Sai,

    Yes, it is possible to fetch the voltage, current, and temperature. You tried using the appropriate subcommands shown in Table 12-23 in the TRM?

    Thank you for attaching the logic analyzer file. Please give me some time to go through and take a look.

    Regards,

    Rohin Nair

  • Hi Rohin,

    Any update on the logic analyzer file?

    I have checked the respective subcommands mentioned by you, and all those subcommands return the ADC Value of the respective readings. But I need the calculated value.

    Best Regards,

    SAI VARUN.

  • Hello Sai,

    I am still working on going through the logic analyzer file. Please give me some time. Apologies for the delay.

    Regards,

    Rohin Nair

  • Hello Sai,

    I am taking a look at your logic analyzer file and I am now seeing the issue that you are mentioning. Have you tried increasing the delay to 2ms as mentioned before, and does the issue persist? Please let me know.

    Regards,

    Rohin Nair

  • Hi Rohin,

    I haven't used a 2ms delay because it is too huge. Can you tell me why exactly we need a delay there, so that we can figure out how much delay we need to use?



    Best Regards,

    SAI VARUN.

  • Hello Sai,

    The time required for our device to process commands/subcommands will vary based on what is being asked. For example, DASTATUS1() subcommand will require around 200 us to load the data into the buffer. If you do not provide a proper delay time for the device to read, it will load garbage data. Does this help answer your question?

    Regards,

    Rohin Nair