Datasheet

108
4341H–MP3–10/07
AT8xC51SND2C/MP3B
An endpoint which is not enabled won’t answer to any USB request. The Default Control
Endpoint (Endpoint 0) should always be enabled in order to answer to USB standard
requests.
Endpoint type configuration
All Standard Endpoints can be configured in Control, Bulk, Interrupt or Isochronous mode.
The Ping-pong Endpoints can be configured in Bulk, Interrupt or Isochronous mode. The
configuration of an endpoint is performed by setting the field EPTYPE with the following
values:
Control: EPTYPE = 00b
Isochronous:EPTYPE = 01b
Bulk: EPTYPE = 10b
Interrupt: EPTYPE = 11b
The Endpoint 0 is the Default Control Endpoint and should always be configured in Control
type.
Endpoint direction configuration
For Bulk, Interrupt and Isochronous endpoints, the direction is defined with the EPDIR bit of
the UEPCONX register with the following values:
IN: EPDIR = 1b
OUT: EPDIR = 0b
For Control endpoints, the EPDIR bit has no effect.
Summary of Endpoint Configuration:
Do not forget to select the correct endpoint number in the UEPNUM register before access-
ing endpoint specific registers.
Table 16-1. Summary of Endpoint Configuration
Endpoint FIFO reset
Before using an endpoint, its FIFO should be reset. This action resets the FIFO pointer to its
original value, resets the Byte counter of the endpoint (UBYCTX register), and resets the
data toggle bit (DTGL bit in UEPCONX).
The reset of an endpoint FIFO is performed by setting to 1 and resetting to 0 the corre-
sponding bit in the UEPRST register.
For example, in order to reset the Endpoint number 2 FIFO, write 0000 0100b then 0000
0000b in the UEPRST register.
Note that the endpoint reset doesn’t reset the bank number for ping-pong endpoints.
Endpoint Configuration EPEN EPDIR EPTYPE UEPCONX
Disabled 0b Xb XXb 0XXX XXXb
Control 1b Xb 00b 80h
Bulk-in 1b 1b 10b 86h
Bulk-out 1b 0b 10b 82h
Interrupt-In 1b 1b 11b 87h
Interrupt-Out 1b 0b 11b 83h
Isochronous-In 1b 1b 01b 85h
Isochronous-Out 1b 0b 01b 81h