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.

msp430x16x.h

Hi,

I am new to code composer studio and msp43016F1611.

I have a code written by my client where there is a File called Interupt.c and have the following code.

#include <msp430x16x.h>

extern interrupt void Timer_A0_Handler(void);
TIMERA0_ISR(Timer_A0_Handler)

extern interrupt void Timer_A12_Handler(void);
TIMERA1_ISR(Timer_A12_Handler)

extern interrupt void Port2_Handler(void);
PORT2_ISR(Port2_Handler)

extern __interrupt void I2C_Handler(void);
USART0TX_ISR(I2C_Handler)

extern interrupt void ADC_Handler(void);
ADC12_ISR(ADC_Handler)

extern interrupt void NMI_Handler(void);
NMI_ISR(NMI_Handler)

extern interrupt void Comparator_Handler(void);
COMPARATORA_ISR(Comparator_Handler)

extern interrupt void UARTTX_Handler(void); //BT #1481864546
USART1TX_ISR(UARTTX_Handler)

in #include <msp430x16x.h> i could see all the #defined used in thsi file (e.g, TIMERA0_ISR,.......USART1TX_ISR,COMPARATORA_ISR) all are under commented section and so the workspace is not compiling.

Could someone suggest whether is it advisable to use TIMERA0_VECTOR instead of TIMERA0_ISR (like wise for all others)

Thanks and Regards,

Aarthi

  • Typically you use the VECTOR definitions. I am not familiar with the older versions of the toolchain, so maybe this is due to tool version.

    These are the definitions in the IAR tool:

    /************************************************************
    * Interrupt Vectors (offset from 0xFFE0)
    ************************************************************/

    #define DACDMA_VECTOR       (0 * 2u)  /* 0xFFE0 DAC/DMA */
    #define PORT2_VECTOR        (1 * 2u)  /* 0xFFE2 Port 2 */
    #define USART1TX_VECTOR     (2 * 2u)  /* 0xFFE4 USART 1 Transmit */
    #define USART1RX_VECTOR     (3 * 2u)  /* 0xFFE6 USART 1 Receive */
    #define PORT1_VECTOR        (4 * 2u)  /* 0xFFE8 Port 1 */
    #define TIMERA1_VECTOR      (5 * 2u)  /* 0xFFEA Timer A CC1-2, TA */
    #define TIMERA0_VECTOR      (6 * 2u)  /* 0xFFEC Timer A CC0 */
    #define ADC12_VECTOR          (7 * 2u)  /* 0xFFEE ADC */
    #define USART0TX_VECTOR     (8 * 2u)  /* 0xFFF0 USART 0 Transmit */
    #define USART0RX_VECTOR     (9 * 2u)  /* 0xFFF2 USART 0 Receive */
    #define WDT_VECTOR          (10 * 2u) /* 0xFFF4 Watchdog Timer */
    #define COMPARATORA_VECTOR  (11 * 2u) /* 0xFFF6 Comparator A */
    #define TIMERB1_VECTOR      (12 * 2u) /* 0xFFF8 Timer B CC1-6, TB */
    #define TIMERB0_VECTOR      (13 * 2u) /* 0xFFFA Timer B CC0 */
    #define NMI_VECTOR          (14 * 2u) /* 0xFFFC Non-maskable */
    #define RESET_VECTOR        (15 * 2u) /* 0xFFFE Reset [Highest Priority] */

    #define UART1TX_VECTOR      USART1TX_VECTOR
    #define UART1RX_VECTOR      USART1RX_VECTOR
    #define UART0TX_VECTOR      USART0TX_VECTOR
    #define UART0RX_VECTOR      USART0RX_VECTOR
    #define ADC_VECTOR          ADC12_VECTOR


  • Thi interrupt.c seems to be a wrapper code that seems to generate interrupt entry points for external ISRs.
    Likely for one specific project that needs all these ISRs, and for porting the project C code from a different compiler or compiler version to the one that uses these macros.

    If the posted code is the whole content of the interupt.c file, remove it from the project and use the proper pragma with the VECTORs just before the ISRs.

**Attention** This is a public forum