My TUSB1210 is setup as a Host PHY transceiver, as shown on data sheet page 48. It is connected to a USB Device. VBAT (3.3V) and VDDIO (1.8V) are applied.
I have the option of connecting 5V directly to VBUS or I can use TUSB1210 CPEN pin to enable a VBUS switch that will pass 5V to VBUS. VBUS is connected to TUSB1210 VBUS pin and VBUS pin of USB port.
My CPEN pin has a 100k ohm pullup resistor to 3.3V. This is also what is shown in the TUSB1210 evaluation schematic, see attached picture below.
I would like to detect when a Device is connected to the USB port.
My idea is as follows:
Write to VENDOR_SPECIFIC3 register (0x85) bit 4 CPEN_ODOS with a 1 to place CPEN pad in OD (Open Drain) or OS (Open Source) mode.
Then use VENDOR_SPECIFIC3 register (0x85) bit 5 CPEN_OD, already reset to a value of 0, to use CPEN pad as OS (Open Source).
What does active LOW mean in this case? Is this before or after CPEN output pin sees the attached Device?
Can I expect my CPEN pin to be pulled HIGH to enable my VBUS switch when a Device is connected to my USB port?
Then write to USB_INT_EN_RISE register (0x0D) bit 1 VBUSVALID_RISE with a 0 to clear the bit, I'm assuming that when VbusValid changes from a LOW to a HIGH it will set bit HIGH.
Then I will interrogate the USB_INT_EN_RISE register (0x0D) bit 1 VBUSVALID_RISE and look for a 1 indicating that VbusValid changed from a LOW to a HIGH.
Is my understanding correct?
Or is there another (easier) method to determine when a Device is attached to my USB port?
Instead, can I just look at USB_INT_EN_RISE register (0x0D) bit 0 HOSTDISCONNECT_RISE?
Thanks, Roland