CY7C63001C
CY7C63101C
Document #: 38-08026 Rev. *B Page 14 of 28
6.9.1 USB Enumeration Process
The USB Controller provides a USB Device Address Register
at I/O location 0x12. Reading and writing this register is
achieved via the IORD and IOWR instructions. The register
contents are cleared duri ng a reset, setting the USB addres s
of the USB Controller to 0. Figure 6-17 shows the format of the
USB Address Register.
Typical enumeration steps:
1. The host computer sends a SETUP packet followed by a
DATA packet to USB address 0 requesting the Device
descriptor.
2. The USB Controller decodes the request and retrieves its
Device descriptor from the program memory space.
3. The host computer performs a control read sequence and
the USB Controlle r resp o nds by se nd i ng th e D evi ce
descriptor over the USB bus.
4. After receiving the descriptor, the host computer sends a
SETUP packet followed by a DATA packet to address 0
assigning a new USB address to the device.
5. The USB Controller stores the new address in its USB
Device Address Register after the no-data control
sequence completes.
6. The host sends a request for the Device de scriptor using
the new USB address.
7. The USB Controller decodes the request and retrieves the
Device descriptor from the program memory.
8. The host performs a control read sequ ence and the USB
Controller responds by sending its Device descriptor over
the USB bus.
9. The host generates control reads to the USB Controller to
request the Configuration and Report descriptors.
10.The USB Controller retrieves the descriptors from its
program space and returns the data to the host over the
USB.
1 1.Enumeration is complete after the host has received all the
descriptors.
6.9.2 Endpoint 0
All USB devices are required to have an endpoint number 0
that is used to initialize and manipulate the device. Endpoint 0
provides access to the device’s configuration information and
allows generic USB status and control accesses.
Endpoint 0 can receive and transmit data. Both receive and
transmit data share the same 8-byte Endpoint 0 FIFO located
at data memory space 0x70 to 0x77. Received data may
overwrite the data previously in the FIFO.
6.9.2.1 Endpoint 0 Receive
After receiving a packet and placing the data into the Endpoint
0 FIFO, the USB Controller update s the USB Endpoint 0 RX
register to record the receive status and then generates a USB
Endpoint 0 interrupt. The format of the Endpoint 0 RX Register
is shown in Figure 6-18.
This is a read/w rite regi ster located at I/O addre ss 0x14. An y
write to this register clears all bi ts except bit 3 which remains
unchanged. All bits are cleared during reset.
Bit 0 is set to 1 when a SETUP token for Endpoint 0 is received.
Once set to a 1, this bit remains HIGH until it is cleared by an
I/O write or a reset. While the data following a SETUP is being
received by the USB engine, this bit is not cleared by an I/O
write. User firmware writes to the USB FIFOs are disabled
when bit 0 is set. This prevents SETUP data from being
overwritten.
Bits 1 and 2 are updated whenever a valid toke n is received
on Endpoint 0. Bit 1 is set to 1 if an OUT token is received and
cleared to 0 if any other token is received. Bit 2 is set to 1 if an
IN token is received and cleared to 0 if any other token is
received.
Bit 3 shows the Data Toggle status of DATA packets received
on Endpoint 0. This bit is updated for DATA following SET UP
tokens and for DATA following OUT tokens if Stall (bit 5 of
0x10) is not set and either EnableOuts or StatusOuts (bits 3
and 4 of 0x13) are set.
Bits 4 to 7 are the count of the number of bytes received in a
DATA packet. The two CRC bytes are included in the count,
so the count value is two greater than the number of data bytes
received. The count is always updated and the data is always
stored in the FIFO for DA T A packets following a SETUP token.
The count for DATA following an OUT token is updated if Stall
(bit 5 of 0x10) is 0 and eithe r EnableOuts or StatusOuts (bits
3 and 4 of 0x13) are 1. The DATA following an OUT is written
into the FIFO if EnableOuts is set to 1 and S tall and StatusOuts
are 0.
b7 b6 b5 b4 b3 b2 b1 b0
Reserved ADR6 ADR5 ADR4 ADR3 ADR2 ADR1 ADR0
R/W R/W R/W R/W R/W R/W R/W
00000000
Figure 6-17. USB Device Address Register (USB DA - Address 0x12)
b7 b6 b5 b4 b3 b2 b1 b0
COUNT3 COUNT2 COUNT1 COUNT0 TOGGLE IN OUT SETUP
R/W R/W R/W R/W RR/W R/W R/W
00000000
Figure 6-18. USB Endpoint 0 RX Register (Address 0x14)