Main Site Documentation

Serial TTL with Fez Spider


#1

I am having problems finding information on doing serial TTL communications on the Fez Spider. I’m trying to send serial commands to a motor controller. The communication is one way only, out of the Spider. Can someone point me in the right direction?
Thanks,
Mario


#2

Do you have a hardware or a software question?


#3

Software. I searched for UART or TTL and everything I find is for .Net in Windows.


#4

Did you search here? :slight_smile: http://tinyclr.com/support/


#5

search for COM1 in the code site, or step through the serial port tutorials in the link Gus sent.

TTL means it’s not necessary to go to a RS232 serial signalling chip which means your device can connect and communicate to the Fez without anything more than a cable.

(beyond my practical experience but this is my attempt for bonus points: on a Spider, you need a type U port )


#6

Based on what I have found, if I were to use pin 4, on spider’s socket 8,which is TXD2 would it be referred to as COM3 in code? Is it okay to ignore pin 5, RXD2, on the same socket? I only need to send out data.
Thanks.


#7

Take a look at Gadgeteer.Interfaces.Serial. http://netmf.com/Gadgeteer/docs/GadgeteerCore/2.41.500/html/5e55df26-7b52-d5b2-b1ed-6ed39ece8612.htm

There is no “COM3” when you use this interface. Serial is supported on socket types U and K. With an extender module you can break out pins 4/5 and wire your device directly.

A quick example…


      // private members in this constructor are instantiated elsewhere
      var serial = new Gadgeteer.Interfaces.Serial(_socket, (int)_baudRate, GTI.Serial.SerialParity.None, GTI.Serial.SerialStopBits.One, 8, GTI.Serial.HardwareFlowControl.NotRequired, this);
      serial.Open();
      //good idea to pause a bit before writing
      Thread.Sleep(200);
      serial.Write("hello");


#8

In order to get the COM port number for a given socket, have a look here and search for "COM:


#9

Thanks guys, great information.