SLAU723A October 2017 – October 2018 MSP432E401Y , MSP432E411Y
In order for the USB, acting as a device, to be suspended by the host, the LPM feature must be enabled by configuring the USB LPM Control (USBLPMCNTRL) register. The LPMEN field is used to enable and support the LPM transactions and the TXLPM field is used to instruct the hardware that it is ready to suspend and respond to the next LPM transaction with an ACK. Table 27-1 describes the response to an LPM transaction by the USB device.
TXLPM | LPMEN | Data Pending (Data Resides in the TX FIFOs) | Response to the Next LPM Transaction |
---|---|---|---|
0 | 0x0 | Don't care | Time-out |
0 | 0x2 | ||
1 | 0x0 | ||
1 | 0x2 | ||
0 | 0x1 | Don't care | STALL |
1 | 0x1 | ||
0 | 0x3 | Don't care | NYET |
1 | 0x3 | Yes | NYET |
1 | 0x3 | No | ACK |
For all cases in which the USB device responds (no timeout occurs), an LPM interrupt is generated in the USB LPM Raw Interrupt Status (USBLPMRIS) register. Note that the USB device only responds with an ACK only if there is no data pending in any of the TX Endpoint FIFOs. If there is data pending, it responds with a NYET.
Once an LPM transaction is successfully received, three events occur:
Since the primary purpose of LPM is to save power, the software reads the USBLPMATTR register to determine the attributes of the Suspend. Software must make a determination based on these attributes whether additional power savings in the system can be exploited. In making this determination it is noted that if the host initiates the resume signalling, the USB is required to respond to packet transmissions within the time specified by HIRD + 10us.
When the host resumes the bus, it drives resume signalling for a minimum time specified by the HIRD field in the USBLPMATTR register. The USB must be able to respond to traffic within the time HIRD + 10us. The USB transitions to a normal operating state automatically and a resume interrupt bit is set in the USB LPM Raw Interrupt Status (USBLPMRIS) register. However for this to occur, the System Clock and the input signal USB0CLK must be enabled. To facilitate the resume timing requirement, an additional feature, NAK, is provided in the USBLPMCNTRL register. If NAK is set to 0x1, all endpoints respond to any transaction (other then an LPM) with a NAK. This bit only takes effect after the USB has LPM suspended. Typically, this bit would be asserted when the TXLPM field is also asserted. Using this feature may simplify the resume timing requirement because only XCLK is needed for the USB to respond (with a NAK) to traffic. Software can continue to restore the system to normal operation while the USB responds to all transactions with a NAK. After the system has been completely restored, software can then clear the NAK field is the USBLPMCNTRL register.
If the software wants to initiate a remote wakeup while the USB is in Suspend mode, it should write a 0x1 to the RES bit in the USBLPMCNTRL register. This bit is self clearing. Writing a 0x1 causes resume signaling to be driven on the bus for 50 µs. The host responds by driving resume for 60 µs to 990 µs. 10 µs after the host stops driving resume, the USB transitions to its normal operational state and is ready for packet transmission. A resume interrupt bit is set in the USBLPMRIS register.