I downloaded the binaries from https://www.ghielectronics.com/community/codeshare/entry/633 (Version 13) since I did not see any binaries on codeplex. I looked at the source code but it seemed okay to me.
The interference happens even between ports which is weird. And also, the faster I roll the coin through the “gate”, the more other interrupts I get. I can solve any glitch issue on a single port by increasing the glitch timer, but when interrupts start to leak to other pins, I can’t solve it via software.
I talked to an electrical engineer and he figured it could be an EMC issue, he figured maybe it is some high frequency noise being generated and said perhaps I should try to put in a capacitor. I only had a 10uF capacitor, which I tried, but did not help.
The code looks like this:
this.module = new DLIOModule(4);
this.interruptPin1 = this.module.CreateInterruptPin(2, 0, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow, 100);
this.interruptPin1.Interrupt += this.interruptPin_Interrupt_1;
this.interruptPin2 = this.module.CreateInterruptPin(3, 1, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow, 100);
this.interruptPin2.Interrupt += this.interruptPin_Interrupt_2;
this.interruptPin3 = this.module.CreateInterruptPin(2, 7, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow, 100);
this.interruptPin3.Interrupt += this.interruptPin_Interrupt_3;
this.interruptPin4 = this.module.CreateInterruptPin(2, 5, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow, 100);
this.interruptPin4.Interrupt += this.interruptPin_Interrupt_4;
this.interruptPin5 = this.module.CreateInterruptPin(0, 7, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow, 100);
this.interruptPin5.Interrupt += this.interruptPin_Interrupt_5;
(more similar code follows...)
As you can see, I soldered the wires to completely random external pins on various ports in order to minimize issues, but also that did not seem to help. I tried different values for the glitch timer, too.
The “gate” where the coin falls through is made of two aluminum foils from the kitchen (DIY style). They’re soldered to two wires, and one is connected to an interrupt pin and the other to GND.
I might change the design to use a light barrier after all. I am posting this here to just make sure it’s not a bug in the firmware.
Other than that, I can only say, this firmware is really great and easy to use!
//Edit: fix typos