Spurious interrupts on Due

I have attached the encoders from two motors to two isr's in the conventional manner:

attachInterrupt(MOT_RIGHT_ENCA, encoderIsrRight, CHANGE); attachInterrupt(MOT_LEFT_ENCA, encoderIsrLeft, CHANGE);

These isr's get called occasionally even when there has been no change in state. I am able to get around this by checking to see if there is actually a state change and ignoring the spurious interrupts. I have put a scope on these lines and LP filtered them to make sure there are no actual state changes. The normal interrupts occur at a rather high rate--every 100 microseconds or so--but the spurious interrupts may not occur for several seconds or may occur several times a second. There is nothing else going on the processor except that data is coming in on a serial port at a fairly high rate.

Here are my questions:

  1. Is this a bug and, if so, should I file a bug report?
  2. If I file a bug report, is it likely to get any attention in a reasonable time?

All of this code and more worked just fine on a arduino mega 2560 but I moved it to the Due primarily to get more SRAM. After making the move to the Due I had to move the timers and i2c processing to another processor to avoid various crashes due to what I assume were other interrupt problems. I am about to abandon all hope for the Due and move to another processor but I thought I would give it one last shot on this forum. I do like the 32 bit data path, the processor speed, and the extra SRAM and code space. I am willing to run any test code or make modifications if it will help to track down these problems.

Use strong pull-up resistors (1k or so) to 3.3V on the encoder outputs right at the Due's inputs. You are likely just picking up noise - doesn't take much energy to trigger a high speed low voltage logic input. Shielded cable from the encoders is a normal precaution.

I am quite sure that these interrupts are not occurring because of the signal on the pin. I won't go into great detail about all of the precautions I have taken but no matter how the signal is conditioned (even after first passing through another Arduino Pro!), the interrupts still occur.

My apologies to the forum for posting a "spurious" bug and to the Arduino Due for casting false aspersion on a fine Arduino platform. It turns out that, as MarkT suggested, the interrupts are coming in on the pin and need to be filtered out. I was able to get rid of the problem by replacing a noisy motor. I am busy on a new version of my project--http://twopotatoe.net/--and will definitely incorporate the shielding and pullups that MarkT suggest.

I have also solved the i2c problem that i mentioned by replacing an IMU, so the Due is blameless there as well. I sure would like to see output buffered serial and a standard Tone library would be nice, so I think the Due still needs a little work.

I experienced the same. Sometimes very rarely, ISR called although the input is unchanged. I use INPUT_PULLUP mode to enable the internal pullup resistors.