Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] Please Help:: USB configuration status

2006-03-17 by Joel Winarske

Hi Manisha,

> i want one more info. we have a CON bit responsible for current connection
> status. so, in a situation where,
> 
> a) we initialize the USB for the first time,
> b) but the board is not connected to any USB host


Be sure to enable DEV_STAT in the USBDevIntEn register.  When DEV_STAT is
set, USB Bus reset, USB suspend change or Connect change events occur. +

ISR code:

    disr = DEV_INT_STAT;                     /* Device Interrupt Status */
    if (disr & DEV_STAT_INT) {
        WrCmd(CMD_GET_DEV_STAT);
        val = RdCmdDat(DAT_GET_DEV_STAT);       /* Device Status */
        if (val & DEV_RST) {                    /* Reset */
            OS_SignalEvent(EVENT_USB_RESET,&TCB_USB);
            goto isr_end;
        }
        if (val & DEV_CON_CH) {                 /* Change */
            OS_SignalEvent(EVENT_USB_CON_CH,&TCB_USB);
            goto isr_end;
        }
    }

Connection state would be tracked by CON_CH, and RST. +

Once your code enumerates and configures correctly post RST, state would be
configured and connected.  On CON_CH device would be disconnected and
un-configured.

> will this CON bit tell us that no connection is there?

To determine valid connection with host it's half hardware, half software.



+ 201, 202, 225, and 226 of the LPC2148 user manual.


Joel 

------------------------------------
Independent Electronics, Inc.
www.indyelectronics.com
2248 Morlan Drive
Napa, CA  94558
tel: (707) 320-4271
fax: (408) 516-5978
Timezone: GMT -08:00 
------------------------------------

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.