SLAA476B February 2011 – July 2019 BQ2040 , BQ2040 , BQ2060A , BQ2060A , BQ2063 , BQ2063 , BQ2083-V1P3 , BQ2083-V1P3 , BQ2084-V143 , BQ2084-V143 , BQ2084-V150 , BQ2084-V150 , BQ2085-V1P3 , BQ2085-V1P3 , BQ20Z40-R1 , BQ20Z40-R1 , BQ20Z70-V160 , BQ20Z70-V160 , BQ20Z80A-V110 , BQ20Z80A-V110 , BQ28400 , BQ28400 , BQ78PL114 , BQ78PL114 , BQ78PL116 , BQ78PL116 , LM5145 , LM5145 , MSP430F5500 , MSP430F5500 , MSP430F5501 , MSP430F5501 , MSP430F5502 , MSP430F5502 , MSP430F5503 , MSP430F5503 , MSP430F5504 , MSP430F5504 , MSP430F5505 , MSP430F5505 , MSP430F5506 , MSP430F5506 , MSP430F5507 , MSP430F5507 , MSP430F5508 , MSP430F5508 , MSP430F5509 , MSP430F5509 , MSP430F5510 , MSP430F5510 , TPS40057 , TPS40057 , TPS40170 , TPS40170
The MSP430 microcontroller communicates with the fuel gauge in the smart battery through the SMBus communication protocol. SMBus is based on the I2C protocol and is a two-wire serial interface: serial clock (SCL) and serial data (SDA). The two lines are connected through pullup resistors to VCC, and the idle state of the bus is VCC or logic HIGH. Multiple devices are connected to the SMBus lines in a wired-AND configuration with the premise that the active devices can drive the lines LOW while other devices relinquish bus control by staying in high-impedance state.
Devices that use the SMBus protocol to communicate can be classified as a master or slave device. A master or slave device can transmit or receive data. The device that initiates the communication packet by placing a START condition on the bus and providing clock pulses on the SCL line is considered as the master. After the master places the START condition on the bus, this command is followed by a 7-bit slave address and a Read/Write bit to indicate if the master is receiving or transmitting data, respectively. As each slave device can have a unique 7-bit address, a maximum of 128 devices can be connected to the bus. If there is a slave device with the address requested by the master, the slave acknowledges (ACK) by pulling the SDA line LOW. If not, the SDA line remains HIGH (during the ninth clock pulse on SCL), which is interpreted as a no-acknowledge (NACK). A successful ACK is followed by a stream of 8-bit packets that can be data, SBS commands, or PEC byte. The receiving device must ACK every time it receives an 8-bit packet. Communication ends when the master device places a STOP condition on the bus.
Unlike the I2C protocol, the SMBus protocol has a minimum clock frequency of 10 kHz and a maximum clock frequency of 100 kHz. The SMBus protocol also places a time-out restriction that prevents slave devices from extending the clock (SCL) line LOW for a certain interval before the master issues a STOP condition. A slave can hold the SCL line LOW for 25 ms before time-out occurs, after which the slave should be able to receive a new START condition within 35 ms. Another SMBus feature to improve communication robustness is Packet Error Checking (PEC). The PEC byte is generated by using the cyclic redundancy check (CRC-8) polynomial and is calculated on all bytes including device addresses, Read/Write bits, and SBS commands. The PEC calculation, however, does not include the START, repeated START, ACK, NACK, or STOP bits.
The reference design implements the time-out feature on the MSP430F5510 and also has the API calls to access the fuel gauge with or without PEC. The bq fuel gauges can also transmit or receive data with or without PEC. When the MSP430F5510 is receiving data from the fuel gauge and if it clocks out eight extra cycles, then the fuel gauge correspondingly outputs the PEC byte. When the MSP430F5510 is writing data to the fuel gauge and if it passes the PEC byte, then the fuel gauge compares the value against its own hardware-generated PEC value. If the values match, the fuel gauge issues an acknowledge (ACK); if the values do not match, a no-acknowledge (NACK) is issued before the STOP condition.
For additional details on timing diagrams and specifications, see the System Management Bus (SMBus) Specification [3].