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.

BQ76940: BQ76940 SDA cannot respond to register signals.

Part Number: BQ76940

Hi

BQ76940 IIC read and write function, it is simulated by IO port.

GeneralReturnType BqIf_SetDeviceByte(uByte addr,uByte data)
{
uByte i = 0;
uByte wr_crc;
uByte calc_crc_data[3];

__DI();// Off interrupt

calc_crc_data[0] = BQ76940_WR;
calc_crc_data[1] = addr;
calc_crc_data[2] = data;

wr_crc = crc8_check(calc_crc_data, 3)// calculate CRC

// write 3 times until write ok
for(i = 0; i < 3; i++)
{
BqIf_IICStart();//
BqIf_WriteByte(BQ76940_WR); 
if(BQIF_ERR_OK != BqIf_IICAckDevice())
{
BqIf_IICStop();
continue;
}
BqIf_WriteByte(addr);
if(BQIF_ERR_OK != BqIf_IICAckDevice())
{
BqIf_IICStop();
continue;
}
BqIf_WriteByte(data);
if(BQIF_ERR_OK != BqIf_IICAckDevice())
{
BqIf_IICStop();
continue;
}
BqIf_WriteByte(wr_crc);
if(BQIF_ERR_OK != BqIf_IICAckDevice())
{
BqIf_IICStop();
continue;
}
BqIf_IICStop();
break;
}
__EI();
if(i >= 3)
{
return BQIF_ERR_WR;
}
return BQIF_ERR_OK;

}

Write the register 0x05, the data is 0x00.
When reading, the read instruction has ACK feedback, but I originally wanted to read the 0x05 address. SDA was changed by BQ low, and there was no ACK response. If the write is correct, the timing should not be wrong, as shown in the figure below and Code, code is a simple test code, only send read instructions and register addresses

__DI();
BqIf_IICStart();
BqIf_WriteByte(0x11);

if(BQIF_ERR_OK != BqIf_IICAckDevice())
{

}

BqIf_WriteByte(0x05);


if(BQIF_ERR_OK != BqIf_IICAckDevice())
{
BqIf_IICStop();
}
else
{
BqIf_IICStop();
}


__EI();

The timing diagram is as follows
Waiting for your reply.
Thanks
Star
  • Hi Star,

    I'm not a programmer, so I don't follow the details of the syntax or know what is in the functions noted.

    The first waveform looks like a register write corresponding to the data sheet figure 9 http://www.ti.com/document-viewer/BQ76940/datasheet/communications-subsystem-slusbk22004#SLUSBK22004 .

    The second waveform is a read from the previously set address, essentially the second part of figure 11 since it begins with a START rather than a RESTART.  It would seem the BQ is told to read (0x11), sends a value of 0x05, and the host does not ACK.  Again not being a programmer I'm unsure of the code, but it would appear to read that the host is sending both the 0x11 and the 0x05.  Since it is an open drain bus the BQ would need to be sending high or "1"s to allow visibility of the host write on the bus.

    If this is not the issue please ask again.