AtMega 644PA Signal Names

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

Hi

I am porting a project framework from an AtMega 64 to a 644PA.

I am having a certain amount of difficulty getting some of the interrupts to execute properly and I suspect that is because the "SIGNAL" names have changed from processor to processor.

I have always found these names to be entirely non-obvious and I cannot even find definitions of them!

Would any of you kind folk point me at where they have been "hidden"?

Thanks in advance,
Andy G

If we are not supposed to eat animals, why are they made out of meat?

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

Quote:

I have always found these names to be entirely non-obvious and I cannot even find definitions of them!

Well the user manual is one place to look:

http://www.nongnu.org/avr-libc/u...

(see the very large table in that). The other place to look (and the reason for the non-intuitive names) is that, where possible, AVR-LIbC's *_vect names simply try to duplicate the names given in the table of the device datasheet.

In the copy of the mega644 data I have the interrupts are documented in chapter 9 on page 61. The column in that table labelled "Source" then lists (Reset),"INT0", "INT1", "INT2", "PCINT0", "PCINT1" and so on so I would expect the vectors to be called:

INT0_vect
INT1_vect
INT2_vect
PCINT0_vect
PCINT1_vect
etc.

If I build an empty main() program with a #include and building for atmega644pa then when I look at dependencies I see iom644pa.h listed and on double-clicking to edit it I find:

/* Interrupt vectors */
/* Vector 0 is the reset vector */
#define INT0_vect_num  1
#define INT0_vect      _VECTOR(1)  /* External Interrupt Request 0 */
#define INT1_vect_num  2
#define INT1_vect      _VECTOR(2)  /* External Interrupt Request 1 */
#define INT2_vect_num  3
#define INT2_vect      _VECTOR(3)  /* External Interrupt Request 2 */
#define PCINT0_vect_num  4
#define PCINT0_vect      _VECTOR(4)  /* Pin Change Interrupt Request 0 */
#define PCINT1_vect_num  5
#define PCINT1_vect      _VECTOR(5)  /* Pin Change Interrupt Request 1 */
#define PCINT2_vect_num  6
#define PCINT2_vect      _VECTOR(6)  /* Pin Change Interrupt Request 2 */
#define PCINT3_vect_num  7
#define PCINT3_vect      _VECTOR(7)  /* Pin Change Interrupt Request 3 */
#define WDT_vect_num  8
#define WDT_vect      _VECTOR(8)  /* Watchdog Time-out Interrupt */
#define TIMER2_COMPA_vect_num  9
#define TIMER2_COMPA_vect      _VECTOR(9)  /* Timer/Counter2 Compare Match A */

which seems to confirm the vectors are named as per the datasheet interrupt table.

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

Quote:
I suspect that is because the "SIGNAL" names have changed

Also note that the SIGNAL keyword is supposed to be "no longer used" for defining Interrupt Service Routines. You're supposed to use "ISR" instead.

The newer chips do not have the SIG_xxxx defines in their io.h files, only the "new style" xxx_xxxx_vect defines.

http://www.nongnu.org/avr-libc/u...

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

Thanks, guys.

I had thought of checking the user manual. :) It's just that I am too thick to understand it. :(

Cheers
Andy

If we are not supposed to eat animals, why are they made out of meat?

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

Quote:
It's just that I am too thick to understand it.

Unless you start spinning you will never get thinner.. :wink:

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

I shall remember that, Johan. :)

If we are not supposed to eat animals, why are they made out of meat?