
CHAPTER 14 USBU (UNIVERSAL SERIAL BUS UNIT)
User’s Manual U14579EJ2V0UM
334
When processing a GeneralTD, the HC obtains the next memory address from the CBP area. For a transmission to
or reception from the CurrentBufferPointer address of the data, the data many not fit in a single physical page and
may span multiple pages. In this case, the higher 20 bits of the BE area are used as the higher 20 bits of the address
instead of the higher 20 bits of the CBP area. The maximum amount of data to be transmitted to or received from a
device is the smaller of the value of the MPS area of the ED and the remaining buffer size.
After the HC decides the packet size, it always checks whether or not packets can be transferred until the end of
frame. If the bit time request of the packets that are transferred is greater than the remaining bit time of the frame,
processing is not performed.
After GeneralTD processing, the HC updates the CC, T, EC, and CBP areas of the GeneralTD. Also, after
IsochronousTD processing, the HC updates Offset(R) to the value of the PSWN area (R = N = 0 to 7).
When a TD succeeded (all data was transmitted or received) or an error occurred, the HC moves the TD to the
Done queue, updates the transfer completed queue interrupt counter (internal Done Queue Interrupt Counter), and
updates the ED to change the HeadP, C, and H areas. To enqueue a TD in the Done queue, first the HC copies the
value of the NextTD area of the current TD to the HeadP area of the ED. Next, it writes the value of the HcDoneHead
register to the NextTD area of the TD that was enqueued. Finally, it writes the address of the TD that was enqueued in
the HcDoneHead register.
At this time, the HC uses the value of the C area of the ED and the value of the final T area of the TD for updating.
When the TD is retired because of an error, the HC also updates the H area of the ED.
After performing these various kinds of processing, the HC writes the value of the HcDoneHead register to the
HCCA and updates the transfer completed queue interrupt counter by using the DI area (base for number of SOFs
issued), which defines the time until the interrupt request is generated. This counter is not updated if the value of the
DI area of the TD is greater than the counter value.
The transfer completed queue interrupt counter is decremented by each SOF, and when it becomes 0, the HC
immediately writes the current value of the HcDoneHead register to the HccaDoneHead area at the next frame
boundary. After writing the value of the HcDoneHead register to the HCCA, the HC generates an interrupt request by
resetting the HcDoneHead register to 0 and setting the WDH bit of the HcInterruptStatus register to 1. In this way, the
transfer completed queue is transferred from the HC to the HCD via the HCCA. The HCD processes the Done queue
and provides completion information to the software that requested the transfer. While the WDH bit of the
HcInterruptStatus register is set, the HC does not write to the HCCA of the HcDoneHead register. In preparation for
receiving another transfer completed queue from the HC, the WDH bit of the HcInterruptStatus register is cleared (0)
by the HCD.
Figure 14-17 shows the transfer completed queue operation.