cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
greenleafone7
Observer
Observer
668 Views
Registered: ‎10-23-2020

PIN1 interrupt not firing up, while timer interrupts work fine in simulation.

I am simulating msp430 using Vivado behavioural simulation. Everything seems to be working fine except from when I tried to test hardware interrupts. The following timer interrupt seems to work fine.

Configured like this:

 

CCTL0 = CCIE;
CCR0 = 100;
TACTL = TASSEL_2 + MC_1; 

 

with the following handler:

 

interrupt(TIMERA0_VECTOR) TIMER0_A0_ISR (void)
{
	P3OUT=30;
}

 

 

When I tried moving to hardware interrupts, by simulating a button on pin1, with the following configuration:

 

  P1DIR  = 0x00;                     // Port 1.0-1.7 = input
  P1IE   = 0x01;                     // Port 1.0 interrupt enabled
  P1IES  = 0x00;                     // Port 1.0 interrupt edge selection (0=pos 1=neg)
  P1IFG  = 0x00;                     // Clear all Port 1 interrupt flags (just in case)

 

and this handler:

 

interrupt(PORT1_VECTOR) port1_isr(void) {
	P3OUT=60;
 	P1IFG           &= ~0x01;         // Clear Port 1.0 interrupt flag
}

 

Nothing seems to be happening.

 

I know, by examining the compiled code that this function sits at this address:

 

interrupt(PORT1_VECTOR) port1_isr(void) {
    e052:	0f 12       	push	r15		
    e054:	0e 12       	push	r14		
    e056:	0d 12       	push	r13		
    e058:	0c 12       	push	r12		
	P3OUT=60;
    e05a:	f2 40 3c 00 	mov.b	#60,	&0x0019	;#0x003c
    e05e:	19 00 

 

and I can verify that this address is on the pmem.mem file loaded into Vivado. I've enabled interrupts by running `eint();`, and I am testing by changing `p1_dint` to `01`.

 

My code follows this example mostly.

 

Why is this interrupt not firing up, how can I fix it?

Tags (2)
0 Kudos
0 Replies