avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] atmega32 and interrupt handler problem


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] atmega32 and interrupt handler problem
Date: Wed, 16 Jan 2008 08:56:39 +0100
User-agent: Mutt/1.5.11

As Andrew S wrote:

> Investigating this further, I found that the following corresponded
> with the microcontroller running the correct interrupt handler for
> the interrupt in question:

> ISR(_VECTOR(8))
> { .. }

That would be TIMER1_COMPB_vect.  Are you sure you are running the
correct timer? ;-)  Can you post the entire code?

> Examining iom32.h, TIMER2_COMP_vect has been defined as
> _VECTOR(4). The difference (unconfirmed) being that $008 is the
> interrupt vector address and 4 is the index number? Can someone with
> more knowledge explain whats going on here?

_VECTOR(4) means interrupt vector slot #4, with #0 being the reset
vector, #1 being the first interrupt vector, and so on.  (Note that
this is off by one, compared with the numbering of the Atmel
datasheet.)  The size of each vector slot can either be 2 or 4 bytes,
depending on whether the device supports JMP opcodes, or can only use
RJMP (which fits into 2 bytes).

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]