Menu

#86 Interrupt acknowledge in wrong place in MSP430 example

QPC
closed
nobody
None
5
2024-08-01
2014-02-26
Anonymous
No

In the timerA ISR, the interrupt acknowledge statement needs to be outside the #ifdef Q_SPY block in order for example to work without Q_SPY.

pragma vector = TIMER0_A1_VECTOR

__interrupt void timerA_ISR(void) {
QK_ISR_ENTRY(); / inform QK about entering the ISR /

ifdef Q_SPY

TA0CTL &= ~TAIFG;   // move this    /* clear the interrupt pending flag */
QS_tickTime_ +=
   (((BSP_SMCLK / 8) + BSP_TICKS_PER_SEC/2) / BSP_TICKS_PER_SEC) + 1;

endif

P9OUT ^= BIT1;

QF_TICK(&l_timerA_ISR);

QK_ISR_EXIT();                       /* inform QK about exiting the ISR */

}

I discovered this in port to MSP4305438. This is quite subtle, because the User's Manual mostly talks about TAIV, which clears the flag automatically on access.
If you don't clear the flag, you will still get a breakpoint in the ISR. The time of interrupt will be much shorter than you expect, because the uP interrupts again as soon as RETI is encountered. And the system can't perform any other work, so it appears to be hung.

Discussion

  • Quantum Leaps

    Quantum Leaps - 2015-09-30
    • status: open --> closed
     
  • Quantum Leaps

    Quantum Leaps - 2015-09-30

    This is a good point for MSP4305438 and TimerA interrupt.

    However, this MCU is not used in the newer MSP430 examples included in QP/C/C++/nano versions 5.4.x and newer. The interrupt pending flag is cleared (TACTL &= ~TAIFG) in all those examples. Therefore this bug is closed, as no longer present in the newer code.

    --MMS

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB