English
Language : 

EZ-USB Datasheet, PDF (120/334 Pages) Cypress Semiconductor – The EZ-USB USB Integrated Circuit
The 8051 code example in Figure 6-13 uses the Autopointer to transfer a block of eight
data bytes from the endpoint 4 OUT buffer to internal 8051 memory.
Init:
;
loop:
mov
mov
movx
mov
mov
movx
mov
mov
mov
movx
mov
inc
djnz
dptr,#AUTOPTRH
a,#HIGH(OUT4BUF)
@dptr,a
dptr,#AUTOPTRL
a,#LOW(OUT4BUF)
@dptr,a
dptr,#AUTODATA
r0,#80H
r2,#8
; High portion of OUT4BUF buffer
; Load OUTOPTRH
; Low portion of OUT4BUF buffer address
; Load AUTOPTRL
; point to the ‘fifo’ register
; store data in upper 128 bytes of 8051 RAM
; loop counter
a,@dptr
@r0,a
r0
r2,loop
; get a ‘fifo’ byte
; store it
; bump destination pointer
; (NOTE: no ‘inc dptr’ required here)
; do it eight times
Figure 6-13. Use of the Autopointer
As the comment in the penultimate line indicates, the Autopointer saves an “inc dptr”
instruction that would be necessary if one of the 8051 data pointers were used to access
the OUT4BUF RAM data. This improves the transfer time.
Note
Fastest bulk transfer speed in and out of EZ-USB bulk buffers is achieved when the
Autopointer is used in conjunction with the EZ-USB Fast Transfer mode.
As described in Chapter 8, "EZ-USB Isochronous Transfers," the EZ-USB core provides a
method for transferring data directly between an internal FIFO and external memory in
two 8051 cycles (333 ns). The fast transfer mode is active for bulk data when:
• The 8051 sets FBLK=1 in the FASTXFR register, enabling fast bulk transfers,
• The 8051 DPTR points to the AUTODATA register, and
• The 8051 executes a “movx a,@dptr” or a “movx @dptr,a” instruction.
The 8051 code example in Figure 6-14 shows a transfer loop for moving 64 bytes of exter-
nal FIFO data into the endpoint 4-IN buffer. The FASTXFR register bits are explained in
Chapter 8, "EZ-USB Isochronous Transfers."
EZ-USB TRM v1.9
Chapter 6. EZ-USB CPU
Page 6-23