4704 views|3 replies

99

Posts

0

Resources
The OP

What kind of interrupt arrangement is this for msp430f5438? [Copy link]

// Timer1 A0 interrupt service routine #pragma vector=TIMER1_A0_VECTOR __interrupt void Timer_A0 (void) { TA1CCR0 += 4; // Add Offset to CCR0 } // Timer_A3 Interrupt Vector (TAIV) handler #pragma vector=TIMER1_A1_VECTOR __interrupt void TIMER1_A1_ISR(void ) { switch(__even_in_range(TA1IV,14)) { case 0: break; case 2: TA1CCR1 += 16; // Add Offset to CCR1 break; case 4: TA1CCR2 += 100; // Add Offset to CCR2 break; case 6: break; // CCR3 not used case 8: break; // CCR4 not used case 10: break; // CCR5 not used case 12: break; // Reserved not used case 14: P4OUT ^= 0x10; // overflow break; default: break; } } Please help me, why does it separate CCR0? What is the logic? I just learned 5438 and don't understand it very well.
This post is from Microcontroller MCU

Latest reply

The author of the post is so sharp. It took me many days to put together this program. I admire you for analyzing it to this point! #pragma vector=TIMER1_A1_VECTOR__interrupt void TIMER1_A1_ISR(void){switch(__even_in_range(TA1IV,14)){case 0: break; case 2: TA1CCR1 += 16; // Add Offset to CCR1break;case 4: TA1CCR2 += 100; // Add Offset to CCR2break;case 6: break; // CCR3 not usedcase 8: break; // CCR4 not usedcase 10: break; // CCR5 not usedcase 12: break; // Reserved not usedcase 14: P4OUT ^= 0x10; // overflowbreak;default: break;}}  Details Published on 2011-8-6 17:27

5

Posts

0

Resources
2
Because #pragma vector=TIMER1_A0_VECTOR uses a single interrupt vector entry, which has a higher priority than the others, while the others share one entry. Read more books. [ This post was last edited by gongshuipeng on 2011-7-20 14:13 ]
This post is from Microcontroller MCU

99

Posts

0

Resources
3
Yes
This post is from Microcontroller MCU

76

Posts

0

Resources
4

The author of the post is so sharp. It took me many days to put together this program. I admire you for analyzing it to this point!

#pragma vector=TIMER1_A1_VECTOR
__interrupt void TIMER1_A1_ISR(void)
{
switch(__even_in_range(TA1IV,14))
{
case 0: break;
case 2: TA1CCR1 += 16; // Add Offset to CCR1
break;
case 4: TA1CCR2 += 100; // Add Offset to CCR2
break;
case 6: break; // CCR3 not used
case 8: break; // CCR4 not used
case 10: break; // CCR5 not used
case 12: break; // Reserved not used
case 14: P4OUT ^= 0x10; // overflow
break;
default: break;
}
}

This post is from Microcontroller MCU

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list