Hi everybody,
I’m having some issues with Gadgeteer. How does one release a pin after one is done with it?
I have a chip that needs it’s I2C pins pulled low during a reset, so I declare them as OutputPort, Release from reset, but now I can’t reuse the I2C pins in SoftwareI2C as Gadgeteer thinks that the pin is already used.
Socket S = Socket.GetSocket(SocketNumber, false, null, “Y”);
Reset = new DigitalOutput(S, Socket.Pin.Five, true, null);
SerialEnable = new DigitalOutput(S, Socket.Pin.Six, true, null);
Reset.Write(false);
SDIO = new DigitalOutput(S, Socket.Pin.Eight, false, null);//Set SDA pin to false
Reset.Write(true);//Release from reset.
SDIO = null;//Release pin for use with SoftwareI2C
I2C = new SoftwareI2C(S, Socket.Pin.Eight, Socket.Pin.Seven, null);
//Above throws an error: "Unable to configure the module using socket 5 (pin 8). There is a conflict with the module using socket 5 (pin 8). Please try using a different combination of sockets."
Any ideas?
Justin
January 29, 2013, 6:57am
2
Justin
January 29, 2013, 7:06am
3
Could this work??
GT.Socket S = GT.Socket.GetSocket(1, false, null, "Y");
DigitalOutput Reset = new DigitalOutput(S, GT.Socket.Pin.Five, true, null);
DigitalOutput SerialEnable = new DigitalOutput(S, GT.Socket.Pin.Six, true, null);
Reset.Write(false);
using(Microsoft.SPOT.Hardware.OutputPort SDIO = new OutputPort(GT.Socket.GetSocket(S.SocketNumber, true, null, null).CpuPins[8], false))
{
Reset.Write(true);
}
I2C = new SoftwareI2C(S, GT.Socket.Pin.Eight, GT.Socket.Pin.Seven, null);
I thought about using plain MF, but I would have liked to keep it pure Gadgeteer.
I assumed that I was just doing something dumb…
Justin
January 29, 2013, 7:42am
5
looks like there is no way to Dispose a pin in 4.2…