English
Language : 

EZ-USB Datasheet, PDF (121/334 Pages) Cypress Semiconductor – The EZ-USB USB Integrated Circuit
Note
The Autopointer works only with internal program/data RAM. It does not work with
memory outside the chip, or with internal RAM that is made available when ISO-
DISAB=1. See Section 8.9.1, "Disable ISO" for a description of the ISODISAB bit.
Init:
;
loop:
mov
mov
movx
mov
mov
movx
mov
mov
movx
mov
mov
movx
movx
movx
movx
movx
movx
movx
movx
djnz
dptr,#FASTXFR
a,#01000000b
@dptr,a
dptr,#AUTOPTRH
a,HIGH(IN4BUF)
@dptr,a
dptr,#AUTOPTRL
a,LOW(IN4BUF)
@dptr,a
dptr,#AUTODATA
r7,#8
@dptr,a
@dptr,a
@dptr,a
@dptr,a
@dptr,a
@dptr,a
@dptr,a
@dptr,a
r7,loop
; set up the fast BULK transfer mode
; FBLK=1, RPOL=0, RM1-0 = 00
; load the FASTXFR register
; High portion of IN4BUF
; Load AUTOPTRH
; Low portion of IN4BUF buffer address
; Load AUTOPTRH
; point to the ‘fifo’ register
; r7 is loop counter, 8 bytes per loop
; (2) write IN ‘fifo’ using byte from external bus
; (2) again
; (2) again
; (2) again
; (2) again
; (2) again
; (2) again
; (2) again
; (3) do eight more, ‘r7’ times
Figure 6-14. 8051 Code to Transfer External Data to a Bulk IN Buffer
This transfer loop takes 19 cycles per loop times 8 passes, or 22 ms (152 cycles). A USB
bulk transfer of 64 bytes takes more that 42 ms (64*8*83 ns) of bus time to transfer the
data bytes to or from the host. This calculation neglects USB overhead time.
From this simple example, it is clear that by using the Autopointer and the EZ-USB Fast
Transfer mode, the 8051 can transfer data in and out of EZ-USB endpoint buffers signifi-
cantly faster than the USB can transfer it to and from the host. This means that the EZ-
USB chip should never be a speed bottleneck in a USB system. It also gives the 8051
ample time for other processing duties between endpoint buffer loads.
The Autopointer can be used to quickly move data anywhere in RAM, not just the bulk
endpoint buffers. For example, it can be used to good effect in an application that calls for
transferring a block of data into RAM, processing the data, and then transferring the data
to a bulk endpoint buffer.
Page 6-24
Chapter 6. EZ-USB CPU
EZ-USB TRM v1.9