Main Site Documentation

FEZmini1.3 COM2 viaTTL-232R-3V3-WE


#1

Hi all,
I in the process of building a TriCopter based on a FEZ mini board. The idea was to use the COM2 port to pass telemetry via USB to my PC during development.

Basically I am using the Example code in the beginners guide to simply send a number over the serial connection.

using System.Threading;
using System.IO.Ports;
using System.Text;
namespace MFConsoleApplication1
{
    public class Program
    {
        public static void Main()
        {
            SerialPort UART = new SerialPort("COM2", 115200);
            int counter=0;
            UART.Open();
            while (true)
            {
                // create a string
                string counter_string = "Count: " + counter.ToString() + 
                                        "\r\n";
                // convert the string to bytes
                byte[] buffer = Encoding.UTF8.GetBytes(counter_string);
                // send the bytes on the serial port
                UART.Write(buffer, 0, buffer.Length);
                // increment the counter;
                counter++;
                //wait...
                Thread.Sleep(100);
            }
        }
    }
}

My question is: I am using the UART port at the top of the FEZ mini board. This is marked as COM2 since I know COM1 is one the bottom pins (somewhere).

I am however not getting any data coming to my Serial Port Terminal app.

I noticed that if I plug the serial port and the USB port into my PC I can not seem to deploy or debug on FEZmini but if I plug one of the cables in at a time, all works fine. Is this correct or am I doing something wrong?


#2

So you are using pins UEXT3 and UEXT4 right?
You are sure you didn’t inverse the wires? (rx and tx)
You did use a ttl-to-rs232 adapter to connect to your pc?


#3

I haven’t checked the cpu pins on the FEZ mini circuit diagram. I went by the silk screened markings on the board. If the Txd and Rxd pins equate to UEXT3/4, which COM port does this equate to?

I just checked the documentation http://wiki.tinyclr.com/images/0/0a/FEZ-Mini-Schematic.png. I think I am using UEXT3/4 correct. In terms of using the pins the wrong way around: I tried with a jumper over TXD and RXD for a loopback test and still nothing.

Te cable I have is the: TTL-232R-3V3-WE from FTDI at http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm

Plugging the cabe into my PC does seem to equite to COM5 being started up, so the drivers are loaded correctly. I also manually set the baud rate to 115200 in windows device manager.

I think I might just be talking to the wrong COM port on FEZ.


#4

Ginner… Im new and all to the FEZ…but it works fine to me if it works using 1 interface; Serial or USB… using a Serial and USB at the Same time can make a problem unless you tell the FEZ what to do with them ( ex. 1 monitors, the other sends data back)
If you had a problem with Either of the interfaces then you prob. do have a problem.
I hope I understood your Q… Neat Project TriCopter.


#5

Turns out, that you should not connect the cable called Tx to the Tx pin on Fez and the Rx cable to the Rx pin on Fez (which all seems so obvious now).

I tested FEZ Com1 and COM2 using the sample apps in the Beginners guide with a loopback across RX and Tx and it worked fine. I then used the same loopback to test my USB to UART cable and it too worked fine. By this stage I was fairly sure that it was the pin reversal to be the problem.

While at work today I decided to quickly take a look at the specs for the cable and sure enough, the TX cable is labelled with “Transmits data from this cable”.

Anyway, once the pins were reversed, (So Tx on the cable goes to RX on Fez and vice-versa) all worked as expected.

Another rookie mistake out of the way. Now there’s only about 4 999 957 left to go (for me anyway;-).

Thanks for all the replies anyway.