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.

AIC3106 + OMAPL137

I have the OMAP-L137 / TMS 320C6747 Starter Kit.

I am using the code provided in <CC Studio Dir>\boards\evmomapl137_v1\dsp\tests\aic3106 in order to sample a signal on one of the input audio jacks, elaborate it and then sending it back on one of the output audio jacks.I have connected a headphone to the output and an music player to the input. I am running only the function aic3106_loop_micin.c. I have made slight changes to the program.

while(1)

{

                 /* Read then write the left sample */
                while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
                    sample_data = MCASP1_RBUF0_32BIT;
                while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
                    MCASP1_XBUF5_32BIT = sample_data;

for(i=0;i<40;i++)

{}

                /* Read then write the left sample */
                while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
                    sample_data = MCASP1_RBUF0_32BIT;
                while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
                    MCASP1_XBUF5_32BIT = sample_data;

}

I get output if I use the condition i<40 inside the for loop, but dont get any output for i<100

Why is this happening? Is there any settings that I have to change to get the output regardless of the value used in the condition of the for loop?

  • Kshitij,

    Did you check if the delay you are adding in the loop is causing an overrun/underrun condition in McASP. I would think the delay of 40 cycles is not causing this error but a 100 cycle delay does result in this error which is why you see this issue. Note if this condition occurs, the McASP  mutes itself until the error conditions are properly handled.

    Regards,

    Rahul

  • I checked the XSTAT and RSTAT register for underrun/overrun condition and it seems that the MCASP underflows. So I tried resetting the MCASP and carefully examined the initialisation procedure. Now it works for the condition i<100 in the for loop. But, once I put some statements inside the for loop, the problem occurs again.  I am not able to make out what changes have to be made in the iniatialisation procedure for the code to execute correctly.

  • Kshitij,

    Here is a small wiki article, we have created to deal with commonly seen McASP issues:

    http://processors.wiki.ti.com/index.php/McASP_Tips

    I haven`t looked at the McASP example in the BSL package but I believe it doesn`t use McASP FIFO or EDMA implementation to supply data to the McASP.. Perhaps you should look at a full fledged McASP driver implementation in the BIOS PSP package to understand how to avoid these kind of issues and get optimized throughput and performance.

    Regards,

    Rahul