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.

MSP430FR5994: Interrupt in LEA example programs in DSPLib

Part Number: MSP430FR5994
Other Parts Discussed in Thread: MSP430WARE

Hi,

The LEA documentation states that the CPU will be interrupted when LEA finishes execution. But the code examples in the DSPLib (e.g. matrix_ex3_mpy_q15.c) does not contain any interrupt service routines or interrupt setup. why is this ?

Is there example code to use LEA with interrupt notifications ?

thanks

Rosh

  • Hello Rosh,

    LEA examples are only one thread applications, I mean all the examples I know.
    Try to use any TI-RTOS interrupt driven example application to build your test bed.
    In case of any troubles you would not be alone.

  • Hi Tomasz,

    Sorry, I don't understand how you can't have interrupts in a single threaded application ? The code below is from the example in ../MSP430Ware/dsplib/examples/Matrix/matrix_ex3_mpy_q15.c

    ...
    ...
        /* Initialize the parameter structure. */
        mpyParams.srcARows = SIGNAL_ROWS1;
        mpyParams.srcACols = SIGNAL_COLS1;
        mpyParams.srcBRows = SIGNAL_ROWS2;
        mpyParams.srcBCols = SIGNAL_COLS2;
        
        /* Invoke the msp_matrix_mpy_q15 API. */
        msp_benchmarkStart(MSP_BENCHMARK_BASE, 1);
        status = msp_matrix_mpy_q15(&mpyParams, *inputA, *inputB, *result); // CPU is blocked ??
        cycleCount = msp_benchmarkStop(MSP_BENCHMARK_BASE);
        msp_checkStatus(status);
        
        /* End of program. */
        __no_operation();
    ...
    ...

    In the above, it looks as if the CPU will be blocked in the "msp_matrix_mpy_q15" operation until LEA finishes. Is there a way we can setup LEA and ask it to start processing and the CPU can carry on doing other work, when the LEA finishes it can provide an interrupt. This is what it says in the documentation:

    "...The LEA begins executing the selected operation when the CPU writes a LEA command to the LEA
    command register when the LEA is in idle mode. Before writing the command, the CPU must configure the
    LEA argument registers with the pointers to the parameter blocks for the designated operation. The LEA
    performs the operation without CPU intervention and triggers an interrupt when the operation is complete...."

    I want to know how to setup LEA so it triggers an interrupt when finished (regardless of single/multi threaded application)

    Many thanks

    Rosh

  • The LEA provides an interrupt-driven model, but DSPLIB does not. The ISR and wait (LPM) are done inside the library, and all the caller sees is a synchronous function call. (The fact that the library does an LPM can have consequences if you have other, e.g. timer-based wakeups.)

    The LEA isn't documented at a "raw" level; DSPLIB is the designated mechanism for using it. TI does however provide source for DSPLIB.

    What I did was construct hacked versions of the functions (the ones I was interested in) which were split into two parts, so that I could do the LPM -- or something else -- myself while the LEA was running.

    [Edit: Hit Post too fast.]

  • yes I can see the lea ISR in the DSPlib (msp_lea_isr.c), which i guess is where the LPM is managed once interrupt is received.
    it's a shame the high-level library doesn't provide interrupt handling transparency to the user level code.

**Attention** This is a public forum