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.

Sidetone feature in McBSP

Other Parts Discussed in Thread: TPS65950, DM3730

Hello everyone,

I am working on DM37x EVM and I want to enable sidetone in McBSP. MIC input and speaker output both are working fine (I have verified by writting the contents of DRR to DXR) but McBSP sidetone is not. In MCBSP_ST_SSELCR, I have mapped Input channel 1 to output channel 1 and input channel 0 to output channel 0 but no output.

My settings are as follows:

/* Required configuration. */
MEM_WRITE32(0x49024048, 0x000); //PCR
MEM_WRITE32(0x49024024, 0x40); //XCR1
MEM_WRITE32(0x49024020, 0x8040); //XCR2
MEM_WRITE32(0x490240AC, 1<<11); //Enable transmit full cycle mode.
MEM_WRITE32(0x4902401C, 0x40); //RCR1
MEM_WRITE32(0x49024018, 0x8040); //RCR2

/* Threshold control register. */
MEM_WRITE32(0x49024090, 0x70);

/* Set MCR register for multichannel mode. */
MEM_WRITE32(0x49024034, 0x01); //MCR1
MEM_WRITE32(0x49024030, 0x01); //MCR2
MEM_WRITE32(0x49024038, 0x03); //RECRA
MEM_WRITE32(0x49024040, 0x03); //XCERA

/* Enable sidetone in McBSP */
MEM_WRITE32(0x490240BC, 0x484); //SSELCR

/* Enable Sidetone in external sidetone core. */
MEM_WRITE32(0x4902A010, 0x00);

/* Write FIR ceoefficients. */
uint32_t i, read;
MEM_WRITE32(0x4902A02C, 0x02); //Enable writing of FIR coefficients. Dummy coefficients written just to see if sidetone works.

for(i=0; i<128; i++)
{
MEM_WRITE32(0x4902A028, 0xffff);
}

i = 0;


read = MEM_READ32(0x4902A02C);
while(!(read&4) && (++i < 1000))
{
read = MEM_READ32(0x4902A02C);
}

MEM_WRITE32(0x4902A02C, 0x00); //Writing FIR coefficients complete.

MEM_WRITE32(0x4902A024, 0xffffffff); //Sidetone gain register. Set to full just to see if there is some output.
MEM_WRITE32(0x4902A02C, 0x01);

  1. Am I missing some setting or done something wrong?
  2. Can Sidetone work without programming FIR coefficients in-case if I do not have already designed FIR filter?

 

Kindly help me in this as it is blocking my progress.

Umair

  • Hi Umair,

    In general your configuration seems correct as it is described inthe AM/DM37x TRM section 21.5.2.1 SIDETONE Activation Procedure but according to the register address I think you are using McBSP3. I suggest you to try to configure and use McBSP2 instead of McBSP3 because there is a difference between both:
    Although both modules (McBSP2 and McBSP3) support SIDETONE core the McBSP3 module has no audio buffer but McBSP2 has.
    Also the AM/DM37x TRM section 21.1.2 SIDETONE Core recommends the purpose of both McBSP modules supporting SIDETONE:
    • McBSP2: Audio data with audio buffer and SIDETONE feature
    • McBSP3: Bluetooth® voice data with SIDETONE feature
    About FIR filter it is better to use configured one with correct coefficients but at first time you could try with default settings (without FIR filter).

    BR
    Tsvetolin Shulev
  • Hi Cvetolin,

    Thank you very much for your reply. Yes you are right. I am using McBSP3 and I am sending PCM data from DM3730 to TPS65950 at 8kHz. I can not use McBSP2.

    Is it possible to use sidetone with raw PCM data in McBSP3? I am not using Bluetooth.

    Thanks,

    Muhammad Umair Khan

  • Hello everyone,

    Thank you very much for your continued support.

    As per your McBSP guide, both McBSP2 and 3 have audio loopback functionality.

    If they have, it should work on McBSP3. I could not completely understand your last comment. Kindly provide a bit more explanation.

    Umair