R01UH0823EJ0100 Rev.1.00
Page 938 of 1823
Jul 31, 2019
RX23W Group
32. USB 2.0 Host/Function Module (USBc)
32.3.4.7
Data PID Sequence Bit
The USB automatically toggles the sequence bit in the data PID when data is transferred successfully in the control
transfer data stage, bulk transfer, and interrupt transfer. The sequence bit of the next data PID to be transmitted can be
confirmed with the SQMON flag in the DCPCTR and PIPEnCTR registers. When data is transmitted, the sequence bit
switches at the timing of ACK handshake reception. When data is received, the sequence bit switches at the timing of
ACK handshake transmission. The DCPCTR.SQCLR bit and the PIPEnCTR.SQSET bit can be used to change the data
PID sequence bit.
When the function controller has been selected and control transfer is used, the USB automatically sets the sequence bit
when a stage transition is made. DATA1 is returned when the setup stage is ended. The sequence bit is not referenced and
PID = DATA1 is returned in a status stage. Therefore, software settings are not required. However, when the host
controller has been selected and control transfer is used, the sequence bit should be set by software at a stage transition.
For the ClearFeature request transmission or reception, the data PID sequence bit should be set by software regardless of
whether the host controller or function controller is selected.
32.3.4.8
Response PID = NAK Function
The USB has a function that disables pipe operation (response PID = NAK) at the timing at which the final data packet of
a transaction is received (the USB automatically distinguishes this based on reception of a short packet or the transaction
counter) by setting the PIPECFG.SHTNAK bit to 1.
When the double buffer mode is being used for the buffer memory, using this function enables reception of data packets
in transfer units. If pipe operation has been disabled, software should set the pipe to the enabled state again (response PID
= BUF).
The response PID = NAK function can be used only when bulk transfers are used.
32.3.4.9
Auto Response Mode
With the pipes for bulk transfer (PIPE1 to PIPE5), when the PIPEnCTR.ATREPM bit is set to 1, a transition is made to
auto response mode. During an OUT transfer (the PIPECFG.DIR bit = 0), OUT-NAK mode is entered, and during an IN
transfer (the DIR bit = 1), null auto response mode is entered.
32.3.4.10
OUT-NAK Mode
With the pipes for bulk OUT transfer, NAK is returned in response to an OUT token and an NRDY interrupt is output
when the PIPEnCTR.ATREPM bit is set to 1. To make a transition from normal mode to OUT-NAK mode, OUT-NAK
mode should be specified in the pipe operation disabled state (response PID = NAK) before enabling pipe operation
(response PID = BUF). After pipe operation has been enabled, OUT-NAK mode becomes valid. However, if an OUT
token is received immediately before pipe operation is disabled, the token data is normally received, and an ACK is
returned to the host.
To make a transition from OUT-NAK mode to normal mode, OUT-NAK mode should be canceled in the pipe operation
disabled state (response PID = NAK) before enabling pipe operation (response PID = BUF). In normal mode, reception
of OUT data is enabled.