User`s guide

CY7C65113C
Document #: 38-08002 Rev. *G Page 26 of 48
USB Overview
The USB hardware includes a USB Hub repeater with one
upstream and up to seven downstream ports. The USB Hub
repeater interfaces to the microcontroller through a full-speed
serial interface engine (SIE). An external series resistor of R
ext
must be placed in series with all upstream and downstream USB
outputs in order to meet the USB driver requirements of the USB
specification. The CY7C65113C microcontroller can provide the
functionality of a compound device consisting of a USB hub and
permanently attached functions.
USB Serial Interface Engine (SIE)
The SIE allows the CY7C65113C microcontroller to commu-
nicate with the USB host through the USB repeater portion of the
hub. The SIE simplifies the interface between the microcontroller
and USB by incorporating hardware that handles the following
USB bus activity independently of the microcontroller:
Bit stuffing/unstuffing
Checksum generation/checking
ACK/NAK/STALL
Token type identification
Address checking.
Firmware is required to handle the following USB interface tasks:
Coordinate enumeration by responding to SETUP packets
Fill and empty the FIFOs
Suspend/Resume coordination
Verify and select DATA toggle values.
USB Enumeration
The internal hub and any compound device function are
enumerated under firmware control. The hub is enumerated first,
followed by any integrated compound function. After the hub is
enumerated, the USB host can read hub connection status to
determine which (if any) of the downstream ports need to be
enumerated. The following is a brief summary of the typical
enumeration process of the CY7C65113C by the USB host. For
a detailed description of the enumeration process, refer to the
USB specification.
In this description, ‘Firmware’ refers to embedded firmware in the
CY7C65113C controller.
1. The host computer sends a SETUP packet followed by a
DATA packet to USB address 0 requesting the Device de-
scriptor.
2. Firmware decodes the request and retrieves its Device
descriptor from the program memory tables.
3. The host computer performs a control read sequence and
Firmware responds by sending the Device descriptor over the
USB bus, via the on-chip FIFOs.
4. After receiving the descriptor, the host sends a SETUP packet
followed by a DATA packet to address 0 assigning a new USB
address to the device.
5. Firmware stores the new address in its USB Device Address
Register (for example, as Address B) after the no-data control
sequence completes.
6. The host sends a request for the Device descriptor using the
new USB address.
7. Firmware decodes the request and retrieves the Device
descriptor from program memory tables.
8. The host performs a control read sequence and Firmware
responds by sending its Device descriptor over the USB bus.
9. The host generates control reads from the device to request
the Configuration and Report descriptors.
10.Once the device receives a Set Configuration request, its
functions may now be used.
11.Following enumeration as a hub, Firmware can optionally
indicate to the host that a compound device exists (for
example, the keyboard in a keyboard/hub device).
12.The host carries out the enumeration process with this
additional function as though it were attached downstream
from the hub.
13.When the host assigns an address to this device, it is stored
as the other USB address (for example, Address A).
USB Hub
A USB hub is required to support:
Connectivity behavior: service connect/disconnect detection
Bus fault detection and recovery
Full-/Low-speed device support
These features are mapped onto a hub repeater and a hub
controller. The hub controller is supported by the processor
integrated into the CY7C65113C microcontroller. The hardware
in the hub repeater detects whether a USB device is connected
to a downstream port. The connection to a downstream port is
through a differential signal pair (D+ and D–). Each downstream
port provided by the hub requires external R
UDN
resistors from
each signal line to ground, so that when a downstream port has
no device connected, the hub reads a LOW (zero) on both D+
and D–. This condition is used to identify the “no connect” state.
The hub must have a resistor R
UUP
connected between its
upstream D+ line and V
REG
to indicate it is a full speed USB
device.
The hub generates an EOP at EOF1, in accordance with the
USB 1.1 Specification (section 11.2.2, page 234) as well as USB
2.0 specification (section 11.2.5, page 304).
Connecting/Disconnecting a USB Device
A low-speed (1.5 Mbps) USB device has a pull-up resistor on the
D– pin. At connect time, the bias resistors set the signal levels
on the D+ and D– lines. When a low-speed device is connected
to a hub port, the hub sees a LOW on D+ and a HIGH on D–.
This causes the hub repeater to set a connect bit in the Hub Ports
Connect Status register for the downstream port (see Figure 22).
Then the hub repeater generates a Hub Interrupt to notify the
microcontroller that there has been a change in the Hub
downstream status. The firmware sets the speed of this port in
the Hub Ports Speed Register (see Figure ).
A full-speed (12 Mbps) USB device has a pull-up resistor from
the D+ pin, so the hub sees a HIGH on D+ and a LOW on D–. In
this case, the hub repeater sets a connect bit in the Hub Ports
Connect Status register and generates a Hub Interrupt to notify
the microcontroller of the change in Hub status. The firmware
sets the speed of this port in the Hub Ports Speed Register (see
Figure )