USB Host & Device on one mbed?

08 Jun 2011

Hello, I am new to mbed and I have my first question :o) I successfully configured all to work with terminal on PC and realized mbed to act as USB host using BlueUSB http://mbed.org/users/peterbarrett1967/programs/BlueUSB/5yn1q/. Now I would like to ask You if there is an option for mbed to be USB HOST for my peripheral devices like usb stick, usb card reader and other connected to hub (I realized conection for usb hub at pins D+ and D- using 2 15k resistors) and at the same time mbed act as device for for another USB host - PC and by using program which is mbed running to have control of data going through mbed from/to mbed hosted device (example usb stick, keyboard) to host for mbed itself - PC? Is this possible? Which pins can I set to connect mbed to USB host if pins D+ and D- I use to connect USB devices to mbed itself?

For better explanation:

USB keyboard <<.>> USB HUB <<.>> mbed (control dataflow in both directions) <<.>> PC USB host

If I use example after pressing L on keyboard mbed sees L was pressed but to PC sends S.

I am sorry of my bad english but it is not my origin language. Thank You very much for any reply.

08 Jun 2011

The LPC1768 has one USB port. It can act as host or device, but not both.

However, you can use the mbed interface's serial-over-USB connection to communicate with PC. So:

[PC (virtual COM port)] <== USB ==> [interface chip] <== serial == > [LPC1768] <== USB ==> [USB Hub] <== USB ==> [USB keyboard]

08 Jun 2011

Igor Skochinsky wrote:

The LPC1768 has one USB port. It can act as host or device, but not both.

However, you can use the mbed interface's serial-over-USB connection to communicate with PC. So:

[PC (virtual COM port)] <== USB ==> [interface chip] <== serial == > [LPC1768] <== USB ==> [USB Hub] <== USB ==> [USB keyboard]

Thank You for quick reply. Does it mean that PC will recognize mbed (set as mentoied above) as USB keyboard (with right program)? Because i would like to connect whole setup to another hosts than PC too. Is there anything for I2C bus what add option to be USB device for any USB host. I saw something like USB host shield but if mbed can act as usb host out of box i would like to add usb device capability rather.

08 Jun 2011

No, PC won't see mbed as a USB keyboard in this setup. It will see it as a virtual COM port and you can use a terminal program to send and receive data.

08 Jun 2011

Igor Skochinsky wrote:

No, PC won't see mbed as a USB keyboard in this setup. It will see it as a virtual COM port and you can use a terminal program to send and receive data.

So there is no way to do what i mentoied above with mbed and aditional hardware?

08 Jun 2011

Get 2 MBED's, connect one up as HOST, the other as DEVICE,

use I2C, SPI, Serial, BUS-In/Out etc

Ceri

14 Aug 2012

The built in MINI-USB is a USB Device, but the +D, -D pins can be used with the BlueUSB library as a USB Host to support several USB devices.