lpcware

USB HID example on EA LPC4088 QSB & own HW: use of VBUS signal

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by gjwep on Wed Aug 12 06:14:00 MST 2015
Hello,

I'm trying to run the usbd_lib_hid_generic example from the lpcopen_2_10_lpcxpresso_ea_devkit_4088.zip.

On the EA EA LPC4088 QSB this example works on USB2 (default in the example is USB1). The device is recognized as expected.

When I try to run it on my own PCB which doesn't have the USB_VBUS signal connected to the MCU, the example doesn't work --  even though the LPC40xx manual (12.8) says about USB_Vbus pin that "When this input function is not enabled via the corresponding IOCON register, it is driven HIGH internally.".


So... is the connection of the Vbus pin required or not?


Additional observations:

The generic HID example uses USB1 per default. The init function states that this doesn't have the VBUS connected on the EA 40xx board. From that I assume that it should be possible to get this to work without VBUS:

void Board_USBD_Init(uint32_t port)
{
/* On the EA LPC40xx board leave VBUS at default setting. It's not connected on the board. */
/* Chip_IOCON_PinMux(LPC_IOCON, 1, 30, IOCON_MODE_INACT, IOCON_FUNC2); */ /* USB VBUS */

if (port == 1) {
Chip_IOCON_PinMux(LPC_IOCON, 0, 29, IOCON_MODE_INACT, IOCON_FUNC1);/* P0.29 D1+, P0.30 D1- */
Chip_IOCON_PinMux(LPC_IOCON, 0, 30, IOCON_MODE_INACT, IOCON_FUNC1);
LPC_USB->USBClkCtrl = 0x12;                /* Dev, AHB clock enable */
while ((LPC_USB->USBClkSt & 0x12) != 0x12);
} else {
Chip_IOCON_PinMux(LPC_IOCON, 0, 31, IOCON_MODE_INACT, IOCON_FUNC1);/* P0.31 D2+, D2- */
Chip_IOCON_PinMux(LPC_IOCON, 0, 14, IOCON_MODE_INACT, IOCON_FUNC3);
Chip_IOCON_PinMux(LPC_IOCON, 0, 13, IOCON_MODE_INACT, IOCON_FUNC1);

LPC_USB->USBClkCtrl = 0x1A;                /* Dev, AHB clock enable */
while ((LPC_USB->USBClkSt & 0x1A) != 0x1A);
/* Port Select register when USB device is configured. */
LPC_USB->StCtrl = 0x3;
}
}


Any relevant input appreciated.

Thanks+regards,
gj

Outcomes