Figure 8.5 Operation Flow Of Usb In Transfer - Renesas H8S/2158 User Manual

16-bit single-chip microcomputer h8s family/h8s/2100 series
Table of Contents

Advertisement

Hardware (USB, RFU)
IDLE
Receive IN token
From the host
No
Is EP4 stalled?
The case of 0 data
packet transmission
Yes
can be regarded as
look-ahead processing
completion.
Does EP4
No
transmit buffer
perform look-ahead
processing?
Yes
Has the EP4
No
transmit buffer completed
look-ahead
processing?
Yes
Start data transmission
to the host
Does the EP4
No
transmit buffer
underrun?
Yes
Does the RFU/FIFO
underrun?
Yes
Transmit
Transmit
MaxPacketSize
ShortPacketSize
data
data
End data trasmission to
the host
Is ACK handshake
No
packet received from
the host?
Yes
Transmit STALL
Receive ACK packet
packet
From the host
End data transmission correctly
Manipulate pointer
update to the RFU
Set the EP4TS interrupt flag
To (A)
Request USBID interrupt
IDLE

Figure 8.5 Operation Flow of USB IN Transfer

No
Including
0 data packet
Transmit bit stuff error
packet to the host to
cause timeout error
From the device
Transmit NAK
No handshake
packet
(timeout)
From the device
End data transmission abnormally
Abnormally end
No
during data phase?
Yes
Manipulate pointer
rewind to the RFU
Set the EP4TF interrupt flag
Section 8 RAM-FIFO Unit (RFU)
Firmware (CPU)
(A)
Start USBID interrupt handling
Read USBIFR0 and USBIFR1
to judge an interrupt source
TS
Read TSFR0 to confirm
Read TFFR0 to confirm
the EP4TS interrupt
the EP4TF interrupt
No
Does RFU/FIFO
have data?
Yes
Set the EP4TE bit to 1
in PTTER0
Request EP4 transmit buffer
look-ahead processing
Clear interrupt flag
End USBID interrupt processing
Is
No
look-ahead processing
complete?
Yes
Start look-ahead processing
Lock the transmit buffer
Write 0- to 2-byte data to
the transmit buffer
Cancel transmit buffer lock
End look-ahead processing
Rev. 3.00 Jan 25, 2006 page 195 of 872
TF
No
Is it necessary
to write data to
RFU/FIFO?
Yes
Write data to RFU/FIFO
(MMC, etc.)
Writing 0-byte data means
0-data packet transmission.
REJ09B0286-0300

Advertisement

Table of Contents
loading

Table of Contents