Is USB bus-powered mode supported when using K50 as a USB device?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is USB bus-powered mode supported when using K50 as a USB device?

1,216 Views
yinni
Contributor III

Hello everyone,

My goal was to have a MCU system as a bus-powered USB device for data transfer.

After I incorporated the SDK example, usb_device_msc_sdcard_lite, into my project, the USB device is working in general. But for some of our K50 systems, the operation current is high (over 300mA); and my experience was that the USB port from a host (a laptop, for instance) wasn't able to supply such an amount of current and the K50 system could not be powered up by a computer USB.

After I learned that the default current limit can be provided by a USB VBus is 100mA, I tried to increase the limit by changing USB_DEVICE_MAX_POWER setting in usb_device_descriptor.h and USB_DEVICE_CONFIG_SELF_POWER macro in usb_device_config.h.

Here comes my questions:

Q1. If I were to use the system as a bus-powered USB device, I assume that I have to change the value of USB_DEVICE_CONFIG_SELF_POWER from 1U to 0U; however, the comment says value of 0U is not supported. If so, how could I switch to bus-powered mode?

Q2. Is the default maximum USB current really 100mA? I measured the USB Vbus current with USB_DEVICE_MAX_POWER = 0x32U (100mA) and found that our normal systems draw about 240 mA, and the unusual systems draw about 300 mA (in this case the USB voltage regulator output dropped to 1.5V as opposed to the expected 3.3V). Why the Vbus current is beyond the limit?

I also experimented with USB_DEVICE_MAX_POWER increased to 0xE1 (450 mA), the measured Vbus currents are the same as with USB_DEVICE_MAX_POWER = 0x32U for both the normal system and the unusual system that draws more current.

The schematic diagram of the USB connection is attached.

Many thanks in advance!

Labels (1)
0 Kudos
4 Replies

1,090 Views
yinni
Contributor III

nxf46116‌ bobpaddock

Hi Bob and Alexis,

Thank you so much for the help. I took Alexis's advice and changed USB_DEVICE_CONFIG_SELF_POWER to 0U and set USB_DEVICE_MAX_POWER to 0xE1 (450mA). The current output measured the same as I described in my original question:

ormal systems draw about 240 mA, and the unusual systems draw about 300 mA

Any further suggestion?

Many thanks in advance!

0 Kudos

1,090 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Yinni,

Since your device draws too much current I think it will be better to use an external source of power and use the USB_DEVICE_CONFIG_SELF_POWER = 1.

Best Regards,

Alexis Andalon

0 Kudos

1,090 Views
bobpaddock
Senior Contributor III


Q2. Is the default maximum USB current really 100mA?


Yes.  The USB 2.0 standard says that a device shall draw no more than 100 mA at the start of enumeration.

The device may request, and the host may or may not grant the request for more current during the enumeration process.  USB 3.x does allow for more current.  Most PCs will allow more current to be taken.  However at some point the host will see some amount as 'to much' and shut the port down.  Getting the port operating again can be a real challenge on some PCs.

I measured the USB Vbus current with USB_DEVICE_MAX_POWER = 0x32U (100mA) and found that our normal systems draw about 240 mA, and the unusual systems draw about 300 mA (in this case the USB voltage regulator output dropped to 1.5V as opposed to the expected 3.3V). Why the Vbus current is beyond the limit?


The setting is not a current limit nor a constant current source. It is a request to the host. Your circuit will take what your circuit takes.  The internal regulator is not intended for loads of such currents.

Also there should be more capacitance at the input of the regulator than just the 0.1uF cap.
As well as considering the advice about putting ceramic caps at the end of a long USB cable.
The quality of the USB cable itself can also become an issue at higher currents.

https://www.analog.com/media/en/technical-documentation/application-notes/an88f.pdf 

1,090 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Bob,

Q1. If I were to use the system as a bus-powered USB device, 
I assume that I have to change the value of USB_DEVICE_CONFIG_SELF_POWER from 1U to 0U; 
however, the comment says value of 0U is not supported. 
If so, how could I switch to bus-powered mode?

This SDK is designed to be compatible with the TWR, this one uses the OpenSDA connector to power the board and it isn't possible to power the MCU from the TWR-SER device connector alone. In your design, you will only need to be sure the MCU is powered by the VBUS and change this define so in the descriptor this is updated.

Best Regards,

Alexis Andalon