USB Endpoints

The mechanisms used for Universal Serial Bus (USB) communication are data buffers called endpoints. Endpoints exist on the device and are typically implemented in CPU registers or dual-port memory.

Endpoints are unidirectional, i.e. each endpoint is designed to transmit data in one direction. OUT endpoints send data out of the host to the device. IN endpoints take data from the device intended to go in to the host. Endpoints exist in numbered pairs and each pair contains an OUT and an IN endpoint.

Endpoint 0 (EP0IN and EP0OUT) are reserved in every device for control purposes. Control Endpoints are used during enumeration, providing the host the ability to read the device descriptor tables and to send control commands to the device during normal application execution.

A USB device can have up to 32 endpoints (16 OUT and 16 IN). Since EP0IN and EP0OUT are set aside as control endpoints, the maximum number of endpoints available to transmit application data is 30.

Software Considerations

Communication between the host and the device is asynchronous over USB. The device is not informed when a host-initiated transfer starts. A USB device must proactively check if a data packet has been received from the host. If the device were to read or write to an endpoint while a host transaction is accessing the endpoint, the result could corrupt the data.

Microchip’s USB software, combined with the dual-port implementation of the endpoints on PIC® MCUs, prevents the corruption of endpoint data. Microchip arbitrates between the host and the device, resulting in exclusive access to the endpoint memory.

 Learn More

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.