[Top][All Lists]

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

Re: [avr-gcc-list] qn regarding interrupt

From: Clemens Buchacher
Subject: Re: [avr-gcc-list] qn regarding interrupt
Date: Sun, 6 Jun 2004 11:15:05 +0200
User-agent: Mutt/1.5.6i

On Sat, Jun 05, 2004 at 01:10:27PM -0700, harshit suri wrote:
> is this correct
> --program the EICRA or EICRB registers
> --enable relvant interrupts in EIMSK
> --But do not sei(); 

It would do what you want, but you would also globally disable
interrupts, which may not be desirable.

You should clear the appropriate bits in the EIMSK register to
deactivate the interrupts. The flags in the EIFR will still be set when
an interrupt condition is detected. That way you can still use the
global interrupt flag independently.

Note that you will have to clear the flags by writing a logical one to
the EIFR when you handle the interrupt.

> this way i hope to enable the interrupts but not jump
> to their corresponding interrupt handlers. Is it
> correct?

Yes, except that 'enabling' the interrupts in the sense of 'having the
interrupt flag register updated' is not necessary. Unmasking an
interrupt by setting a bit in the interrupt mask register means that you
want to execute an interrupt service routine when the corresponding
interrupt is requested (provided that interrupts are not disabled


reply via email to

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