Main Site Documentation

Hub AP5 - Interrupts


#1

Has anyone used the Hub AP5 module and reliably been able to get interrupt notifications?

If I load the HubAP5_42.cs into the IDE and set break points in the IO60P16.OnInterrupt method then I get the interrupts, but as soon as I remove the break points then the interrupts are no longer generated.

I have not spent anytime delving into the code, I know we have a few IO60P16 experts lurking the forums…

Btw. I am connecting a button module to the socket to test the interrupts, nothing complex.


#2

Mainboard?


#3

And what sockets are the hub and button plugged into? I had a hub on socket 4 of the Spider with a button on hub socket 1 and the interrupts were generated reliably.


#4

I have quickly tested on the Cerberus and it work fine, the problematic board was the G400HDR.

G400HDR - Socket 7
Cerberus - Socket 2

Hub AP5 - Socket 1 & 8

I also tested the G400HDR with a button connected directly to Socket 7 and interrupts are working fine. I2C is working, since from the HUB AP5 I could read the joystick analog signal, but the interrupts did not work reliably.


#5

Could you test with the other boards we offer? Spider, Cobra, anything you have. And what version of the header and G400 are you using?


#6

And what version of the firmware and TinyBooter is the board running? G400 didn’t have pull-down resistors until the most recent SDK, and the interrupt pin uses pull downs.


#7

So far I have tested

G400-D v1.2 - Not working
HalSystemInfo.halVersion :4.2.0.0
HalSystemInfo.halVendorInfo :Microsoft Copyright © Microsoft Corporation. All rig
ClrInfo.clrVersion :4.2.0.0
ClrInfo.clrVendorInfo :Microsoft Copyright © Microsoft Corporation. All rig
ClrInfo.targetFrameworkVersion :4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.11.1
SolutionReleaseInfo.solutionVendorInfo: Copyright © GHI Electronics, LLC
SoftwareVersion.BuildDate: Oct 23 2013
SoftwareVersion.CompilerVersion: 410713

Cerberus - Works
HalSystemInfo.halVersion :4.2.0.0
HalSystemInfo.halVendorInfo :Copyright GHI Electronics, LLC
ClrInfo.clrVersion :4.2.0.0
ClrInfo.clrVendorInfo :Copyright GHI Electronics, LLC
ClrInfo.targetFrameworkVersion :4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.6.1
SolutionReleaseInfo.solutionVendorInfo: Copyright © GHI Electronics, LLC
SoftwareVersion.BuildDate: Oct 17 2013
SoftwareVersion.CompilerVersion: 410713

I will test other boards as soon as possible and post here.


#8

I have tested on a few more boards

FEZ Spider Worked
ClrInfo.clrVersion :4.2.0.0
ClrInfo.clrVendorInfo :Microsoft Copyright © Microsoft Corporation. All rig
ClrInfo.targetFrameworkVersion :4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.11.1
SolutionReleaseInfo.solutionVendorInfo: Copyright © GHI Electronics, LLC
SoftwareVersion.BuildDate: Oct 17 2013
SoftwareVersion.CompilerVersion: 410713

FEZ Hydra - Hub AP5 Initialization fails (Hub AP5 plugged into socket 5)
Using mainboard GHI Electronics FEZHydra version 1.2
#### Exception System.ArgumentException - 0xfd000000 (1) ####
#### Message:
#### Microsoft.SPOT.Hardware.Port::.ctor [IP: 0000] ####
#### Microsoft.SPOT.Hardware.InputPort::.ctor [IP: 0009] ####
#### Microsoft.SPOT.Hardware.InterruptPort::.ctor [IP: 0009] ####
#### Gadgeteer.Interfaces.NativeInterruptInput::.ctor [IP: 001f] ####
#### Gadgeteer.Interfaces.InterruptInput::.ctor [IP: 0039] ####
#### Gadgeteer.Modules.GHIElectronics.HubAP5+IO60P16::.ctor [IP: 006b] ####
#### Gadgeteer.Modules.GHIElectronics.HubAP5::.ctor [IP: 0031] ####
#### GadgeteerApp1.Program::InitializeModules [IP: 0006] ####
A first chance exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll
An unhandled exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll


private void InitializeModules() {
    this.hubAP5 = new GTM.GHIElectronics.HubAP5(5); // Exception occurs on this line
    this.button = new GTM.GHIElectronics.Button(this.hubAP5.HubSocket3);
}

FEZ Hydra version info
ClrInfo.clrVersion :4.2.0.0
ClrInfo.clrVendorInfo :Microsoft Copyright © Microsoft Corporation. All rig
ClrInfo.targetFrameworkVersion :4.2.0.0
SolutionReleaseInfo.solutionVersion: 4.2.6.1
SolutionReleaseInfo.solutionVendorInfo: Copyright © GHI Electronics, LLC
SoftwareVersion.BuildDate: Oct 17 2013
SoftwareVersion.CompilerVersion: 410713


#9

We can reproduce the problem with the G400. We do not have a fix yet, but you can modify the driver to use software I2C instead and it will work.

As for the Hydra, it does not support pull down resistors which the interrupt line for the Hub uses. We will investigate removing that requirement in the future.


#10

Both the Hydra and G400 have been fixed for the next SDK.


#11

@ John - That is great, thank you.