Exception on G80 with InterruptPorts


the following code is throwing an exception on the “_intB.OnInterrupt += _intB_OnInterrupt;” line and I cannot see what I am doing wrong :-[

public class Program
        private static InterruptPort _intA, _intB;

        public static void Main()
            _intA = new InterruptPort(GHI.Pins.G80.Gpio.PC6, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
            _intB = new InterruptPort(GHI.Pins.G80.Gpio.PE6, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);

            _intA.OnInterrupt += _intA_OnInterrupt;
            _intB.OnInterrupt += _intB_OnInterrupt;   // Exception thrown on this line

        static void _intB_OnInterrupt(uint data1, uint data2, System.DateTime time)

        static void _intA_OnInterrupt(uint data1, uint data2, System.DateTime time)

Any help would be welcome…

@ Bec a Fuel -

I remember NETMF is not happy with Port.InterruptMode.InterruptEdgeBoth.

It does not seem to like any of the Interrupt Modes except the EdgeLevelHigh. It fails on all other modes when using these two pins.

But why?

STM32 chips only have 16 interrupts, one for each pin on any port.

PC6 and PA6 will not work because they are both using interrupt 6.

1 Like

Makes sense now and thanks for the explanation.

My memory is not what it used to be :think:

Thank you !

@ Dat, can you elaborate on this? I’m having issues trying to use Port.InterruptMode.InterruptEdgeBoth.

@ DarrenUtd - what product and please show an example code to sow the problem.