Atmel Evaluation Kit for AT32uC3A0512, 32-Bit AVR Microcontroller Atmel ATEVK1105 ATEVK1105 Data Sheet

Product codes
ATEVK1105
Page of 826
519
AT32UC3A
Figure 30-20.
Example of an OUT Endpoint with 1 Data Bank
Figure 30-21.
Example of an OUT Endpoint with 2 Data Banks
30.7.2.13.2
Detailed Description
The data is read by the firmware, following the next flow:
•when the bank is full, RXOUTI and FIFOCON are set, what triggers an EPXINT interrupt if
RXOUTE = 1;
•the firmware acknowledges the interrupt by clearing RXOUTI;
•the firmware can read the byte count of the current bank from BYCT to know how many bytes
to read, rather than polling RWALL;
•the firmware reads the data from the current bank by using the USB Pipe/Endpoint X FIFO
Data register (USB_FIFOX_DATA), until all the expected data frame is read or the bank is
empty (in which case RWALL is cleared by hardware and BYCT reaches 0);
•the firmware frees the bank and switches to the next bank (if any) by clearing FIFOCON.
If the endpoint uses several banks, the current one can be read by the firmware while the follow-
ing one is being written by the host. Then, when the firmware clears FIFOCON, the following
bank may already be ready and RXOUTI is set immediately.
30.7.2.14
Underflow
This error exists only for isochronous IN/OUT endpoints. It raises the Underflow interrupt
(UNDERFI), what triggers an EPXINT interrupt if UNDERFE = 1.
An underflow can occur during IN stage if the host attempts to read from an empty bank. A zero-
length packet is then automatically sent by the USB controller.
OUT
DATA
(bank 0)
ACK
RXOUTI
FIFOCON
HW
OUT
DATA
(bank 0)
ACK
HW
SW
SW
SW
read data from CPU
BANK 0
read data from CPU
BANK 0
NAK
OUT
DATA
(bank 0)
ACK
RXOUTI
FIFOCON
HW
OUT
DATA
(bank 1)
ACK
SW
SW
read data from CPU
BANK 0
HW
SW
read data from CPU
BANK 1
32058K
AVR32-01/12