Documente Academic
Documente Profesional
Documente Cultură
Enhanced
8051
Core
3.3V, 12-MHz,
4-clock cycle
I/O
USB
Function
Traffic
Serial
Interface
Engine
(SIE)
D+
D-
Program
and
Data
RAM
Bytes
USB
Transceiver
San Jose
CA 95134
408-943-2600
February 1, 2000
softUSB: 1/00
Revision : February 1, 2000
S
Y
N
C
A
D
D
R
O
U
T
E
N
D
P
C
R
C
5
S
Y
N
C
D
A
T
A
1
Token Packet
C
R
C
1
6
Payload
Data
S
Y
N
C
Data Packet
S
Y
N
C
A
C
K
O
U
T
A
D
D
R
E
N
D
P
C
R
C
5
S
Y
N
C
D
A
T
A
0
Payload
Data
Token Packet
H/S Pkt
C
R
C
1
6
S
Y
N
C
A
C
K
Data Packet
Payload
Data
Serial
Interface
Engine
(SIE)
D+
D-
Payload
Data
A
C
K
USB
Transceiver
DATA0/1 PIDS. The host and peripheral maintain data toggle bits that are complemented when data is successfully
sent and acknowledged. If either side fails to read a correct
handshake, it does not flip its data toggle, causing a mismatch
with the next data PID. This initiates a retry. All of this is handled automatically by the SIE.
CONTROL transfers consist of two stages, SETUP and STATUS, and an optional third data stage. This example uses a
data stage. The Intelligence block first decodes the host request using the eight Setup Data bytes from the SIE. In this
example, the host has requested data from the peripheral
(such as a Get_Descriptor request). The Intelligence block
decodes the request from the eight SETUP bytes, retrieves
the requested data from internal memory, constructs packets
of the proper size, and sends them back through the SIE for
USB transmission. After the data has been transferred, the
A
D
D
R
E
N
D
P
C
R
C
5
S
Y
N
C
Packet
D
8
A
bytes
T
A Setup
Data
0
Data Packet
C
R
C
1
6
S
Y
N
C
A
C
K
H/S Pkt
DATA Stage
S
Y
N
C
I
N
A
D
D
R
E
N
D
P
C
R
C
5
S
Y
N
C
Token Packet
D
A
T
A
1
Payload
Data
Data Packet
C
R
C
1
6
S
Y
N
C
A
C
K
H/S Pkt
S
Y
N
C
I
N
A
D
D
R
E
N
D
P
C
R
C
5
S
Y
N
C
Token Packet
D
A
T
A
0
Payload
Data
Data Packet
C
R
C
1
6
S
Y
N
C
A
C
K
H/S Pkt
STATUS Stage
S
Y
N
C
O
U
T
A
D
D
R
E
N
D
P
Token Packet
C
R
C
5
D C
A R
T C
A 1
1 6
Data Packet
S
Y
N
C
S
Y
N
C
A
C
K
H/S Pkt
Serial
Interface
Engine
(SIE)
Figure 4. A USB Control Transfer
2
8
bytes
Setup
Data
Payload
Data
intelligence
Payload
Data
A
C
K
softUSB: 1/00
Revision : February 1, 2000
0
Endpoint
Type
CTL
64
64
64
In a soft controller, the program RAM powers on in an unknown state, so the on-chip CPU is not available to perform
the Intelligence function described above. Therefore, the
SIE must be enhanced to handle enumeration without using
the CPU.
1 IN
INT
16
64
2 IN
BULK
64
64
2 OUT
BULK
64
64
4 IN
BULK
64
64
4 OUT
BULK
64
64
The intelligence to fully enumerate as a USB device is incorporated into the SIE logic (see Figure 5). This Enhanced SIE
contains hard-coded descriptor tables to identify it as an Anchor Generic device. These descriptors instruct the operating system to load the correct driver to operate the device.
The Anchor Generic device contains the following sets of
USB endpoints (Table 1).
6 IN
BULK
64
64
Anchor Chips
Enhanced SIE
Full
Device
Enumeration
Serial
Interface
Engine
(SIE)
6 OUT
BULK
64
64
8 IN
ISO
16
256
8 OUT
ISO
16
256
9 IN
ISO
16
16
9 OUT
ISO
16
16
10 IN
ISO
16
16
10 OUT
ISO
16
16
2000
EZ-USB regs
USB
Endpoint 0 IN
Endpoint 0 OUT
Endpoint 1 IN
Endpoint 1 OUT
Endpoint 2 IN
Endpoint 2 OUT
Endpoint 3 IN
Endpoint 3 OUT
Endpoint 4 IN
Endpoint 4 OUT
Endpoint 5 IN
Endpoint 5 OUT
Endpoint 6 IN
Endpoint 6 OUT
Endpoint 7 IN
Endpoint 7 OUT
1F3F
SOF
1024 Bytes
Isochronous
FIFOS
USB
1024
bytes
Bulk
Endpoint
Buffers
Endpoint 0
Endpoints 1-7
Endpoints 8-15
1B40
control
bulk/interrupt
isochronous
6.5K RAM
0000
softUSB: 1/00
Revision : February 1, 2000
Full
Device
Enumeration
Download
& Upload
Code
Anchor Chips
Enhanced SIE
Serial
Interface
Engine
(SIE)
Enhanced
8051
Core
3.3V, 12-MHz,
4-clock cycle
intelligence
Program
and
Data
RAM
Once the code is loaded and the CPU is brought out of reset,
the final USB device is operational. Now the CPU is in charge.
The CPU handles the USB device requests that were initially
fielded by the enhanced SIE. Because the CPU has access
to the added SIE intelligence, the firmware is simplified. In
effect, the enhanced SIE becomes a high-level engine for
USB requests (Figure 8).
Byte
Field
Value
Meaning
bmRequest
0x40
bRequest
0xA0
Anchor Load
Starting address
Number of Bytes
The device needs to enumerate a second time, or ReNumerate (see Figure 10). Then the final device driver is loaded,
the device contains all firmware and descriptors, and our soft
controller is in business.
wValueL
AddrL
wValueH
AddrH
wIndexL
0x00
wIndexH
0x00
wLengthL
LenL
wLengthH
LenH
Anchor Chips
Enhanced SIE
USB
Function
Traffic
Serial
Interface
Engine
(SIE)
Enhanced
8051
Core
3.3V, 12-MHz,
4-clock cycle
intelligence
intelligence
Program
and
Data
RAM
I/O
softUSB: 1/00
Revision : February 1, 2000
Host PC
recognizes device
attachment, starts
Enumeration
process
Host PC loads
loader driver,
which loads
firmware and
descriptors into
device from a
software file
Host PC
Your Peripheral Device
EZ-USB Core
provides device
descriptors to
identify the loader
driver.
Host PC
recognizes device
attachment, starts
Enumeration
process
Host PC loads
loader driver,
which loads
firmware and
descriptors into
device from a
software file
Host PC
Enumerates
again , loads
device driver
Host PC
Your Peripheral Device
EZ-USB Core
provides device
descriptors to
identify the loader
driver.
The Magic
Happens
DISCON#
The DISCON# pin either drives to the 3.3V rail or floats, under
control of a CPU register bit. This emulates a physical disconnect and reconnect while maintaining power to the device.
Once reconnected, the USB device enumerates using the
downloaded code and descriptors. The entire enumerateReNumerate process happens in about one second.
1500
To 3.3V Regulator
1
2
3
4
EZ-USB
5V
DD+
GND
softUSB: 1/00
Revision : February 1, 2000
8-byte
SETUP data
buffer
SETUP Stage
S
A E C
E
D N R
T
D D C
U
R P 5
P
Token Packet
S
Y
N
C
S
Y
N
C
1
C
R
C
1
6
D
A 8 bytes
Setup
T
Data
A
0
Data Packet
S
Y
N
C
2
Endpoint
FIFO
A
C
K
H/S Pkt
3
5
Endpoint
FIFO
Descriptor
Data Table
6
DATA Stage
S
Y
N
C
I
N
A
D
D
R
E
N
D
P
C
R
C
5
S
Y
N
C
D
A
T
A
1
C
R
C
1
6
Payload
Data
Data Packet
Token Packet
STATUS Stage
S
Y
N
C
O
U
T
A
D
D
R
E
N
D
P
Token Packet
C
R
C
5
D C
A R
T C
A 1
1 6
Data Packet
S
Y
N
C
S
Y
N
C
A
C
K
H/S Pkt
S
Y
N
C
S
Y
N
C
A
C
K
H/S Pkt
I
N
A
D
D
R
E
N
D
P
Token Packet
C
R
C
5
S
Y
N
C
D
A
T
A
0
Payload
Data
C
R
C
1
6
Data Packet
S
Y
N
C
A
C
K
H/S Pkt
Get_DescriptorConventional Method
Once ReNumerated, the CPU can take advantage of the enhanced SIE to simplify the firmware needed to service USB
device requests. Figure 12 illustrates a typical device request
called Get_Descriptor.
softUSB: 1/00
Revision : February 1, 2000
SETUP Stage
S
A E
E
D N
T
D D
U
R P
P
Token Packet
S
Y
N
C
C
R
C
5
S
Y
N
C
D
A 8 bytes
T
Setup
A
Data
0
Data Packet
C
R
C
1
6
S
Y
N
C
8-byte
SETUP data
buffer
A
C
K
H/S Pkt
DATA Stage
S
Y
N
C
I
N
A
D
D
R
E
N
D
P
C
R
C
5
S
Y
N
C
Token Packet
D
A
T
A
1
C
R
C
1
6
Payload
Data
Data Packet
S
Y
N
C
S
Y
N
C
A
C
K
I
N
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
H/S Pkt
S
Y
N
C
D
A
T
A
0
Payload
Data
Data Packet
C
R
C
1
6
S
Y
N
C
A
C
K
H/S Pkt
STATUS Stage
2
S
Y
N
C
O
U
T
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
D C
A R
T C
A 1
1 6
Data Packet
S
Y
N
C
S
Y
N
C
A
C
K
Descriptor
Data Table
H/S Pkt
EZ-USB
PC
Loads Anchor
Chips Driver
USB
VID = 0547
Product ID (PID)
Device ID (DID)
EZ-USB
PC
Loads Device-Specific
Driver
Vendor ID (VID)
USB
Product ID (PID)
Device ID (DID)
Serial EEPROM
(b) Custom Device Enumeration
softUSB: 1/00
Revision : February 1, 2000
movx a,@dptr
DPTR
FWR#
D[7..0]
External FIFO
or ASIC
Accumulator
ISO IN FIFO
movx @dptr,a
DPTR
FRD#
D[7..0]
External FIFO
or ASIC
Accumulator
softUSB: 1/00
Revision: February 1, 2000
PORTA (8)
Alternate Function
OE
PORTB (8)
OUT
PORTC (8)
reg
Pin
PIN
AN2131Q
RD#
WR#
Address (16)
Data (8)
I2 C
Cypress Semiconductor Corporation, 2000. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use
of any circuitry other than circuitry embodied in a Cypress Semiconductor product. Nor does it convey or imply any license under patent or other rights. Cypress Semiconductor does not authorize
its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress
Semiconductor products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress Semiconductor against all charges.