Other Parts Discussed in Thread: BQSTUDIO
Hello;
I'm having problems communicating with the fuel gauge...the problem is as follows:
First, I can send the reset command with no apparent complaint - it properly ACK's the I2C transaction.
BUT, when trying to do a block read from the DF, I first send the command and address, but the 350 does not ACK the last byte. Then, if I ignore this and send the repeated start to do the read anyway, the 350 returns the LSB of the address, but then all zeros ??????????
I'm "guessing" this is a result of the NACK error, but I don't know.
Any help would be appreciated...
Here's what's happening
Block[0] = BQ78350_MANUFACT_BLK_ACCESS; <-- = 0x44
Block[1] = (uint8_t)0xCC;
Block[2] = (uint8_t)0x44;
OK = HAL_I2C_Master_Seq_Transmit_DMA(pI2cHandle,
BQ78350_ADDRESS,
Block,
3,
I2C_FIRST_FRAME);
....I get a NACK error here????
but I ignore it and send the repeated start to read...
if (Dir == READ)
{
OK = HAL_I2C_Master_Seq_Receive_DMA(pI2cHandle,
BQ78350_ADDRESS,
pBuf,
numBytes,
I2C_LAST_FRAME);
And this is what's returned?: Buf[0xCC, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,...]