![](http://datasheet.mmic.net.cn/380000/-PD98501_datasheet_16745028/-PD98501_418.png)
CHAPTER 6 USB CONTROLLER
418
Preliminary User’s Manual S14767EJ1V0UM00
(1)
First, the V
R
4120A RISC Processor prepares the send data in system memory. The data must be of a format
that corresponds to the configuration of the send buffer.
The V
R
4120A RISC Processor reads the USB Command Register.
The V
R
4120A RISC Processor checks whether the Busy bit of the USB Command Register has been set. If
the Busy bit is set, it indicates that USB Controller is still executing the previous command. Thus the
V
R
4120A RISC Processor can not issue a new command.
The V
R
4120A RISC Processor reads the USB Tx EndPoint Status Register.
The V
R
4120A RISC Processor checks whether the EndPoint that is to perform send next is in the Busy status.
If the EndPoint is Busy, the V
R
4120A RISC Processor repeats the processing from the reading of the USB Tx
EndPoint Status Register.
The V
R
4120A RISC Processor issues the Tx command.
The V
R
4120A RISC Processor reads the USB General Status Registers 1.
The V
R
4120A RISC Processor checks whether sending has terminated.
The V
R
4120A RISC Processor reads the contents of the USB Tx Mailbox Read Address Register (Address:
78H).
(10) The V
R
4120A RISC Processor reads the send indication.
(11) The V
R
4120A RISC Processor updates the contents of the USB Tx MailBox Read Address Register.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
By issuing a send command, the sending of a data segment can be scheduled.
A send command is issued by writing a value into the registers listed below. When writing, it is necessary to write
first to the USB Command Address Register, then the USB Command Register.
If data size field of USB Command Register is “0”, USB Controller sends Zero-Length Packet.
Figure 6-8. Send Command Issue
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Reserved
Command
Data Size
Reserved
31
16
15
0
Address
write head address of send
data segment
Specifies EndPoint Number
000: EndPoint0 (Control)
001: EndPoint1 (Isochronous)
010: EndPoint3 (Bulk)
011: EndPoint5 (Interrupt)
USB Command Register (0x40)
USB Command Address Register (0x44)
For a given EndPoint, it is possible to schedule the sending of up to two data items. Once two data items have
been sent, even if the V
R
4120A RISC Processor writes a send command into the USB Command Register to send a
third data item, that command is ignored.
The number of data items that are scheduled to be sent can be determined by reading the USB Tx EndPoint Status
Register.