Arduino DUE - Interrupt Trigger Sensitivity / Interference?

Finding the DUE very difficult to use interrupts, assuming due to signal noise on the pin. (There is a spark near by)

Using my oscilloscope I don't notice any significant interference even at very high sampling rates but my assumption is still that there is some high frequency noise on that pin that is triggering the interrupt.

This is a long shot, but is there any way to programmatically alter the trigger sensitivity on interrupts? Or is this a hardware set thing? Is the threshold for HIGH/LOW the same for interrupts as it is for a normal digitalRead() on any other pin?

I ask because I just discovered the DUE's DAC seem to have a non-intuitive range (0.55 to 2.75V rather than 0V to 5V) and I'm curious if enabling an interrupt on a pin might similarly change the range in which it functions?

I suppose the obvious answer is to filter the pin some how for high freq noise. I currently have an external pullup on the pin to 5V but this appears to do little to filter the noise (tried a few different values.)

Can someone make a recommendation for how to correctly filter noise and keep that pin rock solid at 0V or 5V at all times?

I know I can opto-isolate and that should take current problems away and I guess depending on the on/off time of the opto-isolator, it might even filter out some high frequency noise ? Is that possible?

bignic: ... I currently have an external pullup on the pin to 5V but this appears to do little to filter the noise (tried a few different values.) ...

Ummmm, isn't the DUE a 3.3 volt machine? I don't have one, but the website page on the DUE says:

Warning: Unlike most Arduino boards, the Arduino Due board runs at 3.3V. The maximum voltage that the I/O pins can tolerate is 3.3V. Applying voltages higher than 3.3V to any I/O pin could damage the board.

Could that be the problem?

Yes, as ChrisTenone has DUE-ly noted ;) , make sure that all signals connected to the DUE are no more than 3.3V.

bignic: Finding the DUE very difficult to use interrupts, assuming due to signal noise on the pin. (There is a spark near by)

Ignition coil? Relay contacts? Could you post a schematic or connection diagram?

bignic: Using my oscilloscope I don't notice any significant interference even at very high sampling rates but my assumption is still that there is some high frequency noise on that pin that is triggering the interrupt.

Could be from EMI or RF emissions, or probably just a poorly generated signal. More details of your project would be helpful. Some questions that come to mind ... have you avoided ground loops? Is your power source adequate and stable? Depending on your project, you may need to consider opto isolation, EMI suppression (MOV, snubber or ferrite core), shielded cables, increasing the distance to the source of interference.

bignic: This is a long shot, but is there any way to programmatically alter the trigger sensitivity on interrupts? Or is this a hardware set thing? Is the threshold for HIGH/LOW the same for interrupts as it is for a normal digitalRead() on any other pin?

Most pins have the same characteristics ... review section "45.2 DC Characteristics" in the datasheet.

bignic: I ask because I just discovered the DUE's DAC seem to have a non-intuitive range (0.55 to 2.75V rather than 0V to 5V) and I'm curious if enabling an interrupt on a pin might similarly change the range in which it functions?

Yes, the DAC outputs 1/6 to 5/6 of 3.3V for 0-4095 digital range. Nothing changes this, its part of the hardware design.

Enabling an interrupt on a pin does not change the range in which it functions.

bignic: I suppose the obvious answer is to filter the pin some how for high freq noise. I currently have an external pullup on the pin to 5V but this appears to do little to filter the noise (tried a few different values.)

I hope you meant 3.3V. Using a series resistor can reduce ringing and noise on the input. Its value would depend on the max frequency required for your input. Note that all inputs have a hardware debounce feature. I don't believe there's any library for this so it would require some direct hardware/register programming.

bignic: Can someone make a recommendation for how to correctly filter noise and keep that pin rock solid at 0V or 5V at all times?

Again, I hope you meant 3.3V. Giving us some details of your signal source would be very helpful.

bignic: I know I can opto-isolate and that should take current problems away and I guess depending on the on/off time of the opto-isolator, it might even filter out some high frequency noise ? Is that possible?

Well, it depends on the type of noise. Conductive EMI is avoided, emissive RF could still be a problem, a poorly generated signal with lower frequency ripple noise, whatever could still get duplicated on the transistor side, but it would definitely be within the 0-3.3V input specification and not go beyond the power rails.

facepalm

Whats the easiest way to reduce a 5V digital signal to 3.3v??

I'll start with that first and then work on filtering it :/

Couple of resistors to make a resistor divider.

For high speed signals, jump up to cd74HC4050 powered from 3.3V.

Oh gosh ... the DUE is not very forgiving with 5V signals. You may want to try a simple test sketch to see if the inputs and outputs you're using still work.

So far all the inputs still seem to work. Not sure why I wasn't aware that it was a 3.3V machine but I guess I just wasn't paying attention.

At the moment it looks like its still triggering without anything even connected to the pin, or even just an external pullup so its not my signal that is actually generating the noise on the pin - its definitely radio and the sparkplug nearby is the only thing I can think that would generate the noise (if not the coil also.)

The level shifting I don't think is a problem any more but the noise definitely is.

If you turn off the spark plug (?) does it work?

An Arduino DUE works on VCC= 3.3V voltage and not VCC=5V like the 8-bit Atmegas, therefore a "HIGH" level with the DUE is at VCC*0.6= 3.3*0.6= 1.98 Volt while an UNO has a HIGH level of 5*0.6=3.0 Volt.

LOW level voltage is different for DUE and UNO accordingly.

So to prevent wrong input level readings (no matter whether in interrupts or not) you have to MUCH BETTER PROTECT the DUE against electromagnetic interference than you have with an UNO.

Check your hardware circuit and your EMI protection provisions!