Go Down

Topic: Interrupts (Read 679 times) previous topic - next topic

Claus

Is it possible to use internal interrupts, like Timer0 Int etc.? I could find handling external interrupts in the reference only.

acleone

It is, but you'll have to use straight-up avr-libc (there's no beginner-friendly Arduino methods).  See
http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html

fyi: [font=Courier New]millis()[/font] uses the timer0 overflow - see <arduino folder>/hardware/cores/arduino/wiring.c.  It uses the old style declaration, it should probably be changed to
Code: [Select]
ISR(TIMER0_OVF_vect) {
...
}

drone

#2
Dec 02, 2008, 11:04 pm Last Edit: Dec 02, 2008, 11:04 pm by drone Reason: 1
There's also MsTimer2 interface for setting up timer-based interrupts on Timer2 easily.

http://www.arduino.cc/playground/Main/MsTimer2

!c

dcb

with the exception of timer0 overflow, you can define any interrupt you want within arduino.

Go Up