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.

BQ27510 Clock Stretching

Other Parts Discussed in Thread: BQ27510, BQ27510-G3, BQ27510-G2

I have a BQ27510 connected to an ARM processor; the I2C baud is 375Kbits.  I notice significant clock stretching with the ninth bit (~120usec) for voltage reads.  The datasheet talks about clock stretching configuration control using the Operation Configuration Register.  However, I cannot find timing specifications that define the max/mins for the stretching.  Can you provide an explanation for the stretch, the cause of the stretch, and the time limits of the stretch?

1777.BQ27510.docx

 

  • Hi Brian,

    See page 12 of the bq27510-G3 datasheet for more info about I2C waiting times and clock stretching.  144ms should be the longest clock stretch you might occasionally see, but it will be fairly rare.

    Clock stretching is allowed in the I2C spec anytime a device needs more time to respond to a transaction request.  In the case of the bq27510 and other fuel gauges, it might be busy computing something or it might be slowly waking up from Sleep mode (and spinning the oscillator back up) or it might be in the middle of a dataflash update which shouldn't be interrupted.  There are a number of reasons it might clock stretch at any point in time.  Yo umention that it stretches whenever you read Voltage( ).  There is nothing special about that particular register, but does it happen to be the first register that you try to read?  If the gauge were in Sleep mode with the oscillator off then the first transaction you send might result in a longer clock stretch than the subsequent ones.

    As an aside, note that the SMBus spec is a type of sub-set of I2C with more specific requirements.  It specifies that clock stretching is NOT allowed.  If a device can't respond to a request right away then it must NACK the request.  So in that respect it is different from I2C.  Most of our multi-cell fuel gauges use SMBus since they are frequently used in notebook PCs.

  • Thank you for this information.  I am using the bq27510-g2, whose data sheet does not contain information regarding I2C waiting time.  I'll assume that the -g2 part works similarly to the -g3 part.