Universal Serial Bus (USB)
18-26
Am186™CC/CH/CU Microcontrollers User’s Manual
The specified number of bytes is transferred on each sample clock as long as data is
present in the endpoint’s FIFO, or is sequentially written to the FIFO as needed during
the transaction.
■
Start of Frame and Frame Number Monitoring: The USB peripheral controller
monitors the USB SOF packet and latches the frame number value into the Time Stamp
(TSTMP) register upon successfully receiving the SOF packet from the USB host.
Software can arm the Time Stamp Match (TSTMPM) register by writing a specific USB
frame number to it. Then, when the USB peripheral controller receives an SOF packet
with a number greater or equal to the written value, hardware sets the UISTAT2 register’s
TSTMP_M bit, which software can enable as an interrupt by setting the corresponding
bit in UIMASK2. The interrupt does not occur again until TSTMP_M is cleared in UISTAT2
and TSTMPM is written again.
This mechanism allows software to start a certain data pattern during a specific USB
frame, if required. This feature can be used for asynchronous USB data sources using
implicit data pattern generation.
18.5.9
Command Handling
The primary function of the device’s control endpoint is to accept and respond to commands
issued to it by the USB host. All of the USB standard, device class, and vendor specific
commands are issued to the control endpoint known as the device endpoint 0. The USB
peripheral controller hardware handles some of these commands without requiring that the
device software decode and specifically “handle” the command. Other commands are
received from the USB host and passed on to the device software for processing. These
commands and how they are handled are outlined in the following sections.
18.5.9.1
Commands Handled by Device Software
Table 18-5 on page 18-27 describes the commands that must be handled by the device
software.
When any command is received by the USB peripheral controller, hardware sets the
NEW_COMMAND bit in the CNTCTL register. If the device software must take some action,
the ACT_REQ bit is also set in the affected endpoint’s xEPCTL register.
The NEW_COMMAND bit and all of the ACT_REQ bits have mirror bits in the UISTAT1
register. (A mirror bit is set whenever the corresponding status bit is set.) Each mirror bit
can be enabled as an interrupt source by setting the corresponding bit in the UIMASK1
register.
The software is then required to decode the command data and either:
■
Accept subsequent data associated with the command (for OUT commands). When it
is finished handling an OUT command, software must clear the COMMAND_BUSY bit
in the CNTCTL register to indicate that it is ready to process more commands.
■
Return the appropriate data requested in the command (for IN commands). The USB
peripheral controller hardware automatically clears the COMMAND_BUSY bit in the
CNTCTL register when it finishes transmitting the requested data.
All of the low-level USB protocol processing is handled entirely in hardware (that is, all
handshake packets are accepted from or returned to the USB host automatically).
Summary of Contents for Am186 CC
Page 1: ...Am186 CC CH CU Microcontrollers User s Manual Order 21914B...
Page 4: ...iv Am186 CC CH CU Microcontrollers User s Manual...
Page 18: ...Table of Contents xviii Am186 CC CH CU Microcontrollers User s Manual...
Page 24: ...Introduction xxiv Am186 CC CH CU Microcontrollers User s Manual...
Page 40: ...Architectural Overview 1 16 Am186 CC CH CU Microcontrollers User s Manual...
Page 86: ...System Overview 3 36 Am186 CC CH CU Microcontrollers User s Manual...
Page 92: ...Emulator Support 4 6 Am186 CC CH CU Microcontrollers User s Manual...
Page 112: ...DRAM Controller 6 8 Am186 CC CH CU Microcontrollers User s Manual...
Page 134: ...Interrupts 7 22 Am186 CC CH CU Microcontrollers User s Manual...
Page 186: ...Programmable I O Signals 9 8 Am186 CC CH CU Microcontrollers User s Manual...
Page 200: ...Watchdog Timer 11 6 Am186 CC CH CU Microcontrollers User s Manual...
Page 232: ...Asynchronous Serial Ports UARTs 13 24 Am186 CC CH CU Microcontrollers User s Manual...
Page 242: ...Synchronous Serial Port SSI 14 10 Am186 CC CH CU Microcontrollers User s Manual...
Page 264: ...High Level Data Link Control HDLC 15 22 Am186 CC CH CU Microcontrollers User s Manual...
Page 332: ...Universal Serial Bus USB 18 34 Am186 CC CH CU Microcontrollers User s Manual...
Page 348: ...Register Summary A 16 Am186 CC CH CU Microcontrollers User s Manual...
Page 376: ...Index Index 18 Am186 CC CH CU Microcontrollers User s Manual...