English
Language : 

EFM32WG Datasheet, PDF (309/834 Pages) List of Unclassifed Manufacturers – The EFM32WG Wonder Gecko is the ideal choice for demanding 8-, 16-, and 32-bit energy sensitive applications.
...the world's most energy friendly microcontrollers
• To transmit a few maximum-packet-size packets and a short packet at the end of the transfer:
• Transfer size[epnum] = n * mps[epnum] + sp
(where n is an integer >= 0, and 0 <= sp < mps[epnum])
• If (sp > 0), then packet count[epnum] = n + 1. Otherwise, packet count[epnum] = n
a. To transmit a single zero-length data packet:
• Transfer size[epnum] = 0
• Packet count[epnum] = 1
b. To transmit a few maximum-packet-size packets and a zero-length data packet at the end of the
transfer, the application must split the transfer in two parts. The first sends maximum-packet-size
data packets and the second sends the zero-length data packet alone.
c. First transfer: transfer size[epnum] = n * mps[epnum]; packet count = n;
d. Second transfer: transfer size[epnum] = 0; packet count = 1;
3. In DMA mode, the core fetches an IN data packet from the memory, always starting at a DWORD
boundary. If the maximum packet size of the IN endpoint is not a multiple of 4, the application must
arrange the data in the memory with pads inserted at the end of a maximum-packet-size packet so
that a new packet always starts on a DWORD boundary.
4. Once an endpoint is enabled for data transfers, the core updates the Transfer Size register. At the end
of IN transfer, which ended with a Endpoint Disabled interrupt, the application must read the Transfer
Size register to determine how much data posted in the transmit FIFO was already sent on the USB.
5. Data fetched into transmit FIFO = Application-programmed initial transfer size – core-updated final
transfer size
• Data transmitted on USB = (application-programmed initial packet count – Core updated final
packet count) * mps[epnum]
• Data yet to be transmitted on USB = (Application-programmed initial transfer size – data transmitted
on USB)
Internal Data Flow
1. The application must set the Transfer Size and Packet Count fields in the endpoint-specific registers
and enable the endpoint to transmit the data.
2. In Slave mode, the application must also write the required data to the transmit FIFO for the endpoint.
In DMA mode, the core fetches the data from memory according to the application setting for the
endpoint.
3. Every time a packet is written into the transmit FIFO, either by the core’s internal DMA (in DMA
mode) or the application (in Slave Mode), the transfer size for that endpoint is decremented by the
packet size. The data is fetched from the memory (DMA/Application), until the transfer size for the
endpoint becomes 0. After writing the data into the FIFO, the “number of packets in FIFO” count is
incremented (this is a 3-bit count, internally maintained by the core for each IN endpoint transmit
FIFO. The maximum number of packets maintained by the core at any time in an IN endpoint FIFO
is eight). For zero-length packets, a separate flag is set for each FIFO, without any data in the FIFO.
4. Once the data is written to the transmit FIFO, the core reads it out upon receiving an IN token. For
every non-isochronous IN data packet transmitted with an ACK handshake, the packet count for the
endpoint is decremented by one, until the packet count is zero. The packet count is not decremented
on a TIMEOUT.
5. For zero length packets (indicated by an internal zero length flag), the core sends out a zero-length
packet for the IN token and decrements the Packet Count field.
6. If there is no data in the FIFO for a received IN token and the packet count field for that endpoint is
zero, the core generates a IN Tkn Rcvd When FIFO Empty Interrupt for the endpoint, provided the
endpoint NAK bit is not set. The core responds with a NAK handshake for non-isochronous endpoints
on the USB.
7. For Control IN endpoint, if there is a TIMEOUT condition, the USB_DIEPx_INT.TIMEOUT interrupt
is generated.
8. When the transfer size is 0 and the packet count is 0, the transfer complete interrupt for the endpoint
is generated and the endpoint enable is cleared.
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
309
www.energymicro.com