hi,
I am trying implement a function for USB charger detection on beagle bone platform.
From TI datasheet, AM335x has a USB charger detection circuit at page.791 that i can detect which type charger i am using.
Ifollow the flow to set registers as below.
1. USB_CTRLx.CM_PWRDN: Powers up/down the PHY which contains the charger detection circuitry. Clear this bit to 0 to enable power to the PHY.
2. USB_CTRLx.CDET_EXTCTL: Turns the automatic detection on/off. Keep this bit 0 to keep the automatic detection on. Changing this to 1 enables the manual mode.
3. USB_CTRLx.CHGDET_DIS: Enables/disables the charger detection circuitry. Keep this bit 0 to keep this charger detection enabled. Setting this bit to 1 will power down the charger detection circuitry.
4. USB_CTRLx.CHGDET_RSTRT: Restarts the charger detection state machine. To initiate the charger detection, change this bit from 1 to 0. If this bit is 1, the charger enable output (CE) is disabled.
I used USB0 to do the experiment. But i always get 0x2C when connect to PC or adaptor.
I am not sure if any setting i am missing.??
The following is the information that i print with an application.
-----------------------------------------------------------------------
log:
1.Powers up the PHY
usbctl0=0x3c086004
2.Turns the automatic detection on
usbctl0=0x3c086004
3.Enables the charger detection circuitry
usbctl0=0x3c086000
4.restart bit set
5. read sts0 reg
usbsts0 = 0xc0
--------------------------------------------------------------------