LPC1756 SoftConnect feature

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

LPC1756 SoftConnect feature

1,212 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Linas on Sun Oct 28 12:23:24 MST 2012
Hello,

In the datasheet I have found that in the bus-powered device I do not need to use SoftConnect pin in order
to pull D+ line. Instead I can use pull-up resistor.

In some other application notes for development kits I have found that it is recommended to use SoftConnect

pin in order to pull the D+ line by software.

What are the recommendations regarding SoftConnect functionality. My application implements USB device using LPC1756 MCU.


Best regards,

Linas
Labels (1)
0 Kudos
Reply
1 Reply

1,011 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Daniel Widyanto on Sun Oct 28 20:36:00 MST 2012
Hi Linas,

The SoftConnect pin is attached to the USB device peripheral.

When you insert this code:
<code>
void usb_connect(void) {
    LPC_USB->USBDevIntClr = 0x10; /* Clear CCEMPTY */
    LPC_USB->USBCmdCode = 0x00FE0500; /* CMD_CODE=0xFE, CMD_PHASE=0x05(Command) */
    while (!(LPC_USB->USBDevIntSt & 0x10)); /* Wait for CCEMPTY */

    LPC_USB->USBDevIntClr = 0x10; /* Clear CCEMPTY */
    LPC_USB->USBCmdCode = 0x00010100; /* CMD_WDATA=0x01(CON=1), CMD_PHASE=0x01(Write) */
    while (!(LPC_USB->USBDevIntSt & 0x10)); /* Wait for CCEMPTY */
}
</code>
the SoftConnect pin will turn LOW, activating the pull-up to D+, and start the LPC17xx USB device enumeration (if USB host is attached).

Alternatively, you can use this code
<code>
void usb_connect(void) {
    LPC_GPIOx->FIOPIN &= ~(1 << your_softconnect_pin);
}
</code>
to turn LOW any GPIO that you use to activate the pull up to D+.

Or the least implementation is to pull up the D+ line permanently.

But, I'd recommend to have at least SoftConnect, since the USB Host may have very fast response (eg. start enumerating the USB device after 2ms attachment), and you are not sure whether your device is ready to receive that within 2ms (assuming you need to init other peripherals on the board as well).

Also, Softconnect is better than GPIO, since most of USB stack for LPC17xx is using SoftConnect pin instead of GPIO.

0 Kudos
Reply