A first chance exception of type 'System.Exception' occurred in GHI.Usb.dll

using System;
using Microsoft.SPOT;
using GHI.Usb.Host;
using System.Threading;

namespace MFConsoleApplication3 {
    public class Program {
        public static void Main() {

            Controller.UsbSerialConnected+=Controller_UsbSerialConnected;
            Controller.Start();
            Thread.Sleep(-1);
        }

        private static void Controller_UsbSerialConnected(object sender, UsbSerial e) {
            Debug.Print("Usb Serial Connected");
            //e.DataReceived += e_DataReceived;
        }

        static void e_DataReceived(UsbSerial sender, UsbSerial.DataReceivedEventArgs e) {
            foreach (byte d in e.Data) {
                Debug.Print(d.ToString());
            }
            sender.Write(e.Data);
        }

    }
}

I have a Usb to Serial adapter plugged into the Cerb but I’m getting this error.

A first chance exception of type ‘System.Exception’ occurred in GHI.Usb.dll

Whatever could be the problem?

What kind of adapter? Does it use ft232 internally?

[url]http://www.trendnet.com/products/proddetail.asp?prod=150_TU-S9[/url]

How would I know if it uses that internally? I can open it up, but what do I look for.

Here are the internals.

It says on the chips:
PL-2303HX
LF10212D
TP12012HD

and

Z1212LEEA 1034

Ok I got a Datasheet from adafruit
[url]Redirect Notice

I get the sinking feeling I’m going to be implementing a driver for this thing. Any advice on that Gus?

Why not just use a serial port? Or better FTDI ttl cable?

1 Like

I don’t have one. Also they find make them in 16 foot lengths.

I should have gotten the serial module :frowning:

I’m trying to connect the USB serial port adapter to the U port of the CerbBee. Do I need a level shifter, or can I just connect TX (pin2) from the Adapter to RX (pin5) on the Bee?

If your device is TTL level then you do not need it but if your device (which probably is) RS232 level then you do need a shifter. If it has a d-sub connector then it is likely RS232.

Is this device a Shifter [url]https://www.sparkfun.com/products/retired/11978[/url]

I like to keep a few of these handy.

https://www.ghielectronics.com/catalog/product/355

Phil

I like to keep a few CP2102 based USB-TTL units around. At a few bucks per unit from eBay, they’re a bargain. Then you only have to worry about signal integrity over 16 feet…