Data Transfer Operations
MOTOROLA
USB Device Port
28-39
28.6.4 Catastrophic Error
In the case of a catastrophic error, the software executes a hard reset, re-initializes the USB module, and
waits for the USB host to re-enumerate the bus.
28.7 Data Transfer Operations
Four types of data transfer modes exist for the USB module: control transfers, bulk transfers, isochronous
transfers and interrupt transfer. From the perspective of the USB module, the interrupt transfer type is
identical to the bulk data transfer mode, and no additional hardware is supplied to support it. This section
covers the transfer modes and how they work.
Data moves across the USB in packets. Groups of packets are combined to form data transfers. The same
packet transfer mechanism applies to bulk, interrupt, and control transfers. Isochronous data is also moved
in the form of packets, however, because isochronous pipes are given a fixed portion of the USB
bandwidth at all times, there is no end-of-transfer (EOT).
28.7.1 USB Packets
Packets range in size from 0 to 1023 bytes, depending on the transfer mode. For bulk, control, and interrupt
traffic, packet sizes are limited to 8-, 16-, 32-, or 64-bytes. Isochronous packets can range from 0 bytes to
1023 bytes. The packet size is programmed within the UDC module on an endpoint by endpoint basis. For
DMA access, the maximum packet size for isochronous endpoints is restricted by the endpoint’s FIFO
size.
The terms
packet
and
frame
are used interchangeably within this document. While USB traffic occurs in
units called packets, the FIFO mechanism uses the term frames for the same blocks of data. The only
difference between frames and packets from the user’s standpoint is that packets can be as little as zero
bytes in length, while a frame must be at least one byte in length.
28.7.1.1 Short Packets
Each endpoint has a maximum packet size associated with it. The packet size is set with the MAX field in
the Endpoint n Status/Control Register. In most cases, packets transferred across an endpoint are sent at the
maximum size. Because the USB does not indicate a data transfer size, or include an end-of-transfer token,
short packets are used to mark the end of data. Software writes short packets into the FIFO to indicate the
end of data. Incoming short packets are identified by examining the length of a received packet or by
looking at the end-of-transfer and end-of-frame interrupts.
28.7.1.2 Sending Packets
To send a packet of data to the USB host using programmed I/O, use these steps:
1. For an N byte packet, write the first N-1 bytes to the Endpoint n FIFO Data Register
(USB_EPn_FDAT). Data can be written as bytes, words, or longwords.
2. For the N
th
byte, set the WFR bit in the USB_EPn_FCTRL register before writing the last
data byte to the USB_EPn_FDAT register. Data is written in big-endian format. The most
significant byte (byte 3) is held in bits 7 through 0.
When using the DMA controller for a memory I/O transfer to send packets, the sequence is as follows:
1. Program the DMA controller to write data to the endpoint FIFO and enable the DMA channel
for the USB endpoint DMA.
Summary of Contents for DragonBall MC9328MX1
Page 68: ...1 12 MC9328MX1 Reference Manual MOTOROLA Introduction ...
Page 86: ...2 18 MC9328MX1 Reference Manual MOTOROLA Signal Descriptions and Pin Assignments ...
Page 116: ...3 30 MC9328MX1 Reference Manual MOTOROLA Memory Map ...
Page 126: ...4 10 MC9328MX1 Reference Manual MOTOROLA ARM920T Processor ...
Page 160: ...8 8 MC9328MX1 Reference Manual MOTOROLA System Control ...
Page 272: ...13 32 MC9328MX1 Reference Manual MOTOROLA DMA Controller ...
Page 281: ...Programming Model MOTOROLA Watchdog Timer Module 14 9 ...
Page 282: ...14 10 MC9328MX1 Reference Manual MOTOROLA Watchdog Timer Module ...
Page 300: ...15 18 MC9328MX1 Reference Manual MOTOROLA Analog Signal Processor ASP ...
Page 438: ...18 16 MC9328MX1 Reference Manual MOTOROLA Serial Peripheral Interface Modules SPI 1 and SPI 2 ...
Page 478: ...19 40 MC9328MX1 Reference Manual MOTOROLA LCD Controller ...
Page 574: ...21 32 MC9328MX1 Reference Manual MOTOROLA Memory Stick Host Controller MSHC Module ...
Page 598: ...23 16 MC9328MX1 Reference Manual MOTOROLA Real Time Clock RTC ...
Page 670: ...24 72 MC9328MX1 Reference Manual MOTOROLA SDRAM Memory Controller ...
Page 726: ...25 56 MC9328MX1 Reference Manual MOTOROLA SmartCard Interface Module SIM ...
Page 736: ...26 10 MC9328MX1 Reference Manual MOTOROLA General Purpose Timers ...
Page 854: ...29 18 MC9328MX1 Reference Manual MOTOROLA I2C Module ...
Page 900: ...30 46 MC9328MX1 Reference Manual MOTOROLA Synchronous Serial Interface SSI ...
Page 942: ...32 26 MC9328MX1 Reference Manual MOTOROLA GPIO Module and I O Multiplexer IOMUX ...