English
Language : 

SAM4L Datasheet, PDF (355/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
Figure 17-15. USB Communication Flow
ATSAM4L4/L2
17.6.3.4
17.6.3.5
17.6.3.6
In host mode, the USBC associates a pipe to a device endpoint, according to the device config-
uration descriptors.
USB reset
The USBC sends a USB reset signal when the user writes a one to the Send USB Reset bit
(UHCON.RESET). When the USB reset has been sent, the USB Reset Sent Interrupt bit in the
Host Global Interrupt register (UHINT.RSTI) is set and all the pipes will be disabled.
If the bus was previously in a suspended state (UHCON.SOFE is zero) the USBC will switch it to
the Resume state, causing the bus to asynchronously trigger the Host Wakeup Interrupt
(UHINT.HWUPI). The SOFE bit will be set in order to generate SOF’s immediately after the USB
reset.
Pipe activation
A disabled pipe is inactive, and will be reset along with its context registers (UPCONn, UPSTAn,
UPINRQn, and UPCFGn). Enabling a pipe is done by writing a one to the Pipe n Enable bit in
the Pipe Enable/Reset Register (UPRST.PENn).
When starting an enumeration, the user gets the device descriptor by sending an
GET_DESCRIPTOR USB request. This descriptor contains the maximal packet size of the
device default control endpoint (bMaxPacketSize0) which the user should use to reconfigure the
size of the default control pipe.
Address setup
Once the device has answered the first host requests with the default device address 0, the host
assigns a new address to the device. The host controller has to send a USB reset to the device
and a SET_ADDRESS(addr) SETUP request with the new address to be used by the device.
Once this SETUP transaction is over, the user writes to the device address field in the “control
and status 1 of endpoint n” word of the host’s pipe n in the USB descriptor
(Pn_CTR_STA1.PDADDR). All following requests by this pipe will be performed using this new
address.
42023C–SAM–02/2013
355