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.

CCS/MSP430F5529: Basic assembly interrupt service routine not getting executed, and system halts

Part Number: MSP430F5529


Tool/software: Code Composer Studio

I am trying to have C code that uses assebly code for an interrupt service routine. I am trying very basic examples and I can't get them to work.

This example just calls the interrupt once the button at pin P1.1 is pressed, and in the ISR all I do is toggle the LED at pin P1.0.

I run compile and run this code and I get the following situation:

1) The C program executes and ends up looping in the infinite while loop - just as expected.

2) When I press the button the program jumps somewhere. The LED does NOT get toggled, and disassembly revealse that it is currently at address 0x44, and the command that it's executing is JMP 0x0044. So it never comes back after calling the button press.

It's the most basic example and I can't get it to work.

I don't know if you have to somehow tell the linker that the interrupt.asm file exists. I just created a new file i code composer studio.

Why does this happen?

Thank you for any help.

Here's the C code: (main.c)

#include <msp430.h>

int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer
  P1DIR |= BIT0;                            // Set P1.0 to output direction -> LED
  P1REN |= BIT1;                            // Enable P1.1 internal resistance
  P1OUT |= BIT1;                            // Set P1.1 as pull-Up resistance
  P1IES |= BIT1;                            // P1.1 Hi/Lo edge
  P1IFG &= ~BIT1;                           // P1.1 IFG cleared
  P1IE |= BIT1;                             // P1.1 interrupt enabled
  
  __bis_SR_register(GIE);       // Enable interrupt
  while(1);
}

And here is the assemby: (interrupt.asm)

		.cdecls C,LIST,"msp430f5529.h"

			.text
Port_1		xor.b #001h,P1OUT
			mov.b #0h,P1IFG

			.sect 		.int47
			.short 		Port_1

		.end

**Attention** This is a public forum