Is USB_CFG_MAX_BUS_POWER critical?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
xiangrui
Rank 1
Rank 1
Posts: 30
Joined: Sun Jan 01, 2012 5:19 am

Is USB_CFG_MAX_BUS_POWER critical?

Post by xiangrui » Fri Oct 19, 2012 3:11 am

Sorry if this has been asked.Is the USB_CFG_MAX_BUS_POWER parameter important? Is there any rule of thumb to estimate it? Thanks.
-Xiangrui

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Is USB_CFG_MAX_BUS_POWER critical?

Post by ulao » Fri Oct 19, 2012 2:05 pm

level it bee unless you need to borrow more power. There is no "correct entry" it just depends on what you need. For example if you get power exceeded, then up it.

xiangrui
Rank 1
Rank 1
Posts: 30
Joined: Sun Jan 01, 2012 5:19 am

Re: Is USB_CFG_MAX_BUS_POWER critical?

Post by xiangrui » Sun Oct 21, 2012 2:33 am

ulao wrote:level it bee unless you need to borrow more power. There is no "correct entry" it just depends on what you need. For example if you get power exceeded, then up it.


So how is that parameter used by the device or host? My understand is it is useful for something since it is a required.

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Is USB_CFG_MAX_BUS_POWER critical?

Post by ulao » Sun Oct 21, 2012 4:36 am

All it does is throttles the power for your device and reports the usage to the host. For example if you make a device that uses 50ma then why leave the max power at 100. In doing so you just told the host to waste 50ma. So you set 50 for USB_CFG_MAX_BUS_POWER. The second case would be like I mentioned upping the amps. If you design a device that requires 250ma then you need to set USB_CFG_MAX_BUS_POWER to 250.

Ross_ValuSoft
Posts: 15
Joined: Sun Oct 28, 2012 1:41 pm

Re: Is USB_CFG_MAX_BUS_POWER critical?

Post by Ross_ValuSoft » Sun Oct 28, 2012 1:49 pm

By setting the configuration variable to 100mA when your load only uses 50mA, you are not using or losing an extra 50mA. The variable does not force your "load" to use an extra 50mA.

However, if you set the variable below what your circuit needs, the host (PC) will refuse to give you more than the current identified by the variable. During development, I set the variable to a generous value, then measure the actual requirements and revise the value with a small safety margin (multiples of 50mA).

Cheers,

Ross

Post Reply