LPC1756 SoftConnect feature

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1756 SoftConnect feature

1,214件の閲覧回数
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
ラベル(1)
0 件の賞賛
返信
1 返信

1,013件の閲覧回数
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 件の賞賛
返信