avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] newbie interrupts question


From: Lars Noschinski
Subject: Re: [avr-gcc-list] newbie interrupts question
Date: Mon, 8 May 2006 08:03:56 +0200
User-agent: mutt-ng/devel-r790 (Linux)

* Eric Smith <address@hidden> [2006-05-08 07:58]:
My question is this:  how do I set up this interrupt vector table using C?
Or, if I have to mix assembly with C to do it, that's fine -- but can you
tell me (show me) explicitely how to do it?

You just declare your interrupt handlers using for example

ISR (TIMER2_COMPA_vect) {
   ...
}

The vector table is automatically setup

I have to be able to set up the interrupt vectors such that when my timer
reaches zero, and the interrupt is generated, the appropriate routine is
called.  Also, I'm assuming that if I enable interrupts I'll need vectors
for all available interrupts even if I'm only going to use one, is that
right?

You need an handler for every enabled interrupt. But setting the global
interrupt enable bit does only enable interrupt handling, the specific
interrupts need to be enabled seperatly.




reply via email to

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