Taking the iMXRT1010 as a specific example, section 35.3 of the reference manual defines three signals belonging to the USB controller:
USB_OTG1_ID is sampled and appears in the USB_nOTGSC register.
USB_OTG1_OC appears in the OCA field of the USB_nPORTSC register.
How is USB_OTG1_PWR controlled? I don't see any register field which controls this output.
Solved! Go to Solution.
Hi @expertsleepers,
For USB_OTG1_PWR, you can use either GPIO or USB IP to control.
There are two registers related to USB_OTG1_PWR:
1. USB OTG Control 1 Register (CTRL1), PWR_POL bit field to control the output polarity.
2. Port Status & Control (PORTSC1), PP bit to enable it.
The following code on RT1010 can be taken as reference
USBNC->USB_OTGn_CTRL |= USBNC_USB_OTGn_CTRL_PWR_POL_MASK;
USBNC->USB_OTGn_CTRL &= (~USBNC_USB_OTGn_CTRL_PWR_POL_MASK);
Hi @expertsleepers,
This signal is used to control the power supply to the USB VBUS line. In USB OTG applications, the device may act as a host and needs to provide power to the connected USB device. The USB_OTG1_PWR signal is typically connected to a Power Management IC (PMIC) or a power switch that enables or disables VBUS power.
As mentioned on the following post (USB_OTG1_PWR, OC & VBUS - NXP Community
BR,
Edwin.
Thanks, but I already understand the purpose of the signal. What I was asking is, how is the signal controlled in software?
What causes USB_OTG1_PWR to be set or not set?
Hi @expertsleepers,
It is operated as a GPIO output, meaning that the developer is responsible of setting it when they intend to send a signal though this pin.
If that's the case, why does it appear as a specific signal in the MUX? (GPIO_AD_00 and GPIO_AD_12 for the iMXRT1010). Surely any GPIO could be used?
Say I have USB_OTG1_PWR assigned to GPIO_AD_00 in the MUX. Which register would I write to change the output signal?
Hi @expertsleepers,
For USB_OTG1_PWR, you can use either GPIO or USB IP to control.
There are two registers related to USB_OTG1_PWR:
1. USB OTG Control 1 Register (CTRL1), PWR_POL bit field to control the output polarity.
2. Port Status & Control (PORTSC1), PP bit to enable it.
The following code on RT1010 can be taken as reference
USBNC->USB_OTGn_CTRL |= USBNC_USB_OTGn_CTRL_PWR_POL_MASK;
USBNC->USB_OTGn_CTRL &= (~USBNC_USB_OTGn_CTRL_PWR_POL_MASK);