CHAPTER 6 USB CONTROLLER
Preliminary User’s Manual S14767EJ1V0UM00
413
6.5 Data Send Function
This section explains USB Controller's data send function.
6.5.1 Overview of send processing
USB Controller takes the data segments in system memory, divides them into USB packets, then sends them to
the Host PC. The V
R
4120A RISC Processor sets the size of USB packet in the MAXP field of the EP0 Control
Register, the EP1-2 Control Register, the EP3-4 Control Register, and the EP5-6 Control Register (in the example
shown below, a value of 64 bytes has been set).
Figure 6-4. Division of Data into USB Packets
Data Segment
USB
Packet
USB
Packet
USB
Packet
USB
Packet
USB
Packet
64Byte
64Byte
64Byte
64Byte
40Byte
When the data segments are divided by a value other than that set in the MAXP field, the last item of the divided
data will be smaller than the value set in the MAXP field (40 bytes in the example shown above). As a result, the Host
PC can identify the boundary between data segments. If a data segment is divided by the value set in the MAXP field,
a zero-length USB packet will be sent after the last item of the divided data. (Only in send SZLP Mode. In send NZLP
Mode, a zero-length USB packet is not sent. For an explanation of the send modes, see Section 6.5.3.)
After all the data segments have been transferred, USB Controller writes the "send indication" which have send
status information into the mailbox in system memory.
For an explanation of the send indication, see Section 6.5.6.
With USB Controller, the sending of two data segments can be scheduled for a given EndPoint. Each scheduled
send is performed upon the issue of a send command. The current send status can be determined by reading the
contents of the USB Tx EndPoint Status Register (Address: 48H).
For an explanation of how to issue the send command, see Section 6.5.4.
6.5.2 Send buffer configuration
Upon sending data to the Host PC, the V
R
4120A RISC Processor creates a send buffer in system memory, then
informs USB Controller.
The configuration of the send buffer is as shown below.