Hi,
I have a PCM audio output(short frame) which i need to route to two audio codec over I2S.
Am using MIMXRT1064 and plan is
to connect PCM to SAI1(input to the system)
And SAI2 to I2S Audio Codec+Audio Amp(goes to Headset+Mic)
And SAI3 to I2S Audio Codec +Audio Amp(goes to headset+Mic)
Am might need to send data both from PCM to I2S from SAI1 to SAI2 & SAI3 or from SAI to either SAI2 or SAI3.
Is this possible?
Am not a audio expert, please help.
Hello Balaji,
You should not have any issues using I2S or PCM protocol. You can configure SAI configuration registers according to your needs. Please check the below code from our SDK demos for Tx as an example (SAI_TxInit API).
/* Configure audio protocol */
if (config->protocol == kSAI_BusLeftJustified)
{
base->TCR2 |= I2S_TCR2_BCP_MASK;
base->TCR3 &= ~I2S_TCR3_WDFL_MASK;
base->TCR4 = I2S_TCR4_MF(1U) | I2S_TCR4_SYWD(31U) | I2S_TCR4_FSE(0U) | I2S_TCR4_FSP(0U) | I2S_TCR4_FRSZ(1U);
}
else if (config->protocol == kSAI_BusRightJustified)
{
base->TCR2 |= I2S_TCR2_BCP_MASK;
base->TCR3 &= ~I2S_TCR3_WDFL_MASK;
base->TCR4 = I2S_TCR4_MF(1U) | I2S_TCR4_SYWD(31U) | I2S_TCR4_FSE(0U) | I2S_TCR4_FSP(0U) | I2S_TCR4_FRSZ(1U);
}
else if (config->protocol == kSAI_BusI2S)
{
base->TCR2 |= I2S_TCR2_BCP_MASK;
base->TCR3 &= ~I2S_TCR3_WDFL_MASK;
base->TCR4 = I2S_TCR4_MF(1U) | I2S_TCR4_SYWD(31U) | I2S_TCR4_FSE(1U) | I2S_TCR4_FSP(1U) | I2S_TCR4_FRSZ(1U);
}
else if (config->protocol == kSAI_BusPCMA)
{
base->TCR2 &= ~I2S_TCR2_BCP_MASK;
base->TCR3 &= ~I2S_TCR3_WDFL_MASK;
base->TCR4 = I2S_TCR4_MF(1U) | I2S_TCR4_SYWD(0U) | I2S_TCR4_FSE(1U) | I2S_TCR4_FSP(0U) | I2S_TCR4_FRSZ(1U);
}
else
{
base->TCR2 &= ~I2S_TCR2_BCP_MASK;
base->TCR3 &= ~I2S_TCR3_WDFL_MASK;
base->TCR4 = I2S_TCR4_MF(1U) | I2S_TCR4_SYWD(0U) | I2S_TCR4_FSE(0U) | I2S_TCR4_FSP(0U) | I2S_TCR4_FRSZ(1U);
}
Best regards,
Felipe
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored.
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
------------------------------------------------------------------------------