detect USB physical connection using UCONbits.SE0
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?