Hi,
I’m trying to pass data back and forth between a PC and the Panda III and started out with the CDC example from the documentation. It compiles and runs and I can also see the virtual COM port as COM5 but as soon as I try to connect to this port I get an exception like “the connected device is not functioning properly”.
I tried it with a simple C# console app on Win 7 x64 as well as the ‘old’ FezTerm from the CodeShare. I also did some tests with a Win XP VM with Hyperterminal - always with the same results…
Anyone got an idea what the problem may be? I am using the LEDs to indicate whats going on on the Panda and this seems to be fine. LED2 on when the port was created and LED1 blinking when sending the “Hello World!” bytes…
Thanks and kind regards
Toni
The Code I’m using:
public static void Main()
{
// Start Cdc
Cdc vsp = new Cdc(); //tryed this too: Cdc(0x1B9F, 0xF001, 0x100, 250, "GHI Electronics", "CDC VCOM", null, "CDC VCOM");
Controller.ActiveDevice = vsp;
OutputPort LED1 = new OutputPort(FEZPandaIII.Gpio.Led1, true);
OutputPort LED2 = new OutputPort(FEZPandaIII.Gpio.Led2, true);
LED2.Write(true); //show running...
// Send "Hello world!" to PC every second. (Append a new line too)
byte[] hello = System.Text.Encoding.UTF8.GetBytes("Hello world!\r\n");
while (true)
{
// Check if connected to PC
if (Controller.State !=
UsbController.PortState.Running)
{
//Debug.Print("Waiting to connect to PC...");
}
else
{
vsp.Stream.Write(hello, 0, hello.Length);
LED1.Write(true);
Thread.Sleep(10); //just blink
LED1.Write(false);
}
Thread.Sleep(2000);
}
}