Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
608
/
631
Enable the clock signal of the USB module
Clear the USB_CTRL.PD bit
Wait for the internal reference voltage to stabilize, because it takes a start-up time to turn on the internal voltage,
during which the USB transceiver is in an indeterminate state
Clear the USB_CTRL.FRST bit
Clear the USB_STS register, remove pending interrupts, and enable other units
Note:
1
、
Every time the USB module is enabled after system reset or power-on reset, the pull-up resistor on the DP signal
line needs to be configured. This control bit is located in bit25 of the base address 0x4000 1824 register.
Set bit25
to 1 to enable the pull-up resistor on the DP signal line, otherwise disable the pull-up resistor. Modification of
other bits of this register is not allowed.
26.4.5.1.2
USB reset (reset interrupt)
When a USB reset occurs, the state of the USB module is the same as after a system reset: all endpoints are disabled
for communication. The software needs to do the following:
After the reset interrupt is generated, the software must enable the transmission of endpoint 0 within 10ms
Set the USB_ADDR.EFUC bit
Initialize the USB_EP0 register and its associated endpoint packet buffer
Suspend and resume events
26.4.5.2.1
Suspend events
When full-speed USB is communicating normally, the host will send a PID SOF token packet every millisecond. If
the USB module detects that 3 consecutive SOF packets are lost, that is, the USB bus is in an idle state within 3ms,
the hardware sets the USB_STS.SUSPD bit, triggers a suspend interrupt, and the USB device enters the suspend state.
The USB2.0 standard stipulates that in the suspend state, the average current consumption on the USB bus does not
exceed 2.5mA, but self-powered devices do not need to strictly abide by this regulation.
Note:
1
、
After the USB device enters the suspend state, it must still have the function of detecting the RESET signal.
26.4.5.2.2
Resume events
After the USB device enters the suspend state, to resume normal USB communication, the USB host can initiate a
resume sequence or a reset sequence, or the USB device itself can trigger the resume sequence, but the resume
sequence can only be ended by the USB host. If the reset sequence initiated by the USB host resumes the USB device,
according to the regulations in the USB2.0 standard, it must be ensured that the resume process does not exceed 10ms.
Table 26-4 lists the USB_FN.RXDP_STS bit and the USB_FN.RXDM_STS bit to identify what triggers the resume
event and the corresponding software action.