Renesas CPU Board M3A-HS19 Bedienungsanleitung Seite 15

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 35
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 14
SH7285/SH7286 USB Function Module
USB to Serial Conversion Application Note
(2) Status Stage of the Control OUT Transfer
The USB host sends an IN token. The USB device sends a 0-byte data packet to the USB host after it receives the IN
token. Then, the USB device waits for an ACK handshake from the USB host.
When the USB function module receives the IN token, it generates the IN token receive interrupt using the EP0iTR
bit in the USBIFR0 register. When the USB function module receives an IN token although there is no valid 0-byte
data packet in the EP0iFIFO, it automatically returns a NAK handshake to the USB host. When the USB function
module has a valid 0-byte data packet in the EP0iFIFO when it receives the IN token, it sends a 0-byte data packet to
the USB host and waits for an ACK handshake from the USB host. When the USB function module receives the ACK
handshake, it generates the data transmit complete interrupt using the EP0iTS in the USBIFR0 register.
The sample program identifies the type of the interrupt while it is being processed. When it is the data transmit
complete interrupt generated by the EP0iTS in the USBIFR0 register, the sample program clears the interrupt to
complete the control transfer. When it is the IN token receive interrupt generated by the EP0iTR bit in the USBIFR0
register, the sample program enables 0-byte data in the EP0iFIFO by setting the EP0iPKTE bit in the USBTRG
register to 1, and waits for the next interrupt to be generated.
Figure 2.12 shows an operation flowchart of the Status
Stage (Control OUT Transfer) by the sample program. When the
command is a USB communication class command
(Set Line Coding), the sample program uses a SciInit function to process the command.
IN token receive interrupt
USB Function (Hardware)
Sample Program (Software)
(USBIFR0 interrupt)
Clears EP0i transmit
complete flag
(USBIFR0/EP0iTS = 0)
No
Sends a 0-byte data to
the USB host
Sets the EP0i transmit
complete flag
(USBIFR0/EP0iTS = 1)
Changes the state
as WAIT
No
Yes
USBTRG/EP0iPKTE = 1
Clears EP0i transfer
request flag
(USBIFR0/EP0iTR = 0)
SetControlOutContents
Any valid data in the
EP0iFIFO?
EP0i transmit complete
interrupt? (USBIFR0/EP0iTS)
ActControl Out
Yes
Receives the EP0 IN token
SciInit
Disables EP0i transfer
request interrupt
(USBIER0/EP0iTR = 0)
Yes
No
By EP0iPKTE bit
USBIFR0/EP0iTR interrupt
Data in EP0iFIFO is
enabled by EP0iPKTE = 1.
USB command is
Set Line Coding?
Interrupt completed
Interrupt started
USBIFR0/EP0iTS
interrupt
Completed
Executes ActControlOut
function in the USBIFR0
interrupt handler.
Waits for ACK
NAK
Returns NAK to the
USB host
Initializes SCIF
Figure 2.12 Status Stage (Control OUT Transfer)
REJ05B1152-0100/Rev.1.00 May 2008 Page 15 of 35
Seitenansicht 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 34 35

Kommentare zu diesen Handbüchern

Keine Kommentare