Serial communication if it works with usb cable but not work with external power

This is my problem. I’m working on Fez Panda 2 and I have problems with serial communication if I use external power. The strange thing is that if Fez is connected to the USB cable is working properly.
An example:


namespace FEZ_Panda_II_Application1
{
    public class Program
    {
        public static void Main()
        {
            int cont = 1;

            byte[] rx_byte = new byte[1];
            string cadena;

            SerialPort UART;
            UART = new SerialPort("COM3", 38400, Parity.None, 8, StopBits.One);
            UART.Open();

            while (true)
            {
                
                cadena = "Count " + cont + "\r\n";
                byte[] buffer = Encoding.UTF8.GetBytes(cadena);
                
                UART.Write(buffer, 0, buffer.Length);

                // Sleep for 500 milliseconds
                Thread.Sleep(500);

                cont++;
            }
        }
    }
}

I have plugged on COM3 a FTDI breakboard to communicate with a terminal. With a USB-cable works properly but with a external power suply the serial communication not working.

Welcome to the forum. What are you using for external power (voltage and current)? Is there anything else using power on the Panda? What are the power requirements of the FTDI breakout?

Please use code tags to your code is readable. I will fix your post for now

To expand on Ransom’s questions. Where are attaching the external power support?

I used two different power supplies, one of 8V and 1A and other of 5V and 850mah.

Stick with the first one (8V 1A) while working through this problem.

I too have experienced that serial data communications are a pain (flaky) when using external power.

My setup:

  • Variable 1A power supply that I tried at both 6V and 7.5V connected to the power socket (so not Vin).
  • Cable mod to enable USB host functionality.
  • Bridged MOD and GND to enable serial debugging.
  • Debugging using Serial-to-USB eblock on the Connect Shield.
  • Data communication using RS232 break out board for COM3 (D40, D42, 3V3, GND)
  • 3x LED eblock on the Connect Shield.

I had this code that worked when debugging using USB:


SerialPort mycom = new SerialPort(Serial.COM3, 19200, Parity.Even, 8, StopBits.One);
mycom.DataReceived += new SerialDataReceivedEventHandler(mycom_DataReceived);
mycom.ErrorReceived += new SerialErrorReceivedEventHandler(mycom_ErrorReceived);
mycom.Open();

I read on another thread that you should open the connection before attaching events (due to some strange bug) so I tried:


SerialPort mycom = new SerialPort(Serial.COM3, 19200, Parity.Even, 8, StopBits.One);
mycom.Open();
mycom.DataReceived += new SerialDataReceivedEventHandler(mycom_DataReceived);
mycom.ErrorReceived += new SerialErrorReceivedEventHandler(mycom_ErrorReceived);

And I have an improved result. Data communication seems to work now, but it does seem less stable than with the USB debugging setup. So I thought of adding my experience to this thread in case some other poor sob like me finds it when looking or an answer.

Some questions:

I feed the USB port with 5V taken from the regulated 5V pin in the header that also has Vin. Is this ok or should I feed the USB port with external power not taken from the Fez Panda II itself?

Using this 5V pin, how much A will be going to my USB devices in the USB host setup?

The 3V3 and GND that I use for the RS232 break out board comes from the header that has the Vin pin, not from the header that has the D40 and D42 pins. Are all 3V3 and GND pins the same or does it matter where I take it from?

In short, is my setup sound or am I making some rookie mistakes?

@ Crosswired, I can’t see anything wrong with your 3v3 setup on breakout board. 3v3 pins across the Fez board should not make a difference, and GND is the same. The only thing I would say is make sure you have good connections to those. Serial comms over RS232 is very sensitive to GND (because it uses differential voltages) so anything you can do to ensure a good connection there is worthwhile.

I have no comment on the USB portion of your circuit though, sorry - you’re on your own there (or at least waiting for the next person to come along who might)

Some of my connections are a bit dodgy at the moment to be honest… still testing the possibilities of the hardware. Once I know what goes where and what I need I will made a proper prototype. Now I soldered some cable onto headers and pins that are intended to be used on a PCB. Just to get me going. They should be ok when left alone though.

I’m using the Connect Shield to reduce these test connections to a minimum. The final design will not be using the connect shield nor the eblocks. And probably not even the RS232 break out board as I might go for an USB to serial dongle that I connect to the Panda II using the USB Host. I have a feeling that said dongle would be cheaper than a break out board, haven’t looked into that yet.