Universal Serial Bus InterfaceMCF5253 Reference Manual, Rev. 1Freescale Semiconductor 24-145Case 2: Link list is not empty1. Add dTD to end of linked list.2. Read correct prime bit in ENDPTPRIME—if 1 DONE.3. Set ATDTW bit in USBCMD register to 1.4. Read correct status bit in ENDPTSTATUS. (store in tmp. variable for later)5. Read ATDTW bit in USBCMD register.If 0 goto 3.If 1 continue to 6.6. Write ATDTW bit in USBCMD register to '0'.7. If status bit read in (3) is '1' DONE.8. If status bit read in (3) is '0' then Goto Case 1: Step 1.24.11.5.4 Transfer CompletionAfter a dTD has been initialized and the associated endpoint primed the device controller will execute thetransfer upon the host-initiated request. The DCD will be notified with a USB interrupt if the Interrupt OnComplete bit was set or alternately, the DCD can poll the endpoint complete register to find when the dTDhad been executed. After a dTD has been executed, DCD can check the status bits to determine success orfailure.CAUTIONMultiple dTD can be completed in a single endpoint complete notification.After clearing the notification, DCD must search the dTD linked list andretire all dTDs that have finished (Active bit cleared).By reading the status fields of the completed dTDs, the DCD can determine if the transfers completedsuccessfully. Success is determined with the following combination of status bits:• Active = 0• Halted = 0• Transaction Error = 0• Data Buffer Error = 0Should any combination other than the one shown above exist, the DCD must take proper action. Transferfailure mechanisms are indicated in the Device Error Matrix.In addition to checking the status bit the DCD must read the Transfer Bytes field to determine the actualbytes transferred. When a transfer is complete, the Total Bytes transferred is by decremented by the actualbytes transferred. For Transmit packets, a packet is only complete after the actual bytes reaches zero, butfor receive packets, the host may send fewer bytes in the transfer according the USB variable length packetprotocol.