Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 66738

Forum Post: RE: Unable to use TimerB in Capture Mode on MSP430F247 ? Interrupt is pending but ISR routine not executed !!!!

$
0
0
"I think the interrupt flags clear automatically" The interrupt for TBCCR0 (TIMERB0_VECTOR) does indeed clear automatically on ISR start. As it is the only interrupt calling this vector, so there is no doubt about the reason why the ISR was called. The other interrupts (TBIFG, TBCCTL1.CCIFG etc.) do not automativcally clear on ISR entry. They clear when you clear them or (the highest priority one only) when you read TBIV. However, if the interrupt is enabled, there is no way to check the flag form main: as long as the flag is set, the ISR will be called and called and called and main does not execute a single instruction. But if the interrupt is not enabled (either GIE or the associated individual IE bit clear), then no ISR is called, and you can check the IFG bits manually in main. Then even TBCCR0.CCIFG remains set until you manually clear it. However, as Clemens already stated, your IF condition likely isn't correct: &= will take TBCCTL1, AND it with CCIFG, and then write the result back to TBCCTL1, effectively clearing all bits except CCIFG. The IF clause will executed as expected if CCIFG is set, but likely, TBCCR1 will cease to work as expected after this statement :)

Viewing all articles
Browse latest Browse all 66738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>