AN2131QC Cypress Semiconductor Corp, AN2131QC Datasheet - Page 111

no-image

AN2131QC

Manufacturer Part Number
AN2131QC
Description
IC MCU 8051 8K RAM 24MHZ 80BQFP
Manufacturer
Cypress Semiconductor Corp
Series
EZ-USB®r
Datasheet

Specifications of AN2131QC

Applications
USB Microcontroller
Core Processor
8051
Program Memory Type
ROMless
Controller Series
AN213x
Ram Size
8K x 8
Interface
I²C, USB
Number Of I /o
24
Voltage - Supply
3 V ~ 3.6 V
Operating Temperature
0°C ~ 70°C
Mounting Type
Surface Mount
Package / Case
80-QFP
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
Other names
428-1307

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN2131QC
Manufacturer:
BUSSMANN
Quantity:
3 000
Part Number:
AN2131QC
Manufacturer:
CYPRESS
Quantity:
528
Part Number:
AN2131QC
Manufacturer:
Cypress Semiconductor Corp
Quantity:
10 000
Part Number:
AN2131QC
Manufacturer:
CYPRESS
Quantity:
20 000
The code at lines 2-7 fills the endpoint 2-IN buffer with 64 bytes of a decrementing count.
Two 8-bit counts are initialized to zero at lines 9 and 10. An endpoint 2-IN transfer is
armed at lines 11-13, which load the endpoint 2-IN byte count register IN2BC with 64.
Then the program enters a polling loop at lines 15-20, where it checks two flags for end-
point 2 servicing. Lines 15-17 check the endpoint 2-IN busy bit in IN2CS bit 1. Lines 18-
20 check the endpoint 2-OUT busy bit in OUT2CS bit 1. When busy=1, the EZ-USB core
is currently using the endpoint buffers and the 8051 should not access them. When
busy=0, new data is ready for service by the 8051.
For both IN and OUT endpoints, the busy bit is set when the EZ-USB core is using the
buffers, and cleared by loading the endpoint’s byte count register. The byte count value is
meaningful for IN transfers because it tells the EZ-USB core how many bytes to transfer
in response to the next IN token. The 8051 can load any byte count OUT transfers,
because only the act of loading the register is significant—loading OUTnBC arms the
OUT transfer and sets the endpoint’s busy bit.
When an OUT packet arrives in OUT2BUF, the service routine at lines 22-26 increments
R2, loads the byte count (any value) into OUT2BC to re-arm the endpoint (lines 24-25),
and jumps back to the polling routine. This program does not use OUT2BUF data; it sim-
ply counts the number of endpoint 2-OUT transfers.
When endpoint 2-IN is ready for the 8051 to load another packet into IN2BUF, the polling
loop jumps to the endpoint 2-IN service routine at lines 28-39. First, R1 is incremented
(line 29). The data pointer is set to IN2BUF at line 30, and register R1 is loaded into the
first byte of the buffer (lines 31-32). The data pointer is advanced to the second byte of
IN2BUF at line 33, and register R2 is loaded into the buffer (lines 34-35). Finally, the
byte count 40H (64 decimal bytes) is loaded into the byte count register IN2BC to arm the
next IN transfer at lines 36-38, and the routine returns the polling loop.
6.12
Enumeration Note
The code in this example is complete, and runs on the EZ-USB chip. You may be wonder-
ing about the missing step, which reports the endpoint characteristics to the host during the
enumeration process. The reason this code runs without any enumeration code is that the
EZ-USB chip comes on as a fully-functional USB device with certain endpoints already
configured and reported to the host. Endpoint 2 is included in this default configuration.
The full default configuration is described in Chapter 5, "EZ-USB Enumeration and
ReNumeration "
Page 6-14
Chapter 6. EZ-USB CPU
EZ-USB TRM v1.9

Related parts for AN2131QC