We're using a K60 with our own HW, but it applies to TOWER boards as well. We are working as a device only, and the computer is the host, with a CDC driver.
How to detect that a USB cable has been connected to the device? The other side can either be a computer or a charger. With a computer on the other end it's fairly simple - there are various interrupts and messages sent to the USB stack which we can use.
But when connecting to a USB charger (a simple power supply with a USB jack) we only see a SLEEP interrupt and no message (which is to be expected). From the description of the SLEEP interrupt (in USB0_ISTAT) it doesn't look like it's the correct way to identify USB connection.
Is there some other interrupt/register that can tell us only that the USB cable is connected to something?
Solved! Go to Solution.
Hello Eli:
For this purpose you have to connect VBUS line to a 5V tolerant GPIO pin and use that pin to detect when a Host cable is connected to your device. This is because K60 does not have an active register that indicates when VBUS is present.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Eli:
For this purpose you have to connect VBUS line to a 5V tolerant GPIO pin and use that pin to detect when a Host cable is connected to your device. This is because K60 does not have an active register that indicates when VBUS is present.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Jorge,
Thank you very much for the reply!