Datasheet

1999-2013 Microchip Technology Inc. Preliminary DS41124D-page 67
PIC16C745/765
10.5.1.9 Endpoint Registers
Each endpoint is controlled by an Endpoint Control
Register. The PIC16C745/765 supports Buffer
Descriptors (BD) for the following endpoints:
- EP0 Out
- EP0 In
- EP1 Out
- EP1 In
- EP2 Out
- EP2 In
The user will be required to disable unused Endpoints
and directions using the Endpoint Control Registers.
10.5.1.10 USB Endpoint Control Register (EPCn)
The Endpoint Control Register contains the endpoint
control bits for each of the 6 endpoints available on
USB for a decoded address. These four bits define the
control necessary for any one endpoint. Endpoint 0
(ENDP0) is associated with control pipe 0 which is
required by USB for all functions (IN, OUT, and
SETUP). Therefore, after a USB_RST interrupt has
been received, the microprocessor should set UEP0 to
contain 06h.
REGISTER 10-9: USB ENDPOINT CONTROL REGISTER (UEPn: 198H-19Ah)
Note: These registers are initialized in response
to a RESET from the host. The user
must modify function USBReset in
USB_CH9.ASM to configure the endpoints
as needed for the application.
U-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
EP_CTL_DIS EP_OUT_EN EP_IN_EN EP_STALL
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as ‘0’
-n = Value at POR reset
bit7 bit0
bit 7-4: Unimplemented: Read as ’0’
bit 3-1: EP_CTL_DIS, EP_OUT_EN, EP_IN_EN: These three bits define if an endpoint is enabled and the direc-
tion of the endpoint. The endpoint enable/direction control is defined as follows:
bit 0: EP_STALL: When this bit is set it indicates that the endpoint is stalled. This bit has priority over all other
control bits in the Endpoint Enable register, but is only valid if EP_IN_EN=1 or EP_OUT_EN=1. Any access
to this endpoint will cause the USB to return a STALL handshake. The EP_STALL bit can be set or cleared
by the SIE. Refer to the USB 1.1 Specification, Sections 4.4.4 and 8.5.2 for more details on the STALL
protocol.
EP_CTL_DIS EP_OUT_EN EP_IN_EN Endpoint Enable/Direction Control
X 0 0 Disable Endpoint
X 0 1 Enable Endpoint for IN tokens only
X 1 0 Enable Endpoint for OUT tokens only
1 1 1 Enable Endpoint for IN and OUT tokens
0 1 1 Enable Endpoint for IN, OUT, and SETUP tokens