U socket - Serial TTL

I want to use Serial TTL (pin 4 and 5) and have pin 3 and 6 available for GPIO. However, when I do this;


socket = GT.Socket.GetSocket(port, true, null, null);
resetPin = new GTI.DigitalOutput(socket, GT.Socket.Pin.Three, false, null);
powerPin = new GTI.DigitalOutput(socket, GT.Socket.Pin.Six, false, null);
serial = new GTI.Serial(socket, 9600, GTI.Serial.SerialParity.None, GTI.Serial.SerialStopBits.One, 8, GTI.Serial.HardwareFlowControl.NotRequired, null);            

It seems like it’s not truly a TTL serial interface, the reset pin and power pin does not work. It seems to behave more like a K socket (where pin 6 becomes RTS).

So, is there a way to specify more specifically what type of socket I want? Been trying to download the SDK code to see how a U module works, but codeplex keeps bogging down on me.

You can tray:


socket = GT.Socket.GetSocket(port, true, null, "U");

I didn’t test, but may help you but I don’t think this will free other pin.

PS: Which board are you using ?

I’m using the FEZ Cerb.

I looked through the code for the Gadgeteer.Interface.Serial.cs.
If you look at it you will see that a socket is passed in.

That socket reserves pin 4 and 5 only (and 6 and 7 if there is hardware flow control).

Right after that all it just creates a System.IO.SerialPort.

So, how does System.IO.SerialPort know which ports to use?

Think I figured it out. In System.IO.Port.SerialPort it does this;

hwProvider.GetSerialPins(m_portName, out rxPin, out txPin, out CTSPin, out RTSPin);

And later down in the code is reserves the rxPin and txPin. The other pins are only supposed to be reserved if hardware flow controls is on.

It does seems like they do get reserved.