User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 310
www.energymicro.com
Figure 15.26. USBTRDTIM Max Timing Case ERROR wrong image
Host ApplicationDeviceUSB
I
N
N
A
K
INTKNTXFEMP
INTR
I
N
512 bytes
A
C
K
do_in_xfer
xact_ 1 data rdy
xact_ 2 data rdy
I
N
xact_1 of 2
xact_2 of 2
NPTXFEMP INT
S
T
A
L
L
512 bytes
A
C
K
new xact
EPDisabled intr
I
N
S
T
A
L
L
idle(wait_intr)
setup_ np_in_ pkt
set_stall
ep_ disable;
flush_ nper_tx_ fifo;
Clr Global IN NP Nak
wait_for_host/
app to clr stall
clr_stall
do_in_ xfer
setup_ np_in_ pkt
1
2
3
4
5
XferSize = 1025 bytes
PktCnt = 3
EPEna = 1
I
N
N
A
K
I
N
INTKNTXFEMP
INTR
15.4.4.2.3.10 Handling Babble Conditions
If receives a packet that is larger than the maximum packet size for that endpoint, the core stops writing
data to the Rx buffer and waits for the end of packet (EOP). When the core detects the EOP, it flushes
the packet in the Rx buffer and does not send any response to the host.
If the core continues to receive data at the EOF2 (the end of frame 2, which is very close to SOF), the
core generates an early_suspend interrupt (USB_GINTSTS.ERLYSUSP). On receiving this interrupt,
the application must check the erratic_error status bit (USB_DSTS.ERRTICERR). If this bit is set, the
application must take it as a long babble and perform a soft reset.
15.4.4.2.3.11 Generic Non-Periodic (Bulk and Control) IN Data Transfers in DMA and Slave Mode
To initialize the core after power-on reset, the application must follow the sequence in Overview:
Programming the Core (p. 248) . Before it can communicate with the host, it must initialize an endpoint
as described in Endpoint Initialization (p. 283) . For packet writes in Slave mode, see: Packet Write
in Slave Mode (p. 305) .
Application Requirements
1. Before setting up an IN transfer, the application must ensure that all data to be transmitted as part of
the IN transfer is part of a single buffer, and must program the size of that buffer and its start address
(in DMA mode) to the endpoint-specific registers.
2. For IN transfers, the Transfer Size field in the Endpoint Transfer Size register denotes a payload
that constitutes multiple maximum-packet-size packets and a single short packet. This short packet
is transmitted at the end of the transfer.