This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM: Correct way to handle VBUS on the self-powered TM4C123 MCUs

Part Number: TM4C123GH6PM

In this topic Amit recommends not to connect VBUS line at all because of the annoying GPIO#10 errata issue. However, in this case we do not receive Disconnect events as well as we are violating the USB specs because we need to tristate D+/D- lines when the VBUS is not present (see this Anguel post), at least if I understand it correctly.

So, what do I mean by correct handling of VBUS?

  • We detect both Connect/Disconnect events.
  • VBUS (5V from a host) can be applied even when our sensing pin is not yet configured for VBUS functionality (hence we can't use PB1).
  • Avoiding GPIO#10 issue (latch-up).
  • Resetting SOFTCONN bit when device disconnected.

For hardware I wanna use something like this:

Schottky is there so a current never flows to the host. The RC filter is to get rid off GPIO#10 bug. As a USB_VBUS_SENSER I wanna use any GPIO that is 5V tolerant (PD6 for instance). Will that works?

For a software, as I understand, I need to fire ControlHandler with ui32Event =  USB_EVENT_DISCONNECTED on GPIO falling edge interrupt, but what about the SOFTCONN bit? For a proper SOFTCONN handling do I need to modify TivaWARE USB library?