• AVR Freaks

Hot!detect USB physical connection using UCONbits.SE0

Author
pajuhesh80
Super Member
  • Total Posts : 101
  • Reward points : 0
  • Joined: 2019/12/08 11:23:37
  • Location: Nowshahr, Mazandaran, Iran
  • Status: offline
2020/08/10 00:49:05 (permalink)
4 (1)

detect USB physical connection using UCONbits.SE0

PIC18F14K50 datasheet
22.8 Interrupt-on-Change for D+/D- Pins
... When the PIC18(L)F1XK50 attaches to the bus the D+ and D- pins can detect voltage changes. External resistors are needed for each pin to maintain a high state on the pins when detached.

This means additional resistors and additional current.
I have a new idea. After enabling USB module and internal resistor, data lines are in J (idle) state. If you connect device to host, pulldown resistors of host cause SE0 condition; so I can loop on SE0 to detect USB connection.
Is this method acceptable? Or I missed something which can cause problem?

Slow and Steady!
#1

0 Replies Related Threads

    Jump to:
    © 2020 APG vNext Commercial Version 4.5