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.

C6678 interrupt problem: restoring variables after Interrupt service routine

Other Parts Discussed in Thread: TMS320C6678

Hi everybody,

I'm using TMS320C6678 for a biomedical application. The software is a single task multicore application running in bare metal, and inside are used a lot of functions from the dsplib including FFT double precision, matrix transpose etc etc...

In order to receive data from a Zigbee module I wrote a service routine for the GPIO0 interrupt that is triggered every 100ms. The entire signal processing takes less than 500ms (that is my realtime requirement).

Now, the problem is that the interrupts from the zigbee occur between the signal processing and destroy the data that are stored into all the variables that I'm using.

I'm writing the code in C, and seems that there isn't a push registers / pop registers mechanism or it's not working properly. Actually, I don't even know if there is one when the C code is compiled, or if I have to explicitly write one in the C code.

When I call a C function the destruction of the data in the variable usually doesn't happen, but I can't understand why it happens with interrupts.

What should I do to avoid the destruction of the data into the variables when an interrupt occours?

and also, if an interrupt occours in an FFT call, what is the effect? the result is also corrupted like I explained before?

Thank you for your help

Carmine

  • Carmine,

    When you call a C function, the compiler puts additional code to save registers to the stack for you. The same can be done for C interrupt routines. A description of what the TI C6x C compiler does for interrupt service routine (ISR) and how to set it up is described section 7.6 of the C6000 C Compiler User's Guide SPRU187u at http://www.ti.com/lit/ug/spru187u/spru187u.pdf

    As shown in section 7.6.3 skeleton example, writing an interrupt service routine in TI C6x C is simply using the "interrupt" keyword.

    Please click on "Verify Answer" if this answers your question...

  • ok I solved the problem...

    I implemented the Interrupt service function using the keyword "interrupt" and that was the problem. I used the csl interrupt functions to configure the interrupt and I included the csl library. Using that library it's not needed to put the keyword "interrupt" in the declaration of the Service routine