Pages: [1]   Go Down
Author Topic: Interrupts  (Read 626 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Arduin Yún - Arduino for the cloud
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 81
Arduino rocks my socks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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: millis() 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:
ISR(TIMER0_OVF_vect) {
...
}
Logged

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 323
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There's also MsTimer2 interface for setting up timer-based interrupts on Timer2 easily.

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

!c
« Last Edit: December 02, 2008, 05:04:39 pm by drone » Logged

0
Offline Offline
God Member
*****
Karma: 1
Posts: 513
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: