Datasheet
252
7593L–AVR–09/12
AT90USB64/128
22.6.2 Host mode
When the USB interface is configured in host mode, internal Pull Down resistors are activated on
both UDP UDM lines and the interface detects the type of connected device.
22.7 Memory management
The controller does only support the following memory allocation management.
The reservation of a Pipe or an Endpoint can only be made in the increasing order (Pipe/End-
point 0 to the last Pipe/Endpoint). The firmware shall thus configure them in the same order.
The reservation of a Pipe or an Endpoint “k
i
” is done when its ALLOC bit is set. Then, the hard-
ware allocates the memory and inserts it between the Pipe/Endpoints “k
i-1
” and “k
i+1
”. The “k
i+1
”
Pipe/Endpoint memory “slides” up and its data is lost. Note that the “k
i+2
” and upper Pipe/End-
point memory does not slide.
Clearing a Pipe enable (PEN) or an Endpoint enable (EPEN) does not clear either its ALLOC bit,
or its configuration (EPSIZE/PSIZE, EPBK/PBK). To free its memory, the firmware should clear
ALLOC. Then, the “k
i+1
” Pipe/Endpoint memory automatically “slides” down. Note that the “k
i+2
”
and upper Pipe/Endpoint memory does not slide.
The following figure illustrates the allocation and reorganization of the USB memory in a typical
example:
Table 22-1. Allocation and reorganization USB memory flow.
• First, Pipe/Endpoint 0 to Pipe/Endpoint 5 are configured, in the grow ing order. The memory
of each is reserved in the DPRAM
• Then, the Pipe/Endpoint 3 is disabled (EPEN=0), but its memory reservation is internally kept
by the controller
• Its ALLOC bit is cleared: the Pipe/Endpoint 4 “slides” down, but the Pipe/Endpoint 5 does not
“slide”
• Finally, if the firmware chooses to reconfigure the Pipe/Endpoint 3, with a bigger size. The
controller reserved the memory after the endpoint 2 memory and automatically “slide” the
Pipe/Endpoint 4. The Pipe/Endpoint 5 does not move and a memory conflict appear, in that
Free memory
0
1
2
3
4
5
EPEN=1
ALLOC=1
Free memory
0
1
2
4
5
EPEN=0
(ALLOC=1)
Free memory
0
1
2
4
5
Pipe/Endpoints
activation
Pipe/Endpoint
Disable
Free its memory
(ALLOC=0)
Free memory
0
1
2
3 (bigger size)
5
Pipe/Endpoint
Activatation
Lost memory
4
Conflict