Hi!
I spent a couple of hours trying to make a sketch work with my new Arduino Due, then I discovered a strange thing: some interrupts are never triggered...
It's clearly stated that the Arduino Due is able to attach an interrupt on any available pin (source: http://arduino.cc/en/Reference/AttachInterrupt) but it seems that interrupts on the following pins are not working: 11, 12, 14, 15, 20, 21, 25, 26, 27, 28, 29, 30, 32, A7. (I can read values correctly from each of them, but no interrupt callback is ever called)
Can anyone confirm this?
I wrote a simple sketch that attaches an interrupt to any pin from 2 to 53 and from A0 to A11:
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
uint8_t pins[64] = {
// TX0 and RX0 can't be checked this way...
// 0,
// 1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
A0,
A1,
A2,
A3,
A4,
A5,
A6,
A7,
A8,
A9,
A10,
A11
};
for (uint8_t i = 0; i < 64; i++) {
pinMode(pins[i], INPUT);
attachInterrupt(pins[i], callback, CHANGE);
}
Serial.println("READY!");
}
void loop() {
// Nothing...
}
void callback() {
Serial.println("IT WORKS!");
}
Trigger the interrupts manually and see what happens...
Note: I know that using complex callbacks is a bad idea, but I had the same result with lighter callbacks...
Note2: If you are wondering... no, it does not work even if you attach one single interrupt to any of the pins listed above... and the affected pins are always the same. (at least till now)