Universal Serial Bus (USB)
Am186™CC/CH/CU Microcontrollers User’s Manual
18-11
18.5.1.2
Programming the Control Endpoint
The host uses the USB peripheral controller’s dedicated control endpoint for detection and
control of the device. The endpoint contains an 8-byte FIFO for storage of commands,
command data (for host command writes), and responses (for host command reads). The
maximum packet size of the control endpoint is always eight bytes, the physical size of the
FIFO.
The control endpoint’s number is fixed at 0. All USB devices must have a control endpoint
with endpoint number 0. The USB host uses this endpoint to initialize and control the device.
Endpoint 0 gives the host access to the device’s configuration information (device
descriptors) and overall status. All of the USB standard and vendor- or device-class-specific
commands are directed to this endpoint. See “Command Handling” on page 18-26.
The following registers configure the control endpoint:
■
Control Endpoint Definition 1 (CNTDEF1):
All fields in this register are read only. They can be read to determine endpoint attributes.
■
Control Endpoint Definition 2 (CNTDEF2):
All fields in this register are read only. They can be read to determine endpoint attributes.
■
Control Endpoint Control/Status (CNTCTL):
– The endpoint enable bit (EP_EN) enables or disables the endpoint.
Device software can enable the endpoint in the stalled state by clearing the
EP_NOT_STALLED bit while the EP_EN bit is being set. The hardware, however, sets
the EP_NOT_STALLED bit upon reception of a SETUP packet from the host.
– Device software can be interrupted by two sources: the ACT_REQ bit or the
NEW_COMMAND bit. To enable these bits as interrupt sources, set the CNT_EP_ACT
and CNT_EP_NEW bits in the USB Interrupt Mask 1 (UIMASK1) register.
On reset, hardware owns the FIFO (indicated by the cleared ACT_REQ bit). After
hardware fills the FIFO, it sets the ACT_REQ bit to transfer ownership of the FIFO to
software. The first time software owns the FIFO, it clears the NEW_COMMAND bit
and proceeds with writing data to or reading data from the FIFO. Software can use
the Control Endpoint Receive Packet Size (CNTSIZ) register to determine the number
of valid data bytes present in the endpoint FIFO. After software has completed its
tasks, it hands the FIFO back to the hardware by clearing the ACT_REQ bit. At the
end of data (the last time software puts data in the FIFO), software also clears the
COMMAND_BUSY bit. Hardware then sets the ACT_REQ bit once for the last packet,
and then again for the end of command. For more information, see the
Am186™CC/
CH/CU Microcontrollers Register Set Manual, order #21916.
18.5.1.3
Programming the Interrupt Endpoint
Because USB is polled, this is not an interrupt in the traditional sense. When the device
wishes to interrupt the host, it returns data when the interrupt endpoint is polled. The USB
peripheral controller’s dedicated interrupt endpoint contains a 16-byte FIFO, which software
loads with the data to return on the next poll from the host. The maximum packet size can
be set to eight or 16 bytes. For more information, see “Interrupt Endpoint Programming” on
page 18-29.
Содержание 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...