SC-589 SRU for SPORT / I2S Connection

Hi guys,

I'd like to establish a SPORT connection between two ADAU 1787 and a SAM (SC-589 Mini). Hence, i need to configure the SRU. I want the ADAUs to be the masters. I used the following code:

void sru_init_clk_slave(void)
{
    /**
     * SPORT 4A (RX from ADAU1787) clk slave operation
     */

    SRU2(DAI1_PB03_O, SPT4_ACLK_I);
    SRU2(DAI1_PB04_O, SPT4_AFS_I);
    SRU2(DAI1_PB01_O, SPT4_AD0_I);


    /**
     * SPORT 4B (TX to ADAU1787) clk slave operation
     */

    SRU2(SPT4_BD0_O, DAI1_PB02_I);
    SRU2(SPT4_BD0_PBEN_O, DAI1_PBEN02_I);

    SRU2(DAI1_PB03_O, SPT4_BCLK_I);
    SRU2(DAI1_PB04_O, SPT4_BFS_I);


    /**
	 * SPORT 5A (RX from ADAU1787 B) clk slave operation
	 */

	SRU2(DAI1_PB13_O, SPT5_ACLK_I);
	SRU2(DAI1_PB14_O, SPT5_AFS_I);
	SRU2(DAI1_PB11_O, SPT5_AD0_I);


	/**
	 * SPORT 5B (TX to ADAU1787 B) clk slave operation
	 */

	SRU2(SPT5_BD0_O, DAI1_PB12_I);
	SRU2(SPT5_BD0_PBEN_O, DAI1_PBEN12_I);

	SRU2(DAI1_PB13_O, SPT5_BCLK_I);
	SRU2(DAI1_PB14_O, SPT5_BFS_I);

    /**
     * Enable inputs
     */

    *pREG_PADS0_DAI1_IE = ((0x1<<1)|(0x1<<3)|(0x1<<4)|(0x1<<11)|(0x1<<13)|(0x1<<14));    // Pin 1 Input Enable: routed to SPT4_AD0_I
}

Electronically, i use level shifters between the DAI Pins and the SPORT peripheral of the ADAUs.

I'm not entirely sure if the config is correct. since the project does not work so far (the adau receives the signal it sended, but it's not the signal it should receive (would be a low-pass filtered version)). Would be happy, if you could help me.

Cheers,
Jonas

  • 0
    •  Analog Employees 
    on Apr 26, 2021 4:04 PM

    Hi Jonas,

    The DAI configuration looks good to me. You could also add the following code to make sure the output drivers are disabled for the input pins, however this is likely not an issue here. For example:

    SRU(LOW, DAI1_PBEN01_I);

    SRU(LOW, DAI1_PBEN03_I);

    etc.

    As your DAI is not looping back the signal, the loop back happened likely after the data has been received by the SPORTs. Are you using the Baremetal framework for audio I/O or your own code for buffer management?

    Regards,

    Wenting