ISR vector not populated [self solved]

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

!!!!! I put the exclamations here!!!!

EDIT Current/Latest AS6 used
I have spent a couple of hours trying to get some interrupts to fire, everything SEEMS to be set up correctly, the ISR code is not being optimised out, the PMIC is set correctly etc, however I have just discovered that the actual vectors are NOT populated with the jump addresses to the ISR.

00000000  JMP 0x00000056		Jump 
00000002  JMP 0x00000073		Jump 
00000004  JMP 0x00000073		Jump 
00000006  JMP 0x00000073		Jump 
00000008  JMP 0x00000073		Jump 
0000000A  JMP 0x00000073		Jump 
0000000C  JMP 0x00000073		Jump 
0000000E  JMP 0x00000073		Jump 
00000010  JMP 0x00000073		Jump 
00000012  JMP 0x00000073		Jump 
00000014  JMP 0x00000073		Jump 
00000016  JMP 0x00000073		Jump 
00000018  JMP 0x00000073		Jump 
0000001A  JMP 0x00000073		Jump 
0000001C  JMP 0x00000073		Jump Should go to TCC4_CCA_vect
0000001E  JMP 0x00000073		Jump Should go to TCC4_CCB_vect
00000020  JMP 0x00000073		Jump 
00000022  JMP 0x00000073		Jump 
00000024  JMP 0x00000073		Jump 
00000026  JMP 0x00000073		Jump 
00000028  JMP 0x00000073		Jump 
0000002A  JMP 0x00000073		Jump 
0000002C  JMP 0x00000073		Jump 
0000002E  JMP 0x00000073		Jump 
00000030  JMP 0x00000073		Jump 
00000032  JMP 0x00000073		Jump 
00000034  JMP 0x00000073		Jump 
00000036  JMP 0x00000073		Jump 
00000038  JMP 0x00000073		Jump 
0000003A  JMP 0x00000073		Jump 
0000003C  JMP 0x00000073		Jump 
0000003E  JMP 0x00000073		Jump 
00000040  JMP 0x00000073		Jump 
00000042  JMP 0x00000073		Jump 
00000044  JMP 0x00000073		Jump 
00000046  JMP 0x00000073		Jump 
00000048  JMP 0x00000073		Jump 
0000004A  JMP 0x00000073		Jump 
0000004C  JMP 0x00000073		Jump 
0000004E  JMP 0x00000073		Jump 
00000050  JMP 0x00000073		Jump 
00000052  JMP 0x00000073		Jump 
00000054  JMP 0x00000073		Jump 

Have I forgotten something?? :roll:

The ISR code looks like this (and yes I have a chip with TTC4, just in case)

ISR (IVEC_TCC4_CCA_vect)
{
	if ((time_scaler--)==0)
		{
		time_scaler=25;
		// 100ms tasks done here if any
		PORTD_OUTTGL=(1<<PIN5_bp);
		
		
		if ((one_second_timer--)==0)
			{
			one_second_timer=10;
			// 1s tasks done here if any
			PORTD_OUTTGL =(1<<PIN4_bp);
			}
		}		
}	


ISR (IVEC_TCC4_CCB_vect)
{
	if ((time_scaler--)==0)
		{
		time_scaler=25;
		// 100ms tasks done here if any
		PORTD_OUTTGL=(1<<PIN5_bp);
		
		
		if ((one_second_timer--)==0)
			{
			one_second_timer=10;
			// 1s tasks done here if any
			PORTD_OUTTGL =(1<<PIN4_bp);
			}
		}		
}

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Sat. Dec 29, 2012 - 05:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well it seems to have been fixed by removing the IVEC_ from the ISR! ie

ISR (TCC4_CCA_vect)
ISR (TCC4_CCB_vect)

Yet not even a warning or an error was raised.

IVEC_TCC4_CCA_vect and IVEC_TCC4_CCB_vect are the names used in the 128A1 datasheet so I copied them from there. :?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From the documentation (http://www.nongnu.org/avr-libc/u...):

Quote:
Note:
The ISR() macro cannot really spell-check the argument passed to them. Thus, by misspelling one of the names below in a call to ISR(), a function will be created that, while possibly being usable as an interrupt function, is not actually wired into the interrupt vector table. The compiler will generate a warning if it detects a suspiciously looking name of a ISR() function (i.e. one that after macro replacement does not start with "__vector_").

Jeff Nichols

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The problem being that no warning was generated like it happens with AS4.

I should have known something funny was happening when I originally used TCCO instead of TCC4 and no warning was raised even though TCCO doesn't exist.

All is well that ends..... :-)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly