Bi directional USB communication

22 Dec 2010

After some (rather short!) looking on forum and cookbooks, I found no easy way to communicate between mbed and PC custom software (not dedicated terminal) using USB port.

Does such possibility exists ?

We plan to use USB to accept commands from our PC soft, control some hardware and return back the results (like current position).

I would highly appreciate any link and may be some code fragments for both mbed and PC side...

22 Dec 2010

Hi Pawel,

Most languages should be able to talk to the USB serial port, if that gives you what you need. For examples, see the Interfacing with other languages section of the cookbook.

Simon

22 Dec 2010

I have used a HID interface, extensively in the past, with PIC18f2550 devices,

this works very well, and can be very fast.

especially with DELPHI.

it would be nice if the MBED could Send/Receive HID Messages, using the other USB Connection.

 

any chance of a library or some code examples,

I cannot find any information on how to do this for the MBED.

 

Cheers

Ceri

23 Dec 2010

Look for serial communication - any PC programming language must have libraries for.( C++, Delphi, .NET, etc.)

Set the parameters .. baud rate, no of bits, parity .. stop bit ..etc. COM port must be set like the windows set your virtual COM (on USB). Then send or receive bytes (data or commands - as your app require) but in the case of large amount of data look also at the hardware buffer size just to be shure that you get all the bytes. For commans only, this is not important. Also for this type of app the speed of serial port is enough even at low settings.