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.

McBSP returning not ready all the time

Hello,

I am very new to TI and just started using the TMS320C6713 DSP Starter Kit.

I started with the "Hello World" example given in the "DSP and Applications" book by Rulph Chassaing. I want to turn an LED on and hear a SINE wave when the DIP switch is turned on. I  have pasted the code below. 

The problem is when the program goes inside the "output_left_sample()" it never returns. This is because, I am using the polling method (poll=1) and "while(!MCBSP_xrdy(DSK6713_AIC23_DATAHANDLE)" always says that the channel is busy. So program goes into infinite loop.

What might be the reason that this is happening?

The status of the DIP switch is correctly recognized. I am able to see the LED go ON and OFF based switch position.  I am posting the main(), comm_poll() and output_left_sample() below. Let me know if I have to upload the entire project.

void main()
{
comm_poll(); //init DSK,codec,McBSP
DSK6713_LED_init(); //init LED from BSL
DSK6713_DIP_init(); //init DIP from BSL
while(1) //infinite loop
{
if(DSK6713_DIP_get(0)==0) //=0 if DIP switch #0 pressed
{
DSK6713_LED_on(0); //turn LED #0 ON
output_left_sample(sine_table[loopindex++]*gain); //output sample

if (loopindex >= LOOPLENGTH) loopindex = 0; //reset table index
}
else DSK6713_LED_off(0); //turn LED off if not pressed
} //end of while(1) infinite loop
}

 

void output_left_sample(short out_data) //for output from left channel
{
AIC_data.uint=0; //clear data structure
AIC_data.channel[LEFT]=out_data; //data from Left channel -->data structure

if (poll) while(!MCBSP_xrdy(DSK6713_AIC23_DATAHANDLE));//if ready to transmit   - CONDITION IN WHILE ALWAYS TRUE
MCBSP_write(DSK6713_AIC23_DATAHANDLE,AIC_data.uint);//output left channel
}

void comm_poll() //added for communication/init using polling

{
poll=1; //1 if using polling
c6713_dsk_init(); //init DSP and codec
}

 

  • Hi Ketan,

    Welcome to the TI E2E forum. I hope you will find many good answers here and in the TI.com documents and in the TI Wiki Pages (for processor issues). Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics (e2e.ti.com).

    I will recommend you first do hands-on with already working and tested example projects given by TI .

    You can download BSL and CSL packages from below mentioned link,
    processors.wiki.ti.com/.../C6713DSK_in_CCSv5

    Regards,
    Arvind Singh.
  • Hi,

    Thanks for your post.

    I would recommend you to go through the lab doc as below which involves programming the TMS320C6713 DSP Starter Kit (DSK) module:

    http://ecee.colorado.edu/~fmeyer/class/ecen4532/lab6.pdf

    The AIC23 codec on DSK6713 is connected to two multichannel buffered serial ports (McBSPs), McBSP0 and McBSP1. McBSP0 is used to send commands to the codec control interface while McBSP1 is used for digital audio data. Once the codec is configured, the control channel (McBSP0) is normally idle while audio data is being transmitted on McBSP1.

    You can find a simple program from

    Wiki: http://processors.wiki.ti.com/index.php/File:C6713_audio_minimal.zip

    You could also download the board support files from specturn digital webite on the prerequisites on the wiki below:

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

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------