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 function cycle time

Part Number: MSP430FR5994

Configure the FR5994 MCLK to 16Mhz, SMclk to 16Mhz, start the IO interrupt, in the IO interrupt will use DMA read, measure the execution time issue, the same statement in the IO interrupt time is longer than in the main loop, in theory

P1OUT |= BIT5;
f_waitadcrdy111 = false;

g_adc_cnt111++;
P1OUT &= ~BIT5;

The above code only needs 0.75us in the main loop, it can be completed, but it needs 2us more in the interrupt function, can you tell what caused it

  • Hi Jinghua,

    When you set a interrupt function, there will be some operations for register value protect, and then MCU can recover after interrupt finished.

     (it described in user's guide)

    B.R.

    Sal

  • I can't tell for sure but it seems like you are saying that you measure a pulse width at P1.5 of 750ns in one case and 2.75us in the other.

    If so then the thing I would look at is the assembly code generated in each case. Each line of code shown should result in a single instruction with good optimization. I count 12 cycles which matches 750ns. (It should be a little slower than that because of FRAM wait states.)

  • thank you for your answer.
    Yes, that's how you understand it, in an interruption, it takes more time. The same instructions, in different places, their assembly instructions are consistent. I didn't have this problem with 8Mhz. I have seen the waiting state time of FRAM, but I cannot confirm whether I have used FRAM or not at present

  • The program is stored in FRAM so of course you are using it. But I wonder if you configured the FRAM controller to provide a wait state as required for MCLK greater than 8MHz.

    Don't use the AUTO mode as it is slower.

  • Thank you. Although I haven't solved this problem yet, I can confirm the root cause according to your information, and I will try to solve it later.

**Attention** This is a public forum