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
  • On the host circuit of above post,
    Is the D+/D- pull-down resistors (R8/R9) on the first figure are switched by NPN transistors, as you show in the second figure?

    On the device circuit,
    Replace NPN transistor (Q1) for the D+ pull-up with PNP.
    On the NPN emitter-follower circuit, V<sub>CE</sub> doesn't saturate, less than V<sub>BE</sub>. You may take this circuit from some KEIL board, but it is wrong one.

    Tsuneo

Reply
  • On the host circuit of above post,
    Is the D+/D- pull-down resistors (R8/R9) on the first figure are switched by NPN transistors, as you show in the second figure?

    On the device circuit,
    Replace NPN transistor (Q1) for the D+ pull-up with PNP.
    On the NPN emitter-follower circuit, V<sub>CE</sub> doesn't saturate, less than V<sub>BE</sub>. You may take this circuit from some KEIL board, but it is wrong one.

    Tsuneo

Children
  • Hello Tsuneo

    Is the D+/D- pull-down resistors (R8/R9) on the first figure are switched by NPN transistors, as you show in the second figure?

    I am switching ON these two NPN transistors and trying to communicate with the pen drive.

    On the device circuit,
    Replace NPN transistor (Q1) for the D+ pull-up with PNP.
    On the NPN emitter-follower circuit, V<sub>CE</sub> doesn't saturate, less than V<sub>BE</sub>. You may take this circuit from some KEIL board, but it is wrong one.

    It can be seen that Q1 that is being used is already a PNP configuration.

    As you rightly suggested, I have tested the HOST and the device code saparatly and everything seems to work fine.

    It would be very helpful if you can post the relevent changes. probably a circuit would be very helpful.

    -Prakash

  • >> On the device circuit,
    >> Replace NPN transistor (Q1) for the D+ pull-up with PNP.

    > It can be seen that Q1 that is being used is already a PNP configuration.

    Aha surely, It's PNP.
    But the emitter and the collector are swapped on the schematic.

    Tsuneo

  • >Aha surely, It's PNP.
    >But the emitter and the collector are swapped on the schematic.

    The schematic I have send of USB device is working fine.

    -Prakash

  • I don't know why it works. It shouldn't.
    Maybe, the pins on your footprint of the layout is swapped?

    Compare your schematic with Olimex's
    www.olimex.com/.../LPC-1766STK-SCH.pdf

    T3 (just near USB_DEVICE label) on Olimex's corresponds to your Q1.

    Tsuneo