I’m using a fezz hydra powered by external powersupply conected with an enc28, relayx16 and io60p16 module. Through the network i send messages to the Hydra and start a relay after a delay of x seconds. I’m using the io60p16 with Interrups to start the relays directly when the interrupt is fired–> GitHub - ianlee74/IO60P16: Custom driver for the GHI IO60P16 Gadgeteer module.
I have connected the GND of the io60p16 to my external powersupply GND, this should set all components on the same GND.
The problem that occurs is that after a few days, the interrupts are not being triggered. After resetting the board, interrupts work again. Is this still related to software issues with I2C in NETMF?
The code I use to work with the triggers
private void ProgramStarted()
{
// Logger
_logger.PrintSDCartContent();
// Init network
try
{
_client.InitNetworkCard();
_client.MessageReceived += ClientMessageReceived;
_client.StartListening();
}
catch (Exception e)
{
_logger.WriteMessage(e.Message);
}
// Init IO60P16
_ioModule.Reset();
new InterruptPort(_ioModule, IOPin.Port4_Pin0, ResistorMode.ResistivePullDown, InterruptMode.RisingEdge);
new InterruptPort(_ioModule, IOPin.Port4_Pin1, ResistorMode.ResistivePullDown, InterruptMode.RisingEdge);
new InterruptPort(_ioModule, IOPin.Port4_Pin2, ResistorMode.ResistivePullDown, InterruptMode.RisingEdge);
new InterruptPort(_ioModule, IOPin.Port4_Pin3, ResistorMode.ResistivePullDown, InterruptMode.RisingEdge);
new InterruptPort(_ioModule, IOPin.Port4_Pin4, ResistorMode.ResistivePullDown, InterruptMode.RisingEdge);
new InterruptPort(_ioModule, IOPin.Port4_Pin5, ResistorMode.ResistivePullDown, InterruptMode.RisingEdge);
new InterruptPort(_ioModule, IOPin.Port4_Pin6, ResistorMode.ResistivePullDown, InterruptMode.RisingEdge);
new InterruptPort(_ioModule, IOPin.Port4_Pin7, ResistorMode.ResistivePullDown, InterruptMode.RisingEdge);
_ioModule.Interrupt += IoModuleOnInterrupt;
}
private void IoModuleOnInterrupt(object sender, InterruptEventArgs args)
{
if (args.PinState == true) return;
_logger.WriteMessage("Interrupt triggered " + args.PinId + " " + args.PinState + " " + args.Timestamp);
_parser.QuickStart((byte)args.PinId);
}
private void ClientMessageReceived(object sender, MessageEvent e)
{
_parser.Run(e.Message);
Debug.Print(e.Message);
}
Is there something I’m missing, or should I read the register by using polling and not the interrupts? Or do I need to use another component to get 30-40 interrupt inputs?
I have seen the DL40 io on codeplex but is this working stable on Hydra?