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.

Errors in C674x

Hi,
I am trying to implement a Goertzel Filter using the C674x. My program has an interrupt service routine that handles input and output of audio data, as well as a main function, which I use to set the values of the arrays to zero initially. The main function has a while(1) loop which the program runs everytime it finishes the interrupt service routine. So basically it goes back and forth between Interrupt service routine and while loop. I have declared a global variable flag, to indicate that I have enough data to calculate the Powers of differnt frequency components and compare them. I even calculate the differnt Powers. Now, I want to do the rest of the processing (twist test, magnitude test, and decoding which digit was pressed) in the while loop. However, my main function's while lopp cannot detect the change of the flag set in the interrupt and never enters the if condition. What should I do? Any comments would be greatly appreciated!

  • Hello Rakesh Vijayakumr,

    I would use "static volatile" in flag declaration. I work with  mcaspPlayBk.c from Starterware. There are flags declared so and it works.

    Best regards.

    Petr Duga

  • Welcome to the TI E2E forum. I hope you will find many good answers here.
    In addition you can find some details through the TI.com documents and the TI Wiki Pages.
    Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics.

    If you have an CPU with multiple interrupts, you can individual mask all by one interrupt at a time to determine if that particular ISR is properly being executed as expected.
    This process can be repeated through the other remaining interrupt services routines until you find the interrupt service routine that does not perform as expected.

    The below wiki article may help you for setting up interrupt,
    http://processors.wiki.ti.com/index.php/Setting_up_interrupts_in_DSP_BIOS

  • Rakesh,

    Petr's recommendation is likely the solution to this specific problem with the flag, although you may need to leave off the 'static' part and only use 'volatile' so the variable is available to multiple source files.

    Because you have a more complicated system than just a while loop and a single ISR, I strongly recommend you look into using SYS/BIOS to allow you to easily establish priorities and scheduling for the various functions. You will want to minimize the work done in ISRs (Hwis) and only do data input/output there. Please see the "c6748 workshop" on the TI Wiki Pages by searching for that, without the quotes. This archived active training material will get you a lot of insights into how easily and how well you can use the features of the TI tools.

    Regards,
    RandyP