09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

USB on-the-go full-speed (OTG_FS) <strong>RM0090</strong><br />

during USB operations. Any unforeseen VBUS voltage drop below the VBUS valid threshold<br />

(4.25 V) leads to an OTG interrupt triggered by the session end detected bit (SEDET bit in<br />

OTG_FS_GOTGINT). The application is then required to remove the VBUS power and clear<br />

the port power bit.<br />

When HNP and SRP are both disabled, the VBUS sensing pin (PA9) should not be<br />

connected to VBUS . This pin can be can be used as GPIO.<br />

The charge pump overcurrent flag can also be used to prevent electrical damage. Connect<br />

the overcurrent flag output from the charge pump to any GPIO input and configure it to<br />

generate a port interrupt on the active level. The overcurrent ISR must promptly disable the<br />

V BUS generation and clear the port power bit.<br />

Host detection of a peripheral connection<br />

If SRP or HNP are enabled, even if USB peripherals or B-devices can be attached at any<br />

time, the OTG_FS will not detect any bus connection until VBUS is no longer sensed at a<br />

valid level (5 V). When VBUS is at a valid level and a remote B-device is attached, the<br />

OTG_FS core issues a host port interrupt triggered by the device connected bit in the host<br />

port control and status register (PCDET bit in OTG_FS_HPRT).<br />

When HNP and SRP are both disabled, USB peripherals or B-device are detected as soon<br />

as they are connected. The OTG_FS core issues a host port interrupt triggered by the<br />

device connected bit in the host port control and status (PCDET bit in OTG_FS_HPRT).<br />

Host detection of peripheral a disconnection<br />

The peripheral disconnection event triggers the disconnect detected interrupt (DISCINT bit<br />

in OTG_FS_GINTSTS).<br />

Host enumeration<br />

After detecting a peripheral connection the host must start the enumeration process by<br />

sending USB reset and configuration commands to the new peripheral.<br />

Before starting to drive a USB reset, the application waits for the OTG interrupt triggered by<br />

the debounce done bit (DBCDNE bit in OTG_FS_GOTGINT), which indicates that the bus is<br />

stable again after the electrical debounce caused by the attachment of a pull-up resistor on<br />

DP (FS) or DM (LS).<br />

The application drives a USB reset signaling (single-ended zero) over the USB by keeping<br />

the port reset bit set in the host port control and status register (PRST bit in<br />

OTG_FS_HPRT) for a minimum of 10 ms and a maximum of 20 ms. The application takes<br />

care of the timing count and then of clearing the port reset bit.<br />

Once the USB reset sequence has completed, the host port interrupt is triggered by the port<br />

enable/disable change bit (PENCHNG bit in OTG_FS_HPRT). This informs the application<br />

that the speed of the enumerated peripheral can be read from the port speed field in the<br />

host port control and status register (PSPD bit in OTG_FS_HPRT) and that the host is<br />

starting to drive SOFs (FS) or Keep alives (LS). The host is now ready to complete the<br />

peripheral enumeration by sending peripheral configuration commands.<br />

Host suspend<br />

The application decides to suspend the USB activity by setting the port suspend bit in the<br />

host port control and status register (PSUSP bit in OTG_FS_HPRT). The OTG_FS core<br />

stops sending SOFs and enters the suspended state.<br />

1029/1416 Doc ID 018909 Rev 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!