9397 750 XXXXX
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
User manual
Rev. 01 — 15 August 2005
212
Philips Semiconductors
UM10139
Volume 1
Chapter 14: USB Device Controller
software can read this register to determine the number of bytes it has transferred to the
EP_RAM. After each write to the Transmit Data register the hardware will decrement the
contents of the Transmit Packet Length register. For lengths larger than the Maximum
Packet Size, the software should submit data in steps of Maximum Packet Size and the
remaining extra bytes in the last packet. For example, if the Maximum Packet Size is 64
bytes and the data buffer to be transferred is of length 130 bytes, then the software
submits 64 bytes packet twice followed by 2 bytes in the last packet. So, a total of 3
packets are sent on USB. The USBTxPLen is a write only register.
14.8.7 USB
Control
register (USBCtrl - 0xE009 0028)
This register controls the data transfer operation of the USB device. The USBCtrl is a
read/write register.
14.8.8 Slave Mode data transfer
When the software wants to read the data from an endpoint buffer it should make the
Read Enable bit high and should program the LOG_ENDPOINT in the USB control
register. The control logic will first fetch the packet length to the receive packet length
register. The PKT_RDY bit (
) in the Packet Length Register is set along with this.
Also the hardware fills the receive data register with the first word of the packet.
The software can now start reading the Receive Data register (
). When the
end of packet is reached the Read Enable bit (RD_EN in
) will be disabled by the
control logic and RxENDPKT bit is set in the Device Interrupt Status register. The software
should issue a Clear Buffer (refer to
Section 14.9.13 “Clear Buffer (Command: 0xF2, Data:
read 1 byte (optional))” on page 230
) command. The endpoint is now ready to accept the
next packet.
Table 202: USB Transmit Packet Length register (USBTxPLen - address 0xE009 0024) bit
description
Bit
Symbol
Value Description
Reset
value
9:0
PKT_LNGTH -
The remaining amount of data in bytes to be written to the
EP_RAM.
0x000
31:10
-
-
Reserved, user software should not write ones to reserved
bits. The value read from a reserved bit is not defined.
NA
Table 203: USB Control register (USBCtrl - address 0xE009 0028) bit description
Bit
Symbol
Value
Description
Reset
value
0
RD_EN
Read mode control.
0
0
Read mode is disabled.
1
Read mode is enabled.
1
WR_EN
Write mode control.
0
0
Write mode is disabled.
1
Write mode is enabled.
5:2
LOG_ENDPOINT -
Logical Endpoint number.
0x0
31:6 -
-
Reserved, user software should not write ones to
reserved bits. The value read from a reserved bit is not
defined.
NA