Forums

audio loop with c6713

Started by laurasscurtu May 29, 2015
Hello,

I am trying to do a simple audio loop (playpack loop) using only the McBSP
with TI C6713.  I must mention, I am new to the DSP world and I would very
much appreciate any help.
I am working with DSP/BIOS and with CSL functions. 

So this is what I have done so far: 

I have programed 2 hardware interrupt functions, one for receive and one
for transmit. I have connected my laptop to the LINE IN of the board and I
am continuously playing a sine wave on my laptop, which I expect to hear
from HEADPHONES from the board. 

This is a section of my program:

void main(void)
{

     CSL_init();  // initalize CSL 	

     Config_DSK6713_AIC23();  // Configuration of the AIC23 over McBSP0
	
     hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET);
     MCBSP_config(hMcbsp, &datainterface_config);
    
     config_interrupts();  // Configuration of the interrupts

     MCBSP_start(hMcbsp, MCBSP_RCV_START | MCBSP_XMIT_START, 0xffffffff);
     MCBSP_write(hMcbsp, 0x0);
} 
 
void config_interrupts(void)
{
	IRQ_globalDisable();				//Disable all Interrupts for init of serial data
port
	IRQ_map(IRQ_EVT_RINT1, 13);         // McBSP1 receive
	IRQ_map(IRQ_EVT_XINT1, 12);         // McBSP1 transmit
	IRQ_clear(IRQ_EVT_RINT1);
	IRQ_clear(IRQ_EVT_XINT1);
	IRQ_nmiEnable();
	IRQ_enable(IRQ_EVT_RINT1);
	IRQ_enable(IRQ_EVT_XINT1);

	IRQ_globalEnable();

}
int j=0;
int k=0;
int input[BUF_LEN]; 
int output[BUF_LEN]; 
// BUF_LEN is definded in another file and it has the value 500

void HWI_rcv(void)           // McBSP1 receive interrupt function
{
		input[j++] = MCBSP_read(hMcbsp);
}

void HWI_xmit(void)
{ 
                MCBSP_write(hMcbsp, output[k++]);
}

The 2 HWIs I have programed in DSP/BIOS and I chose interrupts 12 and 13
for transmit and receive.

Given the fact that I am playing a sine wave I would expect to see not
only in the input but also in the output vector the sine wave, which I
don't, unfortunately (when I plot the to vectors using the Graph tool in
CCS). There are some random values. Another problem is, that the values in
the input vector are not the same with the values in the output vector. 
What intrigues me the most is that I can hear the sine wave correctly,
even though the values in the input and output vectors are not indicating
that there is a sine wave trasnmitted or received.  

I am kindly asking for someone's help!

Regards,
Laura


---------------------------------------
Posted through http://www.DSPRelated.com