Well, I've looked for some documentation on attachInterrupt() for ZERO and I assumed it would be like DUE. Ref manual says there are 16 external interrupts and nearly all pins are mapped to one of those channels. ZERO product web page says external interrupt on all pins except 4 (NMI?) I tried the following simple sketch
answering my own query: part of the problem was my test sketch which tried to attachInterrupt on 20 pins. The EIC only has 16 interrupt pins, so some pins will clearly have to share. So the pins that were "working" in the test sketch were only those that were not sharing an EIC pin.(0,1,5,11,12,13). pin 4 is maybe the NMI ??
so if i just attached one pin in the sketch, then I got all the pins to work EXCEPT 2, 8, 9. I'm not sure about 2 (are 2 and 4 switched?)
BUG >:(
For pins 8 and 9 variant.cpp is wrong. pin 8 needs to use EXTERNAL_INT_6. pin 9 needs to use EXTERNAL_INT_7 (reference manual table 5-1). I edited variant.cpp and got 8 and 9 to work.
Not yet sure how to fix pin 2. pin 4 only works if pin 2 is also configured for attachInterrupt()
Sorry to revive a really old thread, but I was just curious about the NMI interrupt and how it compares with the other EIC interrupts.
If I understand correctly, the fix that was brought in with 1.6.2 removed the ability to attach an interrupt on D4 which uses NMI line.
I was wondering why the NMI interrupt was removed completely? Was it just because it required specialised code for handling that one interrupt (as well as hard coding of the pin value)? Or is there some other fundamental difference with the NMI that makes it unsuitable to be used in the same way as the other external interrupts?
Unfortunately it's not possible to use I2C on D8 and D9, as although these pins have SERCOM (serial communications) functionality, they're not suitable for I2C.