I have been eyeing USB communication in microcontrollers especially the dspic33 series. Now, when I looking over the physical connector of the USB, I came to know that there are 5 pins used.
VBUS,D+,D-,GND,USB ID pins. In these 5, I got little confusion about the VBUS pin. As per the datasheet of the MCU I am using, it is not self-powered for the VBUS pin. We have to supply externally 5V to the VBUS pin.
On seeing the architecture of the USB engine, the supply given through the VBUS pin is passed to the analog comparator. This is because the VBUS pin in the MCU is to monitor the state of USB communication, stated in the datasheet. No more info.
So, what are the roles played by the VBUS pin in the USB communication? The microcontroller I am using is capable of playing OTG role.
From the above info I gathered, I need clarifications on these three points.
What is the use of VBUS pin in the microcontroller if it is used as a host? What are the operations are done by USB engine when MCU acts as host?
What is the use of VBUS pin in the microcontroller if it is used as a device? What are the operations are done by USB engine when MCU acts as device?
How the Vbus pin is used in OTG mode?
The answer need not to be MCU oriented. The relevant and general answers are also welcome.
Thanks for the help!!!