Operation On Receiving A Setup Token (Endpoint 0) - Renesas H8S/2158 User Manual

16-bit single-chip microcomputer h8s family/h8s/2100 series
Table of Contents

Advertisement

Section 18 Universal Serial Bus Interface (USB)
The bus driver/receiver on the port unit and the USB function core process the electrical signal and
signal bit stream on the USB bus line. The token, acknowledge type, and data byte are extracted,
and the acknowledge and data byte are converted to electrical signals of the bit stream (no. 1 and 2
in table 18.4).
In a SETUP token reception, if a GetDescriptor or SetDescriptor command or a device class
specific command is received, the SETUP and EP0OTS flags are set to 1 and SETUP token
reception is informed to the slave CPU (no. 3 in table 18.4). The received command must be
transferred using the FIFO and be interpreted and processed in the slave CPU (no. 6 in table 18.4).
The remaining transactions in the control transfer must also be processed in the slave CPU using
FIFOs (no. 4 and 5 in table 18.4).
In a control transfer, interrupt transfer, and bulk transfer, an IN or OUT token reception is not
informed to the CPU and data transfer is performed continuously. In an IN transaction, transmit
data is prepared in the FIFO in advance and transmission is initiated if the EPTE bit is set;
otherwise a NAK handshaking is performed. After an IN transaction has been completed, transfer
normal completion or abnormal completion is determined by the host handshaking and this result
is informed to the CPU through the TS and TF bits in USBIFR0, the EPTS bit in TSFR0, and the
EPTF bit in TFFR0. In an OUT transaction, an ACK handshaking is performed if the FIFO has
received all data items; otherwise an NAK handshaking is performed. In an IN or OUT
transaction, a STALL handshaking is performed if the endpoint is specified as a STALL state by
EPSTL.
18.4.2

Operation on Receiving a SETUP Token (Endpoint 0)

Transactions sequentially initiated when the host has received a SETUP token are called control
transfer. The control transfer is comprised of three stages: setup, data, and status stages. The
control transfer includes two transfer types: control write transfer and control read transfer. The
transfer type such as control write or read transfer and the number of bytes to be transferred in the
data stage are determined by the 8-byte command transferred by an OUT transaction in setup
stage.
The setup stage comprises a SETUP transaction. The data stage comprises no transaction or one or
multiple data transactions. The status stage comprises a data transaction.
Table 18.5 shows the packets included in each transaction.
Rev. 3.00 Jan 25, 2006 page 604 of 872
REJ09B0286-0300

Advertisement

Table of Contents
loading

Table of Contents