Universal Serial Bus (USB)
Am186™CC/CH/CU Microcontrollers User’s Manual
18-29
software clears the ACT_REQ bit when it has filled the FIFO with information to go to the
host, and hardware sets the ACT_REQ bit after the information has safely made it to the
host.
The host can send a new command at any time, so the NEW_COMMAND bit provides a
somewhat less “polite” method for the hardware to inform the software of who “owns” the
FIFO. When a SETUP packet is detected (before it is written to the FIFO), the hardware
clears the ACT_REQ bit, and sets the NEW_COMMAND bit, to show that the hardware
“stole” ownership from the software.
Because the software could be busy trying to update the FIFO and/or the ACT_REQ,
EP_NOT_STALLED, or COMMAND_BUSY bits, the host locks out accesses to the FIFO
and these bits whenever NEW_COMMAND is set. Attempts by software to read or write
the FIFO, or to alter these bits, fail silently.
When a command is received that software must handle, it is stored in the FIFO and then
the ACT_REQ bit is set to indicate that the FIFO contains valid data.
18.5.10.1
Data Transfer Using the Control Endpoint
The control endpoint can transfer data, but there are several potential problems.
At the end of control read data transfers, it is impossible for the software to know whether
the host accepted the most recent data sent, or whether it sent the status stage before
accepting the data. For USB commands, it is not an error for the host to terminate a
command early. For example, it can ask to read descriptors, and enter the status phase
before it has finished reading all the descriptors. This is problematic for data transfers, and
the only real way around it is for the host to transmit information in the SETUP packet that
describes where in the data stream it wishes to start reading.
At the end of control write data transfers, it is impossible for the software to know whether
the device successfully completed the status phase, or whether a new setup packet aborted
the status phase. As with the control read problem, this problem can be alleviated by the
host sending information in the command packet about where in the data stream this write
should start.
18.5.10.2
Control Endpoint Interrupts
The ACT_REQ bit and the NEW_COMMAND bit are reflected in the UISTAT1 register as
the CNT_EP_ACT and CNT_EP_NEW bits. Software can mask off these interrupts in the
UIMASK1 register. Most applications use only the CNT_EP_ACT interrupt, but some
applications may find it advantageous to use the CNT_EP_NEW interrupt. This interrupt is
useful if the system spawns a new task to deal with data transactions. In this case, the
software could use a CNT_EP_NEW interrupt to spawn the task dealing with the aborted
command.
18.5.11
Interrupt Endpoint Programming
The microcontroller's USB interface contains one interrupt endpoint. The purpose of an
interrupt endpoint is to allow small amounts of data to be transferred from the device to the
host. According to section 4.7.3 of the USB Specification, “A small, spontaneous data
transfer from a device is referred to as interrupt data. Such data can be presented for transfer
by a device at any time, and is delivered by the USB at a rate no slower than as is specified
by the device. Interrupt data typically consists of event notification, characters, or
coordinates that are organized as one or more bytes. An example of interrupt data is the
coordinates from a pointing device. Although an explicit timing rate is not required,
interactive data may have response time bounds that the USB must support.”
Содержание Am186 CC
Страница 1: ...Am186 CC CH CU Microcontrollers User s Manual Order 21914B...
Страница 4: ...iv Am186 CC CH CU Microcontrollers User s Manual...
Страница 18: ...Table of Contents xviii Am186 CC CH CU Microcontrollers User s Manual...
Страница 24: ...Introduction xxiv Am186 CC CH CU Microcontrollers User s Manual...
Страница 39: ...Architectural Overview Am186 CC CH CU Microcontrollers User s Manual 1 15 Figure 1 6 32 Channel Linecard CH CC...
Страница 40: ...Architectural Overview 1 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 86: ...System Overview 3 36 Am186 CC CH CU Microcontrollers User s Manual...
Страница 92: ...Emulator Support 4 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 112: ...DRAM Controller 6 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 134: ...Interrupts 7 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 186: ...Programmable I O Signals 9 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 200: ...Watchdog Timer 11 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 232: ...Asynchronous Serial Ports UARTs 13 24 Am186 CC CH CU Microcontrollers User s Manual...
Страница 242: ...Synchronous Serial Port SSI 14 10 Am186 CC CH CU Microcontrollers User s Manual...
Страница 264: ...High Level Data Link Control HDLC 15 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 332: ...Universal Serial Bus USB 18 34 Am186 CC CH CU Microcontrollers User s Manual...
Страница 348: ...Register Summary A 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 376: ...Index Index 18 Am186 CC CH CU Microcontrollers User s Manual...