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.

Signal Processing using MCBSP



Hello,

I am working on Signal Processing using DSK6713. Our task is take analog data process it and send to output. For this we had chosen to take analog data from MCBSP (line-in) and after processing send to MCBSP (line-out). For this task I had studied TI Wiki Pages and Book of Ralph Chasing. At last I had written this code.

#include <stdio.h>
#include <c6x.h>
#include <csl.h>
#include <csl_mcbsp.h>
#include <csl_irq.h>
#include <dsk6713.h>
#include <dsk6713_aic23.h>

/* Intializing Audio Codec */
DSK6713_AIC23_CodecHandle hCodec;
/* Configuring Audio Codec */
DSK6713_AIC23_Config config = {
0x0017, /* 0 - DSK6713_AIC23_LEFTINVOL Left line input channel volume */
0x0017, /* 1 - DSK6713_AIC23_RIGHTINVOL Right line input channel volume */
0x01f9, /* 2 - DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */
0x01f9, /* 3 - DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */
};

interrupt void serialPortRcvISR(void);
void hook_int();
int volumeGain;

void main(){

DSK6713_init(); // Initialize the board support library
DSK6713_LED_init();
/* Open Audio Codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
/* Set Sampling Freq of Audio Codec */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_96KHZ);

volumeGain = 100; /* Volume Gain of audio signal */
hook_int(); /* Interrupt Function */
DSK6713_LED_on(1);
while(1){
}
}

void hook_int(){
IRQ_globalDisable(); // Globally disables interrupts
IRQ_nmiEnable(); // Enables the NMI interrupt
IRQ_map(IRQ_EVT_RINT2,15); // Maps an event to a physical interrupt
IRQ_enable(IRQ_EVT_RINT2); // Enables the event
IRQ_globalEnable(); // Globally enables interrupts
}

interrupt void serialPortRcvISR(){
Uint32 temp;
DSK6713_LED_on(1);
/* Reading Data from MCBSP */
temp = MCBSP_read(DSK6713_AIC23_DATAHANDLE);
temp = temp * volumeGain;

/* Signal Processing Algo will be here */


/* Writing Data to MCNSP */
MCBSP_write(DSK6713_AIC23_DATAHANDLE, temp);
}

Above code work as:

  1. After initialization hook_int(); function is called in which
  1. Map MCBSP event to interrupt # 15.
  2. Enable the event.
  • Then it will go into infinite while loop until there is data on line-in
  • As data will arrive at line-in it will interrupt DSK.
  • For testing I had set led on to check the working of code
  • Input is given through PC's line-out port.
Code is executed without any error.
But it is not working properly. Interrupt is not working when data is at port. It remain in infinite while loop. Had I missed something?
Is there any efficient method than this?
  • Mukhtar,

    Both the Chassaing book and the TI Wiki (search for C6713 workshop) have working examples that take audio in and send audio out.

    Please get one or more of those examples running on your board, then start making modifications from there. We provide working examples so that you do not have to debug your own original code and figure out the same mistakes that we figured out when writing our examples.

    Regards,
    RandyP

  • RandyP,

    Would you please share any working example of audio in and audio out for DSK6713? I had tried many examples of Ralph Chasing and that are available on internet. But no one work for me. :( I'm in a serious trouble.

    Regards

    Mukhtar

  • Mukhtar,

    As I said in my previous post, go to the TI Wiki Pages and search for "C6713 workshop" (no quotes). You can download the student guide to understand what is covered in the workshop and you can download the labs that are covered in the workshop.

    You should also be able to find examples from the board vendor's website or off the CD that came with the DSK6713.

    I am surprised you were not able to get the Chassaing examples to work. You may need to get some BSL (Board Support Library) tests from the board vendor and see if you can validate that your board is in working condition. It is rare for there to be board problems, but that is one thing to consider.

    Regards,
    RandyP