mbed USB programming port as USB device?

23 Sep 2014

HI all,

Sorry if this is a dumb question...I didn't see anything like this in the forum searches, so either bad searches or I'm missing the obvious....

I have an mbed 1768. The USB port on it obviously makes it look like a flash drive so I can download the programs to it. But can I take over that USB port from the LPC1768 code to use it as a serial device instead?

Thanks...

23 Sep 2014

No and yes.

No, you can't control it as a USB device. Yes you can use it as a serial port, that is it's normal mode of operation.

The USB port on the 1768 is connected to a second micro controller on the back of the board that handles the flash drive side of things and reprogramming the main CPU when you copy new code. One of the 1768 serial ports is connected to this second processor. If you create a serial port like this:

Serial pc(USBTX,USBRX);

and then install the drivers from here: http://mbed.org/handbook/Windows-serial-configuration you will get a USB serial connection from your mBed code to the PC.

rom the mbeds point of view it is a normal UART based serial port, the USB side is handled by the other processor which means there is no need for any libraries other than the standard mbed.h

If you want to use any other USB device type (or want a second USB serial port) then you need to wire a second USB socket to the device on the USB pins and use the USBDevice library.

24 Sep 2014

Perfect! Thanks for the info Andy, much appreciated!