English
Language : 

SAM4L Datasheet, PDF (341/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
17.6.2 USBC Device Mode Operation
17.6.2.1
Device Enabling
In device mode, the USBC supports full- and low-speed data transfers.
Including the default control endpoint, a total of 8 endpoints are provided. They can be config-
ured as isochronous, bulk or interrupt types, as described in Table 17-1 on page 334
After a hardware reset, the USBC device mode is in the reset state (see Section 17.6.1.1). In
this state, the endpoint banks are disabled and neither DP nor DM are pulled up (DETACH is
one).
DP or DM will be pulled up according to the selected speed as soon as the DETACH bit is writ-
ten to zero. See “Device mode” for further details.
When the USBC is enabled (USBE is one) in device mode, it enters the Idle state, minimizing
power consumption. Being in Idle state does not require the USB clocks to be activated.
The USBC device mode can be disabled or reset at any time by disabling the USBC (by writing
a zero to USBE) or by enabling host mode (ID is zero).
17.6.2.2
USB reset
The USB bus reset is initiated by a connected host and managed by hardware.
When a USB reset state is detected on the USB bus, the following operations are performed by
the controller:
• UDCON register is reset except for the DETACH and SPDCONF bits.
• Device Frame Number Register (UDFNUM), Endpoint n Configuration Register (UECFGn),
and Endpoint n Control Register (UECONn) registers are cleared.
• The data toggle sequencing in all the endpoints are cleared.
• At the end of the reset process, the End of Reset (EORST) bit in the UDINT register is set.
17.6.2.3
Endpoint activation
When an endpoint is disabled (UERST.EPENn = 0) the data toggle sequence, Endpoint n Status
Set (UESTAn), and UECONn registers will be reset. The controller ignores all transactions to
this endpoint as long as it is inactive.
To complete an endpoint activation, the user should fill out the endpoint descriptor: see Figure
17-6 on page 344.
17.6.2.4
Endpoint redirection
By default, the Redirected endpoint number (UECFGn.REPNB) field is zero, and any transaction
targeted to endpoint n will be associated to the physical endpoint n.
By configuring the UECFGn.REPNB field to a value m, any transaction targeted to this endpoint
m will be redirected to the physical endpoint n. This allows two virtual endpoints, IN and OUT, to
be configured towards the same endpoint number.
17.6.2.5
Data toggle sequence
In order to respond to a CLEAR_FEATURE USB request without disabling the endpoint, the
user can clear the data toggle sequence by writing a one to the Reset Data Toggle Set bit in the
Endpoint n Control Set register (UECONnSET.RSTDTS)
42023C–SAM–02/2013
341