User manual
...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 314
www.energymicro.com
Figure 15.28. Slave Mode Bulk IN Transfer (Pipelined Transaction)
xact_2
Host ApplicationDevice
USB
I
N
A
C
K
A
C
K
I
N
1 byte
A
C
K
xact_
1 of
3
xact_2
of
3
xact_3
of
3
wr_reg(xfer_ size_reg)
N
A
K
I
N
I
N
512 bytes
512 bytes
1
2
3
4
6
7
8
9
10
2
11
12
13
14
idle until intr
setup_ np_in_pkt
setup_ np_in_pkt
setup_ np_in_pkt
IN Token = 0
Timeout =0
ACK = 0
XferCom pl = 1
xact_2
xact_3
xact_1
xfer_ cnt = 1025 bytes
pkt_ cnt = 3
EP Enable = 1
idle until intr
5
N
P
T
X
F
E
M
P
I
N
T
R
INTKNTXFEMP
INTR
XFERCOMPL
INTR
Slave Mode Bulk IN Two-Endpoint Transfer
These notes refer to Figure 15.29 (p. 315)
1. The host attempts to read data (IN token) from endpoint 1.
2. On receiving the IN token on the USB, the core returns a NAK handshake, because no data is available
in the transmit FIFO for endpoint 1, and generates a USB_DIEP1_INT.INTKNTXFEMP (In Token
Received When TxFIFO Empty) interrupt.
3. The application processes the interrupt and initializes USB_DIEP1_TSIZ register with the Transfer
Size and Packet Count fields. The application starts writing the transaction data to the transmit FIFO.
4. The application writes one maximum packet size or less of data for endpoint 1 to the Non-periodic
TxFIFO.
5. Meanwhile, the host attempts to read data (IN token) from endpoint 2.
6. On receiving the IN token on the USB, the core returns a NAK handshake, because no data is available
in the transmit FIFO for endpoint 2, and the core generates a USB_DIEP2_INT.INTKNTXFEMP (In
Token Received When TxFIFO Empty) interrupt.
7. Because the application has completed writing the packet for endpoint 1, it initializes the
USB_DIEP2_TSIZ register with the Transfer Size and Packet Count fields. The application starts
writing the transaction data into the transmit FIFO for endpoint 2.
8. The host repeats its attempt to read data (IN token) from endpoint 1.
9. Because data is now ready in the TxFIFO, the core returns the data, which the host ACKs.
10.Meanwhile, the application has initialized the data for the next two packets in the TxFIFO (ep2.xact1
and ep1.xact2, in order).
11.The host repeats its attempt to read data (IN token) from endpoint 2.
12.Because endpoint 2’s data is ready, the core responds with the data (ep2.xact_1), which the host
ACKs.