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.

msp430fr5739 problem with TimerA.

Other Parts Discussed in Thread: MSP430FR5739

Hello!

We have a problem with Timer A clocked from ACLK. In really, it clocked from MCLK. TimerB worked perfect from ACLK.

mov #SELA_0+SELS_3+SELM_3,&CSCTL2 ; ACLK = XT1; SMCLK = MCLK = DCO

mov #TASSEL_1+MC_1+TAIE,&TA1CTL

mov #TBSSEL_1+MC_1,&TB0CTL

Please, if you has a msp430fr5739, try run this code and compare with oscilloscope.

All code, 4621.asm.zip.

  • For TimerB, you use TB.CCR0 interrupt. If the CCR0 ISR is called, teh CCIFG bit is automatically cleared,. Since this ISR is only called by CCR0.CCIFG.

    For TimerA, you use the timer overflow TAIFG interupt. It calls a shared ISR, shared with CCR1.CCIFG and CCR2.CCIFG. Here the TAIFG bit is not automatically reset (you need to figure out whihc one has called the ISR) and you have to do so manually, which you don't do. So the interrupt remains pending and as soon as you leave the ISR, it is entered again immediately (unless a higher priority interrupt is pending).
    It seems that tiemr A runs on a higer frequency, btu in fact there are no interrupts generated othe rthan the expecte dones from ACLK. But since the interrupt is not cleared after you handled it, the ISR is running in a loop.

    Add a "bic.c #TAIFG, &TA1CTL" to your TA1_ISR.

    And re-read the timer chapter regarding interrupts. Each timer has two ISRs.

  • Thank you for your response. It's correct.

**Attention** This is a public forum