Using IF- and IF+

09 Dec 2010

 

The housing we are going to mount the MBED has an external 7 way plug. The MBED will be fed via a 9v supply. I want to put the USB through this plug.. The housing is not big enough to put a micro USB in and solder it to the plug so I tried to use the IF+ and IF-. This didnt work.

 Is it because I also need to some how get power to the USB circuits ?

how can I do this ?

or is there some other problem I am not aware of yet ?

09 Dec 2010

if your intending to use the USB port for the mini USB connector, the IF+ and IF- are connected to a diffrent USB port. This may cause problems, notably the fact that you can't program over the diffrent port.

 

the obvious option for what went wrong, code is using the miniUSB that isn't connected to IF+ and IF-.

09 Dec 2010
10 Dec 2010

ThanksDaniel for all your help. I have it working now. This is what I had to do.

Can any one see any probems with it ?

USB has standard colour code.

I connected:

Cable                             MBED Pins

red 5v to 0 v USB            Out: VU

Black 0v to:                     0v GND

Green D+                        IF+

White D-                         IF -

1.5K resisitor required from IF+ to VU

I do not now need to use the micro USB connector.

It all powers up and all the functionality I have programmed seems to work OK.

I didnt have to reconfigure the USB ports or any thing on my PC. So it looks as if the IF signals are the same as the micro USB signals. as the manual suggests, although I think they may be buffered. 

20 Apr 2011

This is great! Thanks Mike. I was pulling my hair out trying to figure out how to use an external USB_B connector instead of the mini USB connector on the mbed when connecting to a PC.

I just wanted to confirm your connections:

USBmbed
1 / RED / VCCVU (5.0V USB Out)
2 / WHITE / D-IF-
3 / GREEN / D+IF+
4 / BLACK / GNDGND (0v)

And you've also added a 1.5k pullup between IF+ and VU, correct? What's that for by the way? In the schematics they have something similar to that already (turned on by IF_SCON).

I'll see if I can't get this to work.

I didn't expect the mbed VU (supply out) to be connected to the USB VCC without a Schottky or something some other supply "OR"ing component.

Thanks again.

Chris

26 Apr 2011

Hi Chris

I'm not sure about connecting VCC to VU. VU provides a 5V output if the mbed is powered via the onboard mini USB connector; if you're not using the onboard mini USB then I don't think there should be anything connected to VU. * Edit - see Hexley's post below for a warning though.

I've finally got around to testing this myself.

I used the following connections from an offboard USB connector to the mbed:

USB    mbed
---    ---- 
VCC -> VIN
D-  -> IF-
D+  -> IF+ (with 1K5 pullup to VOUT)
GND -> GND

Note that above I'm powering my mbed from the offboard USB (via VIN) and not using VU at all. IF+ is pulled up to VOUT.

I also tested the arrangement using a separate supply to the mbed rather than it being powered via the USB:

PSU    mbed
---    ---- 
6V  -> VIN
0V  -> GND

USB    mbed
---    ---- 
VCC 
D-  -> IF-
D+  -> IF+ (with 1K5 pullup to VOUT)
GND -> GND

In this case, there is no direct connection from USB VCC to the mbed (because power is coming from the PSU), and again VU is not used at all. IF+ is pulled up to VOUT (since this is set at 3V3 and not dependent on VIN).

Regards
Daniel

Edited - to show pullup to VOUT rather than VCC

26 Apr 2011

Use caution if you hook USB Vcc to mbed Vin, as shown in the top example of the post just above.

If an external PSU is later connected to mbed pin 2, while a USB device is also driving Vin, there will be a conflict between USB Vcc and the externally-applied voltage source. Could cause malfunctioning :-(

It's preferable to connect USB Vcc to mbed Vu instead. That way, the USB power will operate the mbed if no external PSU is connected (via D1/IC5); but an external PSU can take over without disturbing USB Vcc (thanks to the D1/D2 steering logic).

(See the schematic for part references).

26 Apr 2011

I'd add another warning to Hexley's. If you don't use the onboard mini USB socket and connect USB VCC to VU (or VIN), you miss out on the protection afforded by IC3 in the mbed, which is designed to limit current drawn from a USB source.

It's no wonder Simon said the IF+/IF- pins weren't supported!

Regards
Daniel

26 Apr 2011

After playing a bit more, it seems that the connection via these pins only works the first time after a power cycle ie. the USB is not hot pluggable (assuming you are powering the mbed separately besides the USB). Is this due to the logic around the IF_SCON signal, which you can't get at. Hard wiring a pullup to IF+ defeats the transistor T1 (refer to the schematics in Hexley's post). Any more ideas?

It's no wonder Simon said the IF+/IF- pins weren't supported!

Regards
Daniel

28 Apr 2011

Thanks all - yeah, I couldn't get it to work. Windows was throwing up a "device malfunction" error when I attached the external USB cable. Thanks for the tip Daniel - I'm sure that's the manifestation of the issue you're describing. It would be nice to understand the logic issue with IF_SCON.

I'm considering just ditching the off-mbed connector idea. It was just fluff anyway.

Thanks again for the help everyone.

Chris

29 Aug 2011

The alternative USB works charming with my desktop computer, but recognizes as "device malfunction"with my laptop. Maybe there is a more suitable resistor than the 1.5k ?

29 Aug 2011

To get the USB working properly you need to get access to the internal mbed signal vbus. That line should be connected to USB 5V input from the host to get correct detection of USB through the IF_SCON signal and the vbus input (pin 58) on the IF chip. You also get the normal power protection through IC3. In addition you would need 33 ohm series resistors between IF_D+ and IF_D- and your USB host D+/D-. And a common GND obviously. Even if you do it like that, there is still a potential risk of someone hooking up a second USB cable on the original mbed mini USB socket. That could damage the device. So I would FORGET using the IF_D+ and IF_D- pins. If you must use another external/remote USB socket instead of the mini USB socket on the mbed then either remove the mini USB socket and solder a wire to the uncovered pins or (much easier and safer) use a modified USB cable that plugs into the original mini USB. You can then connect the other end of that cable to a chassis USB B socket or to another USB mini socket. There is no risk of parallel USB cables now since at any given time only one host can occupy the mini USB on mbed.

04 Sep 2011

I was in this way was connected to an external USB.

http://mbed.org/users/suupen/notebook/how-to-external-usb-receptacle-on-mbed/