This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Detecting Pen Drive Insertion on LPC1768

Hello

I am using LPC1768 for one of the project and i need to detect if the USB device is plugged in. How is it possible that i detect something like a pen drive being inserted.

I will be using the controller to interact to the PC as well as with a pendrive and i dont intend to use OTG. I need to have a option which will be able to detect the connection type.

Regards
Prakash

Parents
  • > I will be using the controller to interact to the PC as well as with a pendrive and i dont intend to use OTG.

    If you drop the OTG option, your device has to mount two USB receptacles, one for host, another for device. Depending on the type of USB function (Device/Host/OTG), the type of receptacle is determined.

    USB spec provides these receptacle options for each function.
    Device: standard-B, mini-B or micro-B
    Host : standard-A
    OTG : micro-AB

    Typical circuits around USB receptacles (Device/Host/OTG) are found in this Olimex schematic for LPC-1766STK (pin-compatible to LPC1768).
    www.olimex.com/.../LPC-1766STK-SCH.pdf

    [1] Connection
    As seen on this schematic, Device/Host/OTG functions on the chip share single pair of D+/D- ports (on the schematic, jumper blocks are mounted). To connect two receptacles to this ports, there are two ways.
    a) Direct connection
    b) Analog switch

    a) Direct connection
    The two receptacles and the ports are directly connected each other.
    In this case, your device should have a mechanical shutter in front of the receptacles, so that users should plug to just one receptacle at a time.

    b) Analog switch
    The receptacles are connected to the chip ports over analog switches, respectively.
    For bus switch of Full-speed USB, these analog switches are available.

    Analog Devices
    www.analog.com/.../usb_switch.html

    ON semiconductor
    www.onsemi.com/.../parametrics.do

    Fairchild
    www.fairchildsemi.com/.../USBGuide_ENG_pgs.pdf

    Maxim MAX4906
    www.maxim-ic.com/.../3020
    etc.

    Host/Device mode (ie. active receptacle) is switched by a menu on the display of your device, or automatic detection of plug-in.

    [2] Plug-in detection
    1) Host plug-in detection on Device mode
    The voltage at VBUS pin of B receptacle is supplied to a MCU VBUS pin over resistor divider. (see USB_DEVICE section of above schematic)

    2) Device plug-in detection on Host mode
    VBUS power should be supplied to the A receptacle.
    Plug-in of device is detected on the LPC1768 chip by D+/D- line voltage change.

    [3] OTG - micro-AB receptacle
    To plug in a USB stick to this receptacle, an adapter (Micro-A plug to Standard-A receptacle) is required. Also, to connect the device to PC, Micro-B cable (Micro-B plug to Standard-A plug) is needed. These cables are not so popular on the market, yet. You may want to attach these accessories to your product set for user's convenience.




    You'll fine similar discussion on Microchip USB forum
    www.microchip.com/.../tm.aspx

    Tsuneo

Reply
  • > I will be using the controller to interact to the PC as well as with a pendrive and i dont intend to use OTG.

    If you drop the OTG option, your device has to mount two USB receptacles, one for host, another for device. Depending on the type of USB function (Device/Host/OTG), the type of receptacle is determined.

    USB spec provides these receptacle options for each function.
    Device: standard-B, mini-B or micro-B
    Host : standard-A
    OTG : micro-AB

    Typical circuits around USB receptacles (Device/Host/OTG) are found in this Olimex schematic for LPC-1766STK (pin-compatible to LPC1768).
    www.olimex.com/.../LPC-1766STK-SCH.pdf

    [1] Connection
    As seen on this schematic, Device/Host/OTG functions on the chip share single pair of D+/D- ports (on the schematic, jumper blocks are mounted). To connect two receptacles to this ports, there are two ways.
    a) Direct connection
    b) Analog switch

    a) Direct connection
    The two receptacles and the ports are directly connected each other.
    In this case, your device should have a mechanical shutter in front of the receptacles, so that users should plug to just one receptacle at a time.

    b) Analog switch
    The receptacles are connected to the chip ports over analog switches, respectively.
    For bus switch of Full-speed USB, these analog switches are available.

    Analog Devices
    www.analog.com/.../usb_switch.html

    ON semiconductor
    www.onsemi.com/.../parametrics.do

    Fairchild
    www.fairchildsemi.com/.../USBGuide_ENG_pgs.pdf

    Maxim MAX4906
    www.maxim-ic.com/.../3020
    etc.

    Host/Device mode (ie. active receptacle) is switched by a menu on the display of your device, or automatic detection of plug-in.

    [2] Plug-in detection
    1) Host plug-in detection on Device mode
    The voltage at VBUS pin of B receptacle is supplied to a MCU VBUS pin over resistor divider. (see USB_DEVICE section of above schematic)

    2) Device plug-in detection on Host mode
    VBUS power should be supplied to the A receptacle.
    Plug-in of device is detected on the LPC1768 chip by D+/D- line voltage change.

    [3] OTG - micro-AB receptacle
    To plug in a USB stick to this receptacle, an adapter (Micro-A plug to Standard-A receptacle) is required. Also, to connect the device to PC, Micro-B cable (Micro-B plug to Standard-A plug) is needed. These cables are not so popular on the market, yet. You may want to attach these accessories to your product set for user's convenience.




    You'll fine similar discussion on Microchip USB forum
    www.microchip.com/.../tm.aspx

    Tsuneo

Children