R01UH0823EJ0100 Rev.1.00
Page 937 of 1823
Jul 31, 2019
RX23W Group
32. USB 2.0 Host/Function Module (USBc)
32.3.4.6
Response PID
The PID[1:0] bits in the DCPCTR and PIPEnCTR registers are used to set the response PID for each pipe.
The following shows the USB operation with various response PID settings:
(1) Response PID settings when the host controller is selected:
The response PID is used to specify the execution of transactions.
NAK setting: Using pipes is disabled. No transaction is executed.
BUF setting: Transactions are executed based on the status of the buffer memory.
For OUT direction: If there are transmit data in the buffer memory, an OUT token is issued.
For IN direction: If there is an area to receive data in the buffer memory, an IN token is issued.
STALL setting: Using pipes is disabled. No transaction is executed.
Note:
Setup transactions for the DCP are set with the DCPCTR.SUREQ bit.
(2) Response PID settings when the function controller is selected:
The response PID is used to specify the response to transactions from the host.
NAK setting: The NAK response is returned in response to the generated transaction.
BUF setting: Responses are made to transactions according to the status of the buffer memory.
STALL setting: The STALL response is returned in response to the generated transaction.
Note:
For setup transactions, an ACK response is returned regardless of the PID[1:0] bits setting, and the USB request
is stored in the register.
The USB may write to the PID[1:0] bits, depending on the results of the transaction as described below.
(3) When the host controller has been selected and the response PID is set by hardware:
NAK setting: In the following cases, PID[1:0] = 00b (NAK) is set and issuing of tokens is automatically stopped:
When a transfer other than isochronous transfer has been performed and an NRDY interrupt is generated.
(For details, refer to
section 32.3.3.2, NRDY Interrupt
- If a short packet is received when the PIPECFG.SHTNAK bit has been set to 1 for bulk transfer.
- If the transaction counting ends when the SHTNAK bit has been set to 1 for bulk transfer.
BUF setting: There is no BUF writing by the USB.
STALL setting: In the following cases, PID[1:0] = 1xb (STALL) is set and issuing of tokens is automatically
stopped:
When STALL is received in response to the transmitted token.
When the size of the receive data packet exceeds the maximum packet size.
(4) When the function controller has been selected and the response PID is set by hardware:
NAK setting: In the following cases, PID[1:0] = 00b (NAK) is set and NAK is returned in response to transactions:
When the SETUP token is received normally (DCP only).
If the transaction counting ends or a short packet is received when the PIPECFG.SHTNAK bit has been set to 1 for
bulk transfer.
BUF setting: There is no BUF writing by the USB.
STALL setting: In the following cases, PID[1:0] = 1xb (STALL) is set and STALL is returned in response to
transactions:
When a maximum packet size exceeded error is detected in the received data packet.
When a control transfer sequence error has been detected (DCP only).