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.
Hello,
We are working on TDA4 EVM PROC079 rev. E2A and PSDK_AUTO 6.1.x.x.
We are currently facing multiple issues with MCAN2 usage.
Our primary reference for MCAN2 usage is the MCAN EVM Loopback example from the PDK.
I have a confusion regarding the following code snippet in the source file 'mcan_evm_loopback_app_main_k3.c':
/* * Configuring TCA6424 IO Exp 2 with addr 0x22 * This io expander is controlled by i2c0 * For Main MCAN2 P13 and P14 should be set to 0, This should route the MCAN2 STB line to transciver. * For Main MCAN0 P06 and P07 should be set to 1. */ /* I2C initialization */ I2C_init(); I2C_Params_init(&i2cParams); i2cParams.transferMode = I2C_MODE_BLOCKING; i2cParams.bitRate = I2C_400kHz; i2cParams.transferCallbackFxn = NULL; handle = I2C_open(0U, &i2cParams); dataToSlave[0] = TCA6424_REG_CONFIG0 | TCA6424_CMD_AUTO_INC; dataToSlave[1] = 0x0U; SetupI2CTransfer(handle, 0x22, &dataToSlave[0], 2, NULL, 0); dataToSlave[0] = TCA6424_REG_INPUT0 | TCA6424_CMD_AUTO_INC; dataToSlave[1] = 0x0U; dataToSlave[2] = 0x0U; dataToSlave[3] = 0x0U; SetupI2CTransfer(handle, 0x22, &dataToSlave[0], 1, &dataToSlave[1], 3); /* Set P06 and P07 to 1. * Set P13 and P14 to 0. */ dataToSlave[0] = TCA6424_REG_OUTPUT0 | TCA6424_CMD_AUTO_INC; dataToSlave[1] |= 0xC0; dataToSlave[2] &= ~(0x18); SetupI2CTransfer(handle, 0x22, &dataToSlave[0], 1, &dataToSlave[1], 3);
Looking at the comment at the top and the SetupI2CTransfer calls, the I2C address of the expander used here is 0x22.
However, as per the TDA4 EVM User Guide, the I2C address of this expander is 0x21.
What is the correct address?
Thank you.
Hi Sagar,
As per 'TDA4 EVM PROC079 rev. E2A' schematic document, I2C address for corresponding IO expander is '0x22' only.
Thanks & Regards,
Vivek Dhande.
Texas Instruments (India) Pvt Ltd
Hello Vivek,
As per the code snippet, the corresponding IO expander is TCA6424ARGJR.
As per the schematic (please refer below), the I2C address for this expander is '0x21'.
We ran some more experiments and found that even if we use address '0x21' or '0x23', the MCAN example works fine.
So not really sure how this is to be configured.
Thank you.
Hi Sagar,
Let me check this with the concerned person. I'll keep you posted.
Thanks & Regards,
Vivek Dhande.
Texas Instruments (India) Pvt Ltd
Hi Sagar,
When you tried with '0x21' or '0x23', it is possible that default power-on configurations might be in favor of MCAN which might cause the MCAN test to pass. Can you please try to disable MCAN PHY through '0x22' and see if test fails.
Thanks & Regards,
Vivek Dhande.
Texas Instruments (India) Pvt Ltd