cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405 communication TLV320AIC3104IRHBR (I2C ever Busy)

frotaitalos
Associate III

Hi, I am unable to communicate via i2c with the TLV320AIC3104IRHBR chip, the bus response is always busy. I'm just using the STM's internal pullup, I check it on the oscilloscope and the pins are high but no communication happens. Below is my i2c configuration and my schematic.

i2c configurator:

 

 

static void MX_I2C2_Init(void)
{
  hi2c2.Instance = I2C2;
  hi2c2.Init.ClockSpeed = 100000;
  hi2c2.Init.DutyCycle = I2C_DUTYCYCLE_2;
  hi2c2.Init.OwnAddress1 = 0;
  hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
  hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
  hi2c2.Init.OwnAddress2 = 0;
  hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
  hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
  if (HAL_I2C_Init(&hi2c2) != HAL_OK)
  {
    Error_Handler();
  }
}

 

 

I2C connection attempt:

HAL_StatusTypeDef status = GDSP_Codec_Init( & codec, & hi2c2, CODEC_NRST_GPIO_Port, CODEC_NRST_Pin);
HAL_Delay(1000);
if (status == HAL_OK) {
        char * msg = "OK\r\n";
        CDC_Transmit_FS((uint8_t * ) msg, strlen(msg));
} else if (status == HAL_ERROR) {
        char * msg = "ERRO\r\n";
        CDC_Transmit_FS((uint8_t * ) msg, strlen(msg));
} else if (status == HAL_BUSY) {
        char * msg = "BUSY\r\n";
        CDC_Transmit_FS((uint8_t * ) msg, strlen(msg));
} else if (status == HAL_TIMEOUT) {
        char * msg = "TIMEOUT\r\n";
        CDC_Transmit_FS((uint8_t * ) msg, strlen(msg));
}
HAL_Delay(100);

Schematic stm:

frotaitalos_0-1721077847122.png

 

Schematic codec:

frotaitalos_1-1721077911472.png

 

Attached I left the codec driver file, you can see what happens when the chip starts

 

0 REPLIES 0