Datasheet
123
4337K–USB–04/08
AT89C5130A/31A-M
• Set configuration
The CONFG bit in the USBCON register has to be set after a SET_CONFIGURATION
request with a non-zero value. Otherwise, this bit has to be cleared.
21.2.2 Endpoint Configuration
• Selection of an Endpoint
The endpoint register access is performed using the UEPNUM register. The registers
– UEPSTAX
– UEPCONX
– UEPDATX
– UBYCTLX
– UBYCTHX
These registers correspond to the endpoint whose number is stored in the UEPNUM regis-
ter. To select an Endpoint, the firmware has to write the endpoint number in the UEPNUM
register.
Figure 21-5. Endpoint Selection
• Endpoint enable
Before using an endpoint, this one will be enabled by setting the EPEN bit in the UEPCONX
register.
An endpoint which is not enabled won’t answer to any USB request. The Default Control
Endpoint (Endpoint 0) will 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
UEPNUM
Endpoint 0
Endpoint 6
UEPSTA0 UEPCON0 UEPDAT0
UEPSTA6 UEPCON6 UEPDAT6
0
1
2
3
4
5
6
SFR registers
UEPSTAX UEPCONX UEPDATX
X
UBYCTH0 UBYCTL0
UBYCTH6 UBYCTL6
UBYCTHX UBYCTLX