Hello Carlos,
I have downloaded “TWRK60D100M_TWRAudioSGTL_Loopback.zip” and tested on the TWR board. It works fine. But as we need a case to disable all I2S transmission, so we tried to clear I2S0_TCSR TE and BCE bit. The data bus is stopped, but BCLK is always there. We have tried many ways, but just cannot stop all bus activity including BCLK. Can you help to check how to stop all of them? :smileyhappy:
Below is our revised main loop code just for testing,
Try to use abFlag to control the enable/disable process under debugger of CW10.6,
////
unsigned char abFlag = 0;
int main (void) {
vfnTWRAudioInit();
for(;;)
{
if (abFlag == 0) {
//PORTE_PCR12 &= ~PORT_PCR_MUX_MASK;
PORTE_PCR12 |= PORT_PCR_MUX(0x04);
I2S0_TCSR |= I2S_TCSR_BCE_MASK; //enable, Bj
I2S_TX_ENABLE;
I2S0_RCSR |= I2S_RCSR_BCE_MASK; //enable
I2S_RX_ENABLE;
vfnapTWRAudio[sTWRAudioStateMachine.ActualState]();
vfnapIICDriver[sIICStateMachine.ActualState]();
vfnapSGTL5000ControlStateMachine[sSGTL5000ControlStateMachine.ActualState]();
}
else {
//if (sTWRAudioStateMachine.ActualState == TWR_AUDIO_IDLE_STATE) {
if (sTWRAudioStateMachine.ActualState == 0) {
I2S_TX_DISABLE;
I2S0_TCSR &= ~I2S_TCSR_BCE_MASK; // disable, Bj
I2S_RX_DISABLE;
I2S0_RCSR &= ~I2S_RCSR_BCE_MASK; // disable
PORTE_PCR12 &= ~PORT_PCR_MUX_MASK;
//PORTE_PCR12 |= PORT_PCR_MUX(0x01); /* PTE12 */
}
}
}
}
////
Thank you!
Benjamin