Created
August 19, 2012 23:49
-
-
Save blondie7575/3398663 to your computer and use it in GitHub Desktop.
AVR interrupt setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Configure INT2 (interrupt 2, on line PB2) to be a rising | |
// edge interrupt that we'll get from the CPU | |
// See ATmega324PA datasheet p68 | |
cbi EIMSK,INT2_BIT | |
ldi accum,EICRA | |
ori accum,_BV(ISC20) | _BV(ISC21) | |
sts EICRA,accum | |
cbi EIFR,INTF2 | |
sbi EIMSK,INT2_BIT | |
... | |
INT2_vect: | |
sbi PORTB,led | |
reti |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment