Communication with USB Devices

Another (hopefully) quick question:

Is there any way to use a UART on the raptor to communicate with a USB device?

For example, if I wanted to use the USB interface of a pololu mini servo controller that has a mini-usb connector.

Physically, the USBHost module has a USB port, but it looks to be only for HID/Storage devices, and not usable as a serial port.

The USB Serial Module has a micro USB connector, so it looks like it is USB-client not USB-host (can’t connect it to another micro-usb connector)

Is there any convenient solution for this? I realize I could just use the ttl pins on that servo controller, but I’d like to see if there was a way to use the usb.

Thanks

USBHost has a Serial connection method. But that requires that what you plug in actually offers a serial port - do you know that the Pololu device is a serial device ? If so, USB Host is the way to use it. https://www.ghielectronics.com/docs/36/usb-host#317

1 Like

Thanks for that!

It would have been nice if there had been a link to that page from the USB Host Module pages. There is no example/tutorial/developers guide listed in the resources there. I was limited to looking through the intellisense list looking for anything to do with serial.

Thanks for the link!

Using the GHI tutorial you linked to at https://www.ghielectronics.com/docs/36/usb-host#317

…I am running into immediate problems with this:




Controller is a USBHost module, but there is no "UsbSerialConnected" according to intellisense...

There are events for KeyboardConnected MouseConnected,MassStorageMounted etc

but no UsbSerialConnected.

What am I missing?

So… has anyone actually seen/used .UsbSerialConnected?

Is it something that was removed from 4.3?

check the definitive reference https://www.ghielectronics.com/downloads/man/Library_Documentation_v4.3/html/fb58d3ab-e16b-ece3-b245-481d52eab3b9.htm

Thanks Brett

I figured out my problem.

I misread the code in the tutorial… I thought “Controller” was the name of the instantiated usbhost module object itself. I was trying like this:



In order to use the Serial functionality you need to use the [b]static[/b] GHI.Usb.Host.Controller object  like this:


```cs
GHI.Usb.Host.Controller.UsbSerialConnected += Controller_UsbSerialConnected;

Thanks for your help!

BTW I got a package from Australia today. Thanks!

great news on both fronts - did you figure out what the mystery item was ?

The CANxtra board? That’s what it is right?

I had to to some searching to find out what it was :slight_smile:

Did anyone ever write a DeviceNet stack for it?

yep a CANxtra.