Data Transfer Operations
MOTOROLA
USB Device Port
28-41
28.7.2 USB Transfers
Data transfers on the USB are composed of one or more packets. Instead of maintaining a transfer count,
the USB host and device send groups of packets to each other in units called transfers. In a transfer, all
packets are the same size, except the last one. The last packet in a transfer is a short packet, as small as 0
bytes (when the last data byte ends on a packet boundary).
This section describes how data transfers work from both the device to the host, and from the host to the
device.
28.7.2.1 Data Transfers to the Host
The user starts by determining the number of packets in the data block, based on the maximum packet size
of the target endpoint.
When the number of packets is an integer, the transfer ends on a packet boundary. A zero length packet is
required to terminate the transfer. When the number of packets is not an integer, the last packet of the
transfer is a short packet and no zero length packet is required.
For each packet in the transfer, write the data to the USB_EPn_FDAT register. The last byte in each packet
must be tagged with the end-of-frame marker through the USB_EPn_FCTRL register (WFR bit) or DMA
service request lines. Monitor the FIFO_LOW interrupt, EOF interrupt, or DMA service requests to
determine when the FIFO can accept another packet.
When a zero length packet is required to terminate the transfer after the last byte is written to the FIFO, set
the ZLPS bit in the USB_EPn_STAT register for the endpoint.
Wait for the EOT interrupt to determine when the transfer is complete.
NOTE:
For DMA operation, a zero length frame is not defined so it is necessary to
have the user software monitor the EOT interrupts and use them as a basis
for delineating individual transfers. USB traffic flow is halted until the
EOT interrupt is serviced to ensure that data from different data transfers
does not get mixed-up in the FIFOs.
28.7.2.2 Data Transfers to the Device
The length of data transfer from the host is generally not known in advance. The device receives a
continuous stream of packets and uses the EOT interrupt to determine when the transfer ended.
Software on the device monitors the EOF interrupt and/or the DMA transfer requests to manage packet
traffic. Each time a packet is received, the device must pull the data from the FIFO. When an end-of-frame
is transferred from the UDC module into the data FIFO, the EOF interrupt asserts. At the end of a complete
transfer, the EOT interrupt asserts. For a bulk endpoint, until the CPU has serviced the EOT interrupt, the
device Negative Acknowledges (NAKs) any further requests to that endpoint from the host. This
guarantees that data from two different transfers never get intermixed within the FIFO.
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 ...