MC9S08JM16CGTE FREESCALE [Freescale Semiconductor, Inc], MC9S08JM16CGTE Datasheet - Page 322

no-image

MC9S08JM16CGTE

Manufacturer Part Number
MC9S08JM16CGTE
Description
Microcontrollers
Manufacturer
FREESCALE [Freescale Semiconductor, Inc]
Datasheet
Universal Serial Bus Device Controller (S08USBV1)
17.4.4.3
The USB includes a number of error checking and recovery mechanisms to ensure reliable data transfer.
One such exception occurs when the host sends a SETUP packet to a device, and the host never receives
the acknowledge handshake from the device. In this case, the host will retry the SETUP packet.
Endpoint 0 request handlers on the device must be aware of the possibility that after receiving a correct
SETUP packet, they could receive another SETUP packet before the data phase actually begins.
17.4.5
The USB host allocates time in 1.0 ms chunks called “Frames” for the purposes of packet scheduling. The
USB host starts each frame with a broadcast token called SOF (start of frame) that includes an 11-bit
sequence number. The TOKSOF interrupt is used to notify firmware when an SOF token was received.
Firmware can read the current frame number from the FRMNUML/FRMNUMH registers.
In general, the SOF interrupt is only monitored by devices using isochronous endpoints to help ensure that
the device and host remain synchronized.
322
2. Create BDT entries for Endpoint 0 OUT, and set the DTS and OWN bits to 1.
3. Wait for interrupt TOKDNE.
4. Read STAT register.
5. Read Endpoint 0 OUT BD.
6. Decode and process the setup packet.
7. After processing the data phase (if there was one), create a zero-byte status phase transaction.
— The status register must show Endpoint 0, RX. If it does not, then assert the EPSTALL bit in
— Verify that the token type is a SETUP token. If it is not, then assert the EPSTALL bit in the
— If the direction field in the setup packet indicates an OUT transfer, then process the out data
— If the direction field in the setup packet indicates an IN transfer, then process the in data phase
— This is accomplished for an OUT data phase (IN status phase) by setting the BC to 0 in the next
— Firmware can verify completion of the data phase by verifying the received token in the BD on
the endpoint control register.
endpoint control register.
phase to receive exactly the number of bytes specified in the wLength field of the setup packet.
to deliver no more than the number of bytes specified in the wLength field. Note that it is
common for the host to request more bytes than it needs, expecting the device to only send as
much as it needs to.
BD, while also setting OWN=1. For an IN data phase (OUT status phase), the host will send a
zero-byte packet to the device.
receipt of the TOKDNE interrupt. If the data phase was of type IN, then the status phase token
will be OUT. If the data phase was of type OUT, then the status phase token will be IN.
Start of Frame Processing
Endpoint 0 Exception Conditions
MC9S08JM16 Series Data Sheet, Rev. 2
Freescale Semiconductor

Related parts for MC9S08JM16CGTE