欢迎访问ic37.com |
会员登录 免费注册
发布采购

AN2131QC 参数 Datasheet PDF下载

AN2131QC图片预览
型号: AN2131QC
PDF下载: 下载PDF文件 查看货源
内容描述: 在EZ - USBTM集成电路 [The EZ-USBTM Integrated Circuit]
分类和应用:
文件页数/大小: 334 页 / 1468 K
品牌: CYPRESS [ CYPRESS ]
 浏览型号AN2131QC的Datasheet PDF文件第107页浏览型号AN2131QC的Datasheet PDF文件第108页浏览型号AN2131QC的Datasheet PDF文件第109页浏览型号AN2131QC的Datasheet PDF文件第110页浏览型号AN2131QC的Datasheet PDF文件第112页浏览型号AN2131QC的Datasheet PDF文件第113页浏览型号AN2131QC的Datasheet PDF文件第114页浏览型号AN2131QC的Datasheet PDF文件第115页  
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  
 复制成功!