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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 35
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 9
SH7285/SH7286 USB Function Module
USB to Serial Conversion Application Note
2.4.2 Data Stage
The Data stage of the control IN transfer is composed of single or multiple data transactions. This is called “Data IN
stage processing”. The Data stage of the control OUT transfer is composed of
one data OUT transaction. This is
called “Data OUT stage processing”.
(1) Data IN Stage
First, the USB host sends an IN token. 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. If the USB device cannot send a data packet when it
receives the IN token, it returns a NAK handshake to the USB host.
Figure 2.7 shows the data IN transaction
flowchart.
When the USB function module receives an IN token without valid data in the
EP0iFIFO, it automatically returns a
NAK handshake to the USB host. When the module receives an IN token with valid data in the EP0iFIFO, it sends the
data in the EP0iFIFO to the USB host and waits for an ACK handshake from the USB host. When the USB function
module receives an ACK handshake, it generates the data transmit complete interrupt using the EP0iTS bit in the
USBIFR0 register. On the contrary, when the module receives an OUT token that indicates the Data IN stage has been
completed, it generates the data receive complete interrupt using the EP0oTS bit in the USBIFR0 register.
The sample program identifies the type of the interrupt while it is being processed. When it is the data receive
complete interrupt (the EP0oTS bit in the USBIFR0 register), the sample program advances to the Status stage. When
it is the data transmit complete interrupt (the EP0iTS bit in the USBIFR0 register), data that should be sent to the USB
host is written in the EP0iFIFO, and the sample program waits for the next interrupt.
Figure 2.8 shows an operation
flowchart of the Data IN stage by the sample program.
Idle
IN token
ACK
Idle
Token
Data
Handshake
DATA0/1 NAK STALL
Packet issued by the host
Packet issued by the device
Figure 2.7 Data IN Transaction
REJ05B1152-0100/Rev.1.00 May 2008 Page 10 of 35
Przeglądanie stron 9
1 2 ... 5 6 7 8 9 10 11 12 13 14 15 ... 34 35

Komentarze do niniejszej Instrukcji

Brak uwag