Hello I am trying to communicate with TI BQ28Z610 by using Nucleo-F746ZG. All I do is trying to read data from TI chip. I am sending 0x08 to slave address 0x55.I2C frequency is 80kHz and pull ups are 10 K. Here is the related part of the trial code:
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
//READ VOLTAGE FOR TESTING
#define I2C_Slave_Address (0x55) // Receive 0x55+1 0x55
uint8_t I2C_Data[16];
uint8_t I2C_DataToSend;
char statusString[255];
int statusStringLength;
I2C_DataToSend=0x08;
if (HAL_OK != HAL_I2C_Master_Transmit(&hi2c1,(uint8_t)I2C_Slave_Address,&I2C_DataToSend,1,1000)){
statusStringLength = sprintf(statusString,"Transmit failed");
CDC_Transmit_FS(statusString,statusStringLength);
HAL_GPIO_WritePin(LD1_GPIO_Port,LD1_Pin,1);
}
if (HAL_OK != HAL_I2C_Master_Receive(&hi2c1,(uint8_t)I2C_Slave_Address + 1 , I2C_Data,1,1000)){
statusStringLength = sprintf(statusString,"Receive failed");
CDC_Transmit_FS(statusString,statusStringLength);
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin,1);
}
statusStringLength = sprintf(statusString,"Voltage: %d", (int) I2C_Data[0]);
CDC_Transmit_FS(statusString,statusStringLength);
HAL_Delay(100);
}
Here is the oscilloscope image:
Here is the logic analyzor view:
So what might be the reason behind it? For me everything looks fine. Thank you beforehand.
Edit: Here is the logic analyzer capture for 0xAA slave address: