ECIO28P and Max output power on USB

For users of Matrix Multimedia Electronics software to discuss projects, circuits and any other electronics concepts.

Moderators: Benj, Mods

Post Reply
vdecampos
Posts: 4
Joined: Wed Jan 20, 2010 12:17 pm

ECIO28P and Max output power on USB

Post by vdecampos »

Hi !

I'm currently using an ECIO28P module that I want to be in charge of an USB powered application
embedding some electronics. So far, my application consists on the ECIO and a LCD and the power
consumption is just few mAmps. So the default value of bMaxPower (corresponding to 100mA) defined in
configuration descriptor CFG01 of bootloader code will be fine for now.

Later, I want to add another component that will draw about 120mA. So I was wondering, what will
happen when I'll want to power all that electronics from the USB ? The USB will limit the max output
current to the 100mA and USB voltage will drop down ?

I suppose the bootloader's code should be changed to implement a different value of bMaxPower
(corresponding to about 200mA). Does it suffice to change the bMaxPower in CFG01 to 100 ?

Unfortunately I have no Microchip ICD programmer so I can't change the bootloader on the ECIO and test
that. Is it possible to change the bMaxPower afterwards within the main application (after bootload) ?

Thanks for any comments and replies...


From Microchip's source code :
-------------------------------------------------------------------------------

USBDEFS_STD_DSC.H
byte bMaxPower;

/******************************************************************************
* USB Configuration Descriptor Structure
*****************************************************************************/
typedef struct _USB_CFG_DSC
{
byte bLength; byte bDscType; word wTotalLength;
byte bNumIntf; byte bCfgValue; byte iCfg;
byte bmAttributes; byte bMaxPower;
} USB_CFG_DSC;

USBDSC.H
#define CFG01 rom struct \
{ USB_CFG_DSC cd01; \
USB_INTF_DSC i00a00; \
USB_EP_DSC ep01o_i00a00; \
USB_EP_DSC ep01i_i00a00; \
} cfg01

USBDSC.C
/* Configuration 1 Descriptor */
CFG01=
{
/* Configuration Descriptor */
sizeof(USB_CFG_DSC), // Size of this descriptor in bytes
DSC_CFG, // CONFIGURATION descriptor type
sizeof(cfg01), // Total length of data for this cfg
1, // Number of interfaces in this cfg
1, // Index value of this configuration
0, // Configuration string index
_DEFAULT, // Attributes, see usbdefs_std_dsc.h
50, // Max power consumption (2X mA)

/* Interface Descriptor */
sizeof(USB_INTF_DSC), // Size of this descriptor in bytes
DSC_INTF, // INTERFACE descriptor type
0, // Interface Number
0, // Alternate Setting Number
2, // Number of endpoints in this intf
0x00, // Class code
0x00, // Subclass code
0x00, // Protocol code
0, // Interface string index

/* Endpoint Descriptors */
sizeof(USB_EP_DSC),DSC_EP,_EP01_OUT,_BULK,BOOT_EP_SIZE,0x00,
sizeof(USB_EP_DSC),DSC_EP,_EP01_IN,_BULK,BOOT_EP_SIZE,0x00
};

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ECIO28P and Max output power on USB

Post by Benj »

Hello,

The ECIO devices have a maximum current of 100mA while in bootloader mode. The devices can then be configured by the main program to use any current you like. The USB can source 500mA at a maximum though a Laptop will probably be significantly less. Therefore if you can power up your high current device after programming in your main program then you should be fine.

Post Reply