Table 42-140. State descriptions for the dual role B device flow
State
Action
Response
B_IDLE
If ID\ Interrupt.
A Type A cable has been plugged in and the device should now
respond as a Type A device.
Go to A_IDLE
If B_SESS_VLD Interrupt.
The A device has turned on VBUS and begins a session.
Go to B_PERIPHERAL
Turn on DP_HIGH
If B application wants the bus and Bus is Idle for 2 ms and the
B_SESS_END bit is set, the B device can perform an SRP.
Go to B_SRP_INIT
Pulse CHRG_VBUS
Pulse DP_HIGH 5-10
ms
B_SRP_INIT
If ID\ Interrupt or SRP Done (SRP must be done in less than 100
ms.)
Go to B_IDLE
B_PERIPHERAL
If HNP enabled and the bus is suspended and B wants the bus, the
B device can become the host.
Go to B_WAIT_ACON
Turn off DP_HIGH
B_WAIT_ACON
If A connects, an attach interrupt is received
Go to B_HOST
Turn on Host Mode
If ID\ Interrupt or B_SESS_VLD/ Interrupt
If the cable changes or if VBUS goes away, the host doesn't support
us.
Go to B_IDLE
Go to B_IDLE
If 3.125 ms expires or if a Resume occurs
Go to B_PERIPHERAL
B_HOST
If ID\ Interrupt or B_SESS_VLD\ Interrupt
If the cable changes or if VBUS goes away, the host doesn't support
us.
Go to B_IDLE
If B application is done or A disconnects
Go to B_PERIPHERAL
42.8 Device mode IRC48 operation
The following are the IRC48 initialization code steps:
1. Enable the IRC48M clock: USB_CLK_RECOVER_IRC_EN[IRC_EN] = 1b
2. Enable the USB clock recovery tuning:
USB_CLK_RECOVER_CTRL[CTRL_CLOCK_RECOVER_EN] = 1b
3. Choose the clock source of USB by configuring the muxes and dividers in the SIM.
The IRC48M is muxed by setting SIM_SOPT2[MCGPLLFLL]=11b for USB usage.
4. The selected mux output clock can be divided by the USB clock divider, so set these
fields so no clock division is enabled. This is the equation for the divider:
Divider output clock = Divider input clock × [ (1) / (1) ].
So set SIM_CLKDIV2[USBDIV] = 000b and SIM_CLKDIV2[USBFRAC] = 0b
Device mode IRC48 operation
K22F Sub-Family Reference Manual , Rev. 3, 7/2014
1034
Freescale Semiconductor, Inc.