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.

msp430F5529 timers

1.are timerA0 and timerA1 independent with each other?

2.if i want to use timerA in continuous mode, what is the name of the interrupt function that react to TAIFG (all i know is i can look at TA0IV)? i mean : 

#pragma vector=TIMER0_A?_VECTOR
__interrupt void TIMER0_A?_ISR(void)

3.how do i know the name of any interrupt function? is there any table with the names of all interrupt functions?\

thanks!

  • shahar asor said:
    1.are timerA0 and timerA1 independent with each other?

    Yes.

    shahar asor said:
    what is the name of the interrupt function that react to TAIFG

    The name of the function can be anything you want. What is important is the pragma named used to associate the two. Either way, the pragma is tool dependent. IAR and CCS use different forms.

    shahar asor said:
    3.how do i know the name of any interrupt function? is there any table with the names of all interrupt functions?

    The vector names should be the same as what they are called in the device-specific datasheet in the interrupts section.

  • i found this:

    #define TIMER1_A1_VECTOR (48 * 2u) /* 0xFFE0 Timer1_A3 CC1-2, TA1 */
    #define TIMER1_A0_VECTOR (49 * 2u) /* 0xFFE2 Timer1_A3 CC0 */

    1.how does 48 *2u represent 0xFFE0 (same the the second #define)? and what does 'u' represent?

    2.can i write in my code #pragma vector = 0xFFE0 instead of #pragma vector = TIMER1_A1_VECTOR?

    thanks again

  • Why do you even think about writing

    #pragma vector = 0xFFE0

    instead of

    #pragma vector = TIMER1_A1_VECTOR

    which is a notation that everyone that will read your code can understand??!!

    Imagine you want to get help with your code and someone will find "#pragma vector = 0xFFE0" - do you think anybody knows where that is pointing to? I think even the programmers for software like CCS or IAR which provide the header files for all the MCUs do not know this information off the cuff.

  • Dennis is right about not using explicit values.

    However, for clarification:
    The 48*2u is an offset into the separate segment for the interrupt vector table, which has been defined in the linker script. The generic addressing range 0x0000 to 0xffff has been split into different segments defining their purpose and properties (writable or not etc.) This prevents code from flowing into the vector table.

    The vector table segment likely starts at 0xFF50, so offset 0x48*2 is 0xFFE0.
    The segment definition and the offset may change without notice on compiler updates, but the names stay the same.

**Attention** This is a public forum