EasyManuals Logo

Cypress EZ-USB FX3 User Manual

Cypress EZ-USB FX3
660 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #116 background imageLoading...
Page #116 background image
EZ-USB FX3 Technical Reference Manual, Document Number: 001-76074 Rev. *F 116
Universal Serial Bus (USB)
6.10.2.2 Session Request Protocol
Upon attachment to the USB bus, if the USB bus power VBUS is not on, the B device can request the host to drive VBUS and
begin to communicate with the peripheral. This process is called "Session Request Protocol" (SRP).
In OTG 2.0, a SRP request is started with D+ pulsing. When FX3 is connected as a B-device, the SRP follows this sequence
of steps:
1. The firmware checks that no current session is ongoing by checking that the SESS_END bit in the OTG control register is
set and also that the DP and DM bits are cleared.
2. The firmware sets the DP_PU_EN bit in the OTG control register to pulse the USB D+ line and loads the OTG timer regis-
ter to generate an interrupt between 5 ms and 10 ms later.
3. After receiving the OTG timer timeout interrupt, the processor clears the DP_PU_EN bit to stop pulsing the USB D+ sig-
nal.
4. The firmware enables the VBUS_VALID_INT interrupt and waits for VBUS to be powered.
5. After receiving the VBUS_VALID_INT interrupt, the firmware enables the D+ pull-up by enabling the USB 2.0 function
controller, which allows it to connect to the USB host.
6. If the host is capable, it drives VBUS and allows FX3 to connect as a peripheral.
7. Optionally, the firmware may enable DSCHG_VBUS to discharge the VBUS line below the levels specified for SES-
S_END to begin the SRP process sooner.
As an A-device, the SRP enables the SRP interrupt to allow SRP signaling detection and waits for the SRP interrupt. Upon
receiving the interrupt, the firmware enables the VBUS power, allowing the B-device to connect. Once enabled, the firmware
should also enable the VBUS_VALID_INT interrupt to ensure that the peripheral is not drawing more current than the system
can provide. The firmware sequence is as follows:
1. After checking that DP = 0 and DM = 0 and B_SESS_END is asserted, enable the SRP interrupt.
2. Upon receiving the SRP Interrupt, enable the VBUS bus power as well as the USB host logic and its connect interrupt.
3. Upon receiving the connect interrupt, begin normal USB traffic to the B-device, starting with USB bus reset and enumera-
tion.
The following code example implements the function to issue an SRP request.
static CyU3PReturnStatus_t
CyU3POtgIssueSrp (void)
{
uint32_t regVal;
if (!glIsOtgEnable)
{
return CY_U3P_ERROR_NOT_STARTED;
}
/* Check if device mode is enabled. */
if ((!CyU3POtgIsDeviceMode ()) || (CyU3PUsbIsStarted ()) || (CyU3PUsbHostIsStarted ()))
{
return CY_U3P_ERROR_INVALID_SEQUENCE;
}
/* Check if there is any valid session. */
if (GCTL->iopower & glUibDeviceInfo.vbusDetectMode)
{
return CY_U3P_ERROR_INVALID_SEQUENCE;
}
/* This is a hack as there is no way to send a pulse on the VBUS.
* Here we are first configuring the PHY as a device and doing a DP
* pull-up to send a high. To send a low, the PHY is configured as host

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Cypress EZ-USB FX3 and is the answer not in the manual?

Cypress EZ-USB FX3 Specifications

General IconGeneral
BrandCypress
ModelEZ-USB FX3
CategoryController
LanguageEnglish

Related product manuals