English
Language : 

EFM32WG Datasheet, PDF (317/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
6. For Periodic IN endpoints, the data must always be prefetched 1 frame ahead for transmission in the
next frame. This can be done, by enabling the Periodic IN endpoint 1 frame ahead of the frame in
which the data transfer is scheduled.
7. The complete data to be transmitted in the frame must be written into the transmit FIFO, before the
Periodic IN token is received. Even when 1 DWORD of the data to be transmitted per frame is missing
in the transmit FIFO when the Periodic IN token is received, the core behaves as when the FIFO was
empty. When the transmit FIFO is empty,
• A zero data length packet would be transmitted on the USB for ISOC IN endpoints
• A NAK handshake would be transmitted on the USB for INTR IN endpoints
• USB_DIEPx_TSIZ.PKTCNT is not decremented in this case.
8. For a High Bandwidth IN endpoint with three packets in a frame, the application can program the
endpoint FIFO size to be 2 * max_pkt_size and have the third packet load in after the first packet has
been transmitted on the USB.
Figure 15.30. Periodic IN Application Flow for Periodic Transfer Interrupt Feature
START
NOTE
Re quire m e nt s For Xfe rSize a nd Pkt Cnt progra m m ing
1 . Pa ck e t Size h a s t o b e of M a xPk t S( mizeicrf)orfar allm e s e xce p t f or la st
p a ck e t w h ich ca n b e a Sh or.t Pa ck e t
2. Short Packet s are not allow ed in bet w een Xfers
5.
Core w ill re a d pa cke t s from Syst e m M e m ory only from DW ORD a ligne d
a d d r e ss.e s
6 . If M a xPk t Size is n ot D W ORD, a liAgpnpeldica t ion m u st in se r t p a d s a t t h e
e n d of t h e p a ck e t so t h a t n e w p a ck e t is a lw a ys D. W ORD a lig n e d
7. Thresholding in not support ed for t he Periodic Transfer Int errupt
enhancem ent
· Intialize variables
·
Alloca t e a b u f f e r in t h e Syst e m M e m or y f or .m uBltuipf fle rXsfiezres sh ou ld b e m u lt ip le ot M. a xPk t Size
· Program t he DMA address
DIEPDMA= START Ad d r e ss of t h e D a t a M e m or y
· Program Xf_esr ize regist er
USB_DIEPx_TSIZ XFERSIZE = X f e r Size Sp a n n in g a cr oss m u lt ip le X f e r s
USB_DIEPx_TSIZ PKTCNT = Pr og r a m Pk t Cn t f or m u lt ip le X f e r s
USB_DIEPx_TSIZ.MC = M a x N u m b e r of Pa ck e(tms iicnr)oaf r a m e
· Program t he Global INT STS
USB_GINTMSK. INCOMPLSOCINMSK = 0b0 // M a sk In com p ISOCIN In t e r r u p t
· Program EP Ct rl regist er t o st art t he xfer
USB_DIEPx_CTL.CNAK = 0b1
USB_DIEPx_CTL.TXFNUM = t x_fifo_num;
USB_DIEPx_CTL.EPENA = 0b1
USB_DIEPx_CTL.SNAK = 0b0
USB_DIEPx_CTL.EPDIS = 0b0
W· ait for USB_DOEPX_INTXFERCOMPL int errupt& report error if t im eout expires
If USB_DIEPx_TSIZ
XFERSIZE ! = 0 or
USB_D IEPx _TSIZ
PKTCNT ! = 0
no
De- a llo c a t e Da t a Ra m Me m o ry
Yes
· Check for er_rosrcenario
· If no erro_r scenario set report error
return
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.
• The application must enable the USB_DCTL.IGNRFRMNUM
2. When an isochronous OUT endpoint is enabled by setting the Endpoint Enable and clearing the NAK
bits, the Even/Odd frame will be ignored by the core.
• Subsequently the core updates the Even / Odd bit on its own
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
317
www.energymicro.com