Datasheet
The endpoint reset may be associated with a clear of the data toggle sequence as an answer to the
CLEAR_FEA
TURE USB request. This can be achieved by writing a one to the Reset Data Toggle Set bit (RSTDTS)
in the Device Endpoint x Control Set register (this sets the Reset Data Toggle bit USBHS_DEVEPTIMRx.RSTDT).
In the end, the user has to write a zero to the USBHS_DEVEPT.EPRSTx bit to complete the reset operation and to
start using the FIFO.
39.5.2.5 Endpoint Activation
The endpoint is maintained inactive and reset (see "Endpoint Reset" for more information) as long as it is disabled
(USBHS_DEVEPT.EPENx = 0). USBHS_DEVEPTISRx.DTSEQ is also reset.
The algorithm represented in the following figure must be followed to activate an endpoint.
Figure 39-8. Endpoint Activation Algorithm
Endpoint
Activation
USBHS_HSTPIPISRx.CFCFGOK == 1?
ERROR
Yes
Endpoint
Activated
Enable the endpoint.
USBHS_DEVEPT.EPENx = 1
Test if the endpoint configuration is correct.
USBHS_DEVEPTCFGx
.EPTYPE
.EPDIR
.EPSIZE
.EPBK
.ALLOC
Configure the endpoint:
-
type
- direction
- size
- number of banks
Allocate the configured DPRAM banks.
No
As long as the endpoint is not correctly configured (USBHS_HSTPIPISRx.CFGOK = 0), the controller does not
acknowledge the packets sent by the host to this endpoint.
The USBHS_HSTPIPISRx.CFGOK bit is set provided that the configured size and number of banks are correct as
compared to the endpoint maximal allowed values (see the Description of USB Pipes/Endpoints table) and to the
maximal FIFO size (i.e., the DPRAM size).
See "DPRAM Management"
for additional information.
39.5.2.6 Address Setup
The USB device address is set up according to the USB protocol.
• After all kinds of resets, the USB device address is 0.
• The host starts a SETUP transaction with a SET_ADDRESS (addr) request.
• The user writes this address to the USB Address (USBHS_DEVCTRL.UADD) field, and writes a zero to the
Address Enable (USBHS_DEVCTRL.ADDEN) bit, so the actual address is still 0.
• The user sends a zero-length IN packet from the control endpoint.
• The user enables the recorded USB device address by writing a one to USBHS_DEVCTRL.ADDEN.
Once the USB device address is configured, the controller filters the packets to accept only those targeting the
address stored in USBHS_DEVCTRL.UADD.
USBHS_DEVCTRL.UADD and USBHS_DEVCTRL.ADDEN must not be written all at once.
USBHS_DEVCTRL.UADD and USBHS_DEVCTRL.ADDEN are cleared:
• on a hardware reset,
• when the USBHS is disabled (USBHS_CTRL.USBE = 0),
• when a USB reset is detected.
When USBHS_DEVCTRL.UADD or USBHS_DEVCTRL.ADDEN is cleared, the default device address 0 is used.
SAM E70/S70/V70/V71 Family
USB High-Speed Interface (USBHS)
© 2019 Microchip T
echnology Inc.
Datasheet
DS60001527D-page 759










