English
Language : 

MC9S08JM16 Datasheet, PDF (320/386 Pages) Freescale Semiconductor, Inc – Microcontrollers
Universal Serial Bus Device Controller (S08USBV1)
= USB Host
USB RST
= Function
SOF
USBRST
Interrupt Generated
SETUP TOKEN
IN TOKEN
SOF
Interrupt Generated
DATA
ACK
DATA
ACK
TOKDNE
Interrupt Generated
TOKDNE
Interrupt Generated
OUT TOKEN
DATA
ACK
TOKDNE
Interrupt Generated
Figure 17-20. USB Packet Flow
The USB has two sources of data overrun error:
• The memory latency to the local USB RAM interface may be too high and cause the receive buffer
to overflow. This is predominantly a hardware performance issue, usually caused by transient
memory access issues.
• The packet received may be larger than the negotiated MAXPACKET size. This is caused by a
software bug.
In the first case, the USB will respond with a NAK or bus timeout (BTO) as appropriate for the class of
transaction. The BTOERR bit will be set in the ERRSTAT register. Depending on the values of the
INTENB and ERRENB register, USB module may assert an interrupt to notify the CPU of the error. In
device mode the BDT is not written back nor is the TOKDNE interrupt triggered because it is assumed
that a second attempt will be queued at future time and will succeed.
In the second case of oversized data packets, the USB specification assumes correct software drivers on
both sides. The overrun is not due to memory latency but to a lack of space to put the excess data. NAK'ing
the packet will likely cause another retransmission of the already oversized packet data. In response to
oversized packets, the USB module will still ACK the packet for non-isochronous transfers. The data
written to memory is clipped to the MAXPACKET size so as not to corrupt the buffer space. The USB
module will assert the BUFERRF bit of the ERRSTAT register (which could trigger an interrupt, as above)
and a TOKDNE interrupt fails. The BDTKPID field of the BDT will not be “1111” because the BUFERRF
is not due to latency. The packet length field written back to the BDT will be the MAXPACKET value to
represent the length of the clipped data actually written to memory. From here the software can decide an
MC9S08JM16 Series Data Sheet, Rev. 2
320
Freescale Semiconductor