IO60P16 - how to connect?

I have a question about IO60P16. Because I am inexperienced in hardware, I do not know, how to connect IO60P16 module for these 2 basic situations:
[ul]input - switch (or some sensor) is turned on / off[/ul]
[ul]output - send signal to relay[/ul]

Which pins (on the board) shoul I use to be able to use interrupt and/or current state (on / off)? Is there an example?

For someone it can be stupid question, but I don’t understand hardware, that’s why I choosed .NET Gadgeteer :slight_smile:

It’s not a stupid question at all. It was my intent to create the IO60P16 tutorials last week but other things got in the way. Hopefully this week.

All of the pins are GPIO - meaning that they can all be used for digital output or input. In this case, you will want to use the pin as an InterruptPort like this…

var ip0 = io60p16.CreateInterruptPort(IOPin.Port7_Pwm14);
ip0.OnInterrupt += (data1, data2, time) => 
                                              {
                                                    Debug.Print("Exterminate!");
                                               };

NOTE: There is a problem in the latest SDK release that is causing problems with interrupts on this module with the Hydra. It should work fine on the Cerberus.

var op = io60p16.CreateOutputPort(IOPin.Port0_Pin6, true);
op.Write(true);              // Bring high
op.Write(false);            // Bring low

1 Like

Thanks Ian for your answer. I wasn’t exactly sure, but I had an idea, how to code it. Your example is very helpful. But I am not sure, how to connect wires to the board.

For your example for input port 7, PWM 14, where to connect the wires? One wire to GND and second to one of three PWM14? To which one (see attached image)?

And for output port 0 pin 6 as drawn on the second image attached?

And I forgot - I have FEZ Spider, so I hope interrupts will work fine :slight_smile:

As long as your components on the other end of the wire share a ground somewhere with the mainboard then you really shouldn’t have to ground again through the IO60P16. If they are not then you can use any of the GND connections you have identified. For the PWM ports, it’s not labeled unfortunately. However, the connections are as follows:

PIN = closest to “PWMx” label
V+ = middle
GND = outside (farthest from label)

You got it. Note my comment above regarding GND.

1 Like

Perfect, thanks a lot!

Let me know how it goes with the Spider. I don’t have one so haven’t tested whether the problem with the Hydra also exists there. However, I suspect that it does not.

It works with Spider, but… There is quite long delay before event is raised (I guess hunderets of milliseconds) and event (OnInterrupt and io60p16.Interrupt) is raised twice with delay about 300 - 400 ms. :frowning:

Well, that’s certainly not what I hoped to hear. GHI is studying the problem with the Hydra. Hopefully, they’ll find a fix that takes care of both boards.

Shall I report that somewhere?

300ms ? Really ? I noted that INT response is a bit slow on Hydra … but on Spider is 20 times slower ??? … I hadn’t the opportunity till now to check on my Spider, but I will do as soon as possibile.
Just for completness the INT on IO Pin occurs in the signal raising edge AND in the falling edge. So you get 2 INT in case of go to 1 then back to 0 on a pin.
This not happens on PWM generated INT, where you can choose which edge to raise INT (look at Reg Config 29h).