Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

USB full speed


I want to know how is it possible to exploit usb at maximum speed with wixel, since my feeling is that usbComTxSendByte() doesn’t allow to communicate via serial at high speeds.

Thank you,



You can see the source code of usbComTxSendByte here, and it’s pretty simple:

github.com/pololu/wixel-sdk/blo … _cdc_acm.c

You could try adding another function to the usb_cdc_acm library that takes an array of bytes to send. As long as the behavior of your new function is equivalent to calling usbComTxByte for each byte, it should work fine, and it might be a faster, and you wouldn’t have to learn that much about USB.

The usb_cdc_acm library uses a USB bulk endpoint to send data to the computer. Each endpoint has a maximum packet size. One thing to keep in mind with bulk endpoints is that if the device ever sends a short packet (a packet with less data than the maximum) then the USB host usually will not poll the endpoint for any more data until the next USB frame. Full speed USB frames last for 1 millisecond. So it would be best to send maximum-size packets as much as possible. However, you will need to send a short packet when you are done transmitting data, or else the USB drivers will not know that the transfer is done, and they could delay sending your data to the higher-level code that is reading it.

It will probably help if you read the source code of the usb_cdc_acm library and also read section 12.16.6 of the CC2511F32 datasheet, which explains how to use endpoints 1 through 5.

To help you debug these modifications, you should probably find a way to look at the USB packets. I recommend the Beagle USB 12 Protocol Analyzer from Total Phase, but there might be some free software solutions available depending on what operating system you are using.

Have you measured the speed of usbComTxSendByte? I’d be interested to know how many bytes per second you are able to send with it, and how much you are able to improve that.



Thank you David, I’ll do it as soon as possible.