How to set USB_OTG1_PWR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set USB_OTG1_PWR

Jump to solution
573 Views
expertsleepers
Contributor III

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 (input)
  • USB_OTG1_OC (input)
  • USB_OTG1_PWR (output)

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.

 

Labels (1)
0 Kudos
Reply
1 Solution
461 Views
EdwinHz
NXP TechSupport
NXP TechSupport

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);

View solution in original post

0 Kudos
Reply
6 Replies
520 Views
EdwinHz
NXP TechSupport
NXP TechSupport

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 "USB_OTGx_PWR is the logic output, operating as GPIO to control an external switch that provides the in-system VBUS power in Host mode."

BR,
Edwin.

0 Kudos
Reply
508 Views
expertsleepers
Contributor III

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?

 

0 Kudos
Reply
489 Views
EdwinHz
NXP TechSupport
NXP TechSupport

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.

0 Kudos
Reply
474 Views
expertsleepers
Contributor III

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?

 

 

0 Kudos
Reply
462 Views
EdwinHz
NXP TechSupport
NXP TechSupport

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);

0 Kudos
Reply
416 Views
expertsleepers
Contributor III
Thanks, that's what I was missing.
0 Kudos
Reply