Chapter 4 Software Developmentpage 4-5Figure 4.1.2. Two USB TransactionsAll bus transactions begin with a token packet from the host. Devices never initiate data transfers ontheir own.The host controller is in charge of scheduling all traffic on the bus. It schedules the appropriatetransactions for the four data flow types at 1-ms intervals, which the USB documentation callsframes.Token packet types include data request (IN), data transfer notification (OUT), and commandtransfer notification (SETUP).4-1-6. PacketsA packet is a continuous bit stream starting with the synchronization pattern and flowing in onedirection.Table 4.1.3. lists the USB packet types.PID Type PID Name Transmitter DescriptionToken OUT Host Data transfer notificationIN Host Data requestSOF Host Start of frameSETUP Host Data transfer notification for control pipeData DATA0 Host/Device Data packet PID evenDATA1 Host/Device Data packet PID oddHandshake ACK Host/Device Receiver accepts error-free packetNAK Device Transmitter cannot send dataReceiver cannot accept dataSTALL Device Control pipe request not supportedEndpoint haltedSpecial PRE Host Preamble enabling downstream bus traffic to low-speed devices4-1-7. EndpointsThe USB provides separate logical communication flows, called pipes, between the host and a USBfunction. The function end of a pipe is called the endpoint. This endpoint must provide buffer space(FIFO) capable of holding at least one data packet (a.k.a. the maximum payload size).Endpoints and pipes are characterized, at creation, by the direction (from or to host) and by the dataflow type (control, bulk, interrupt, or isochronous). There are provisions for up to 16 pipes in eachdirection, for a total of 32 endpoints per function. The token packet that the host transmits to initiatea transaction specifies the endpoint buffer with the endpoint address made up of the device addressand the endpoint number.USB device controller capacity is expressed by the number of endpoints it has and such endpointspecifications as supported data flow types and endpoint buffer sizes. Examining these endpointspecifications thus reveals whether the USB device controller is suitable for the intended application.