Renesas CPU Board M3A-HS19 Instrukcja Użytkownika Strona 19

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 35
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 18
SH7285/SH7286 USB Function Module
USB to Serial Conversion Application Note
2.5.2 Bulk IN Transfer
A bulk IN transfer consists of single or multiple transactions. The USB host sends an IN token in the IN transaction.
When the USB device receives the IN token, it sends a data packet to the USB host and waits for an ACK handshake
from the USB host. When the USB device receives the IN token although it is unable to send data packets, it returns a
NAK handshake to the USB host.
Figure 2.16 shows the IN Transaction flowchart.
When the USB function module receives an IN token although there is no valid data in the EP2FIFO, it automatically
returns a NAK handshake to the USB host. The USB function module determines if there is any valid data in the
EP2FIFO using the EP2PKTE bit in the USBTRG register. When the module receives the IN token when there is
valid data in the EP2FIFO, the USB function module sends the data in the EP2FIFO to the USB host and waits for an
ACK handshake from the USB host. When the ACK handshake is received, the USB function module sets the data
transmit complete flag using the EP2EMPTY bit in the USBIFR0 register.
The sample program periodically transfers data in bulk transfer mode within the main loop. When the serial
communication generates data in the bulk IN transfer RAM that should be transmitted to the USB host, the sample
program confirms if the EP2FIFO is empty. When the EP2FIFO is empty, the sample program writes the data in the
EP2FIFO, sets the PE2PKTE bit to 1, and enables the data in the EP2FIFO. When the EP2FIFO is not empty, the
sample program
is idle and waits for the USB function module to finish transferring data to the USB host.
Idle
IN token
ACK
Idle
Token
Data
Handshake
DATA0/1 NAK STALL
Packet issued by the host
Packet issued by the device
Figure 2.16 IN Transaction
REJ05B1152-0100/Rev.1.00 May 2008 Page 19 of 35
Przeglądanie stron 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 34 35

Komentarze do niniejszej Instrukcji

Brak uwag