How-To Guide

Table Of Contents
R01UH0823EJ0110 Rev.1.10 Page 912 of 1852
Nov 30, 2020
RX23W Group 32. USB 2.0 Host/Function Module (USBc)
PID[1:0] Bits (Response PID)
The PID[1:0] bits specify the response type for the next transaction of the relevant pipe.
The default setting of the PID[1:0] bits are 00b (NAK). Modify the setting of the PID[1:0] bits to 01b (BUF) to use the
relevant pipe for USB transfer.
Table 32.6 and Table 32.7 show the basic operation (operation when there are no errors
in the transmitted and received packets) of the USB depending on the setting of the PID[1:0] bits.
After modifying the setting of the PID[1:0] bits through software from 01b (BUF) to 00b (NAK) during USB
communication using the relevant pipe, check that the PBUSY flag is 1 to see if USB transfer using the relevant pipe has
actually entered the NAK state. However, if the USB changes the PID[1:0] bits to 00b (NAK), the PBUSY flag does not
need to be checked by software.
The USB modifies the setting of the PID[1:0] bits in the following cases.
The USB sets the PID[1:0] bits to 11b (STALL) on receiving a data packet with a payload exceeding the maximum
packet size of the relevant pipe.
The USB sets the PID[1:0] bits to 00b (NAK) on detecting a USB bus reset when the function controller is selected.
The USB sets the PID[1:0] bits to 00b (NAK) on detecting a receive error, such as a CRC error, three consecutive
times when the host controller is selected.
The USB sets the PID[1:0] bits to 11b (STALL) on receiving the STALL handshake when the host controller is
selected.
To specify each response type, set the PID[1:0] bits as follows.
To make a transition from NAK (00b) to STALL, set 10b.
To make a transition from BUF (01b) to STALL, set 11b.
To make a transition from STALL (11b) to NAK, set 10b and then 00b.
To make a transition from STALL (11b) to BUF, set 10b, 00b, and then 01b.
To make a transition from STALL (10b) to BUF, set 00b and then 01b.
PBUSY Flag (Pipe Busy Flag)
The PBUSY flag indicates whether the relevant pipe is being currently used or not for the transaction.
The USB modifies the PBUSY flag from 0 to 1 upon start of the USB transaction for the relevant pipe, and modifies the
PBUSY flag from 1 to 0 upon completion of one transaction.
Reading the PBUSY flag after the PID[1:0] bits has been set to 00b (NAK) by software allows checking whether
modification of the pipe settings is possible.
SQMON Flag (Sequence Toggle Bit Confirmation Flag)
The SQMON flag indicates the expected value of the sequence toggle bit for the next transaction of the relevant pipe.
The USB allows the SQMON flag to toggle upon normal completion of the transaction. However, the SQMON flag is
not allowed to toggle when a data PID mismatch occurs during the transfer in the receiving direction.
SQSET Bit (Sequence Toggle Bit Set)
The SQSET bit should be set to 1 to set DATA1 as the expected value of the sequence toggle bit for the next transaction
of the relevant pipe.
Setting the SQSET bit through software allows the USB to set DATA1 as the expected value of the sequence toggle bit of
the relevant pipe. The USB sets the SQSET bit to 0.
SQCLR Bit (Sequence Toggle Bit Clear)
The SQCLR bit should be set to 1 to clear the expected value (to set DATA0 as the expected value) of the sequence
toggle bit for the next transaction of the relevant pipe.
Setting the SQCLR bit to 1 through software allows the USB to set DATA0 as the expected value of the sequence toggle
bit of the relevant pipe. The USB sets the SQCLR bit to 0.