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

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

Re: [avr-gcc-list] external interrupt sample code


From: Ian Caddy
Subject: Re: [avr-gcc-list] external interrupt sample code
Date: Thu, 15 Apr 2004 09:58:57 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040316

Hi David,

Here is a snipit of code from our system where we use INT0:

  /* Now lastly we enable the HINT interrupt on INT0, on falling edge */
  outp(BV(ISC01) , EICRA);
  outp(BV(INT0) , EIMSK);

That is all that is required to enable INT0 on the falling edge. Then you just need to have an interrupt service routine:

SIGNAL(SIG_INTERRUPT0)
{
 blah
}

And everything should work from there.

Hope this helps,

Ian Caddy


David Morrison wrote:

Hi all,
I am trying to use the external interrupt0 on the ATMega128 and am running into 
problems, does anyone have a simple program that demonstrates how to set up the 
pin as an external interrupt?
Thanks,
dave


I have always wished that my computer would be as easy to use as my telephone. 
My wish has come true. I no longer know how to use my telephone.
        -Bjarne Stroustrup, computer science professor, designer of C++
       programming language (1950- )
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list



reply via email to

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