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.

Vector notation - remains mysterious to this day

Other Parts Discussed in Thread: MSP430FR5738

Consider this gem from slau 272c for the FR5738...

Timer_A Interrupts
Two interrupt vectors are associated with the 16-bit Timer_A module:
• TAxCCR0 interrupt vector for TAxCCR0 CCIFG
• TAxIV interrupt vector for all other CCIFG flags and TAIFG

Fine!  Just when I thought I understood the notation, I had to develop a new species 430 with many timers going.

So what are the notations for the two vectors for each of the three sub-timers/registers for timer 0 and then timer 1 ???
That's 12 different ISRs.  I believe it would help everyone - not just me - if someone could unravel the notation for once.
Yes - I've looked at other threads and the answers are specific debugging or incomplete.  Is there not a manual on the topic?
I've been trying many combinations for these dozen ISR.  Just when I thought I had it, an interrupt jumps up in the wrong vector:

#pragma vector = TIMER0_A0_VECTOR
__interrupt void TIMER0_A0_ISR (void)        { ... }

then

#pragma vector = TIMER1_A0_VECTOR
__interrupt void TIMER1_A0_ISR (void)        { ... }

then

#pragma vector = TIMER2_A0_VECTOR
__interrupt void TIMER2_A0_ISR (void)        { ... }

then

#pragma vector = TIMER0_A1_VECTOR
__interrupt void TIMER0_A0_ISR (void)        { ... }

then

#pragma vector = TIMER1_A1_VECTOR
__interrupt void TIMER1_A0_ISR (void)        { ... }

then

#pragma vector = TIMER2_A1_VECTOR
__interrupt void TIMER2_A0_ISR (void)        { ... }

That's half of them.    Is this headed in the right direction?
Where does it bifurcate for the two vectors (one for TAR overflow. the other for CC event.)?
Would someone make a chart of this notation for all to marvel at?

PDK

  • "Timer_A" is the name of a type of a timer module.

    The FR5738 has two Timer_A modules. Each module has three CCRs, so the modules are named "Timer0_A3" and "Timer1_A3".

    Each module has two interrupt vectors. The msp430fr5738.h header file defines them as follows:

    #define TIMER1_A1_VECTOR   (41)   /* 0xFFE0 Timer1_A3 CC1-2, TA1 */
    #define TIMER1_A0_VECTOR   (42)   /* 0xFFE2 Timer1_A3 CC0 */
    #define TIMER0_A1_VECTOR   (45)   /* 0xFFE8 Timer0_A5 CC1-4, TA */
    #define TIMER0_A0_VECTOR   (46)   /* 0xFFEA Timer0_A5 CC0 */

  • Yes - I stared at that and I now see where I slid off the trail. but a few things are still odd: My msp430fr5738.h reads...
    #define TIMER1_A1_VECTOR (40 ) /* 0xFFE0 Timer1_A3 CC1-2, TA1 */
    #define TIMER1_A0_VECTOR (41 ) /* 0xFFE2 Timer1_A3 CC0 */
    #define TIMER0_A1_VECTOR (44 ) /* 0xFFE8 Timer0_A5 CC1-4, TA */
    #define TIMER0_A0_VECTOR (45 ) /* 0xFFEA Timer0_A5 CC0 */
    1) What is the source of the different vector numbers (41 vs 40, 42 vs 41, 45 vs 44, 46 vs 45) from your snippet to mine?
    My numbers do work. A different vector number is a big deal. Is there any reason for the difference?
    2) The third line reads "CC1-4, TA". The 5738 sports only three CC's per timer Ax. Worse, slau272c lists all 6 possible CCR's.
    And, why "TA" and not "TA0" ? But - I'm getting the hang of it - slau272 (and other family docs) cover the most general case.
    One must read them with the device and package specific limitations blinders on and still expect a few typos.
    Am I getting this game right? Thanks - I needed this discussion to get things clear. (albeit, this notation for vectors is awkward.)
  • Set up the four vectors like this...
    #pragma vector = TIMER0_A1_VECTOR
    __interrupt void T0A1_ISR (void) { /* code */ }
    #pragma vector = TIMER0_A0_VECTOR
    __interrupt void T0A0_ISR (void) { /* code */ }
    #pragma vector = TIMER1_A1_VECTOR
    __interrupt void T1A1_ISR (void) { /* code */ }
    #pragma vector = TIMER1_A0_VECTOR
    __interrupt void T1A0_ISR (void) { /* code */ }
    Code compiles OK. Now a new wrinkle shows up at link time:
    Description Resource Path Location Type
    <a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/10099.html">#10099-D</a>
    program will not fit into available memory. placement with alignment fails for section
    "TIMER1_A0" size 0x4 . Available memory ranges: lnk_msp430fr5738.cmd /I2 line 200 C/C++ Problem
    Any ideas what has happened? The only clue I have is that two vectors (A0) works OK. The CCS help files are useless for this.
  • I am using gcc. In any case, the actual vector number does not matter much; the important thing is that it ends up at the correct memory address. I'd guess "TA" is copied from some MCU that has only one TimerA.
  • placement with alignment fails for section "TIMER1_A0" size 0x4

    I suspect that your program defines two functions for the same vector.

  • Clemens Ladisch said:
    I suspect that your program defines two functions for the same vector.

    That was my initial thought, but when using the TI MSP430 Compiler v4.4.4 and created a program in which two functions defined the same vector I got linker errors of the following form instead:

    error #10056: symbol "__TI_int40" redefined: first defined in "./blink.obj"; redefined in "./dup_isr.obj"

  • Dennis Kodimer said:
    Set up the four vectors like this...
    #pragma vector = TIMER0_A1_VECTOR
    __interrupt void T0A1_ISR (void) { /* code */ }
    #pragma vector = TIMER0_A0_VECTOR
    __interrupt void T0A0_ISR (void) { /* code */ }
    #pragma vector = TIMER1_A1_VECTOR
    __interrupt void T1A1_ISR (void) { /* code */ }
    #pragma vector = TIMER1_A0_VECTOR
     __interrupt void T1A0_ISR (void) { /* code */ }

    I pasted that code fragment into a new project for a MSPFR5738, and the program compiled and linked without error (using TI MSP430 Compiler v4.4.4).

    I am not sure what is causing the error. Can you post your complete CCS project?

  • Disregard that latest post - problem must have been a damaged lnk_msp430fr5738.cmd because I reloaded CCS and the issue went away. The core of the error message - for those who may have the same problem - is assigning
    a value to a vector twice. The error message is cryptic; it means "you can't put two things in the same place." Now I'm running all twelve vectors with a little help from my friends. Thanks.
  • Actually, the 'vector' is a flash memory segment that is two byte size. You can of course put as many objects into a segment as you want. But if their total size exceeds the segment size, then you get an error.
    The pragma implicitly means: "put the address of the next function (the ISR) into the flash segment of this name". And this can happen multiple times. The linker doesn't really know that these are ISR addresses (they could as well be constants of any kind) and therefore gives a not-so-telling error message.

    The vector names for timers are caused by evolution. Originally, there was only one TimerA in a device. But had two vectors. So instead of TIMER_A_VECTOR_0 and TIMER_A_VECTOR_1 (which would have been different form all other vector names ending in _VECTOR) they have been named TIMER_A0_VECTOR and TIMER_A1_VECTOR. Btu then came a device with a second TimerA module. So they extended the names by adding the timer number right behind the word 'TIMER': TIMERx_A0_VECTOR.
    Surely a source of confusion, especially for those who try to port code form older MSPs to newer ones. But who might have imagined that there will ever be an MSP with 512k Flash and 64k Ram and three or four TimerA modules when the first MSPs were released?
  • Jens-Michael Gross is probably the best guy in this forum who can explain things easily. It's so painful that TI does not have an explanation of timers notation anywhere (which is one of the worst notation ever).

**Attention** This is a public forum