Renesas M16C Series User Manual page 210

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30245 Group
(2) Bulk Transfer: Endpoints 1 to 4 Transmit
Setting of Transfer Type
When endpoints 1 to 4 IN are used for bulk transfer, both ISO bit and INTPT bit of USB endpoint x IN
control and status register are set to "0" for bulk transfer setting.
Also, for initialization of toggle sequence bit in bulk transfer, set TOGGLE_INIT bit to "1" and initialize
PID to DATA0.
In order to enable double buffer mode and continuous transmit mode, use USB endpoint x IN FIFO
configuration register for setting.
In order to use the AUTO_SET function, set AUTO_SET bit of USB endpoint x IN control and status
www.DataSheet4U.com
register to "1".
Transmit Data Preparation
The transmit data has to be beforehand prepared in IN FIFO in order to transmit data. Prepare one
packet data (Note 1) to the IN FIFO in the following procedure:
1: Confirm that there is a packet space in the IN FIFO.
Read the IN_BUF_STS1 and IN_BUF_STS0 flags and confirm that they are either "00
FIFO empty) or "01
2: Write one packet data (Note 1) to be transmitted to the IN FIFO.
Every time 1-byte data are written to the IN FIFO, the internal write pointer is automatically
incremented by one. Contents of the internal write pointer cannot be read. For transmitting an
empty packet (with 0 data length), do not write data to the IN FIFO.
3: Set SET_IN_BUF_RDY bit to "1".
At this time, the IN FIFO status is updated as follows (the IN_BUF_STS1 and IN_BUF_STS0 flags
are updated) and the transmit preparation is completed:
•In Single Buffer Mode
The IN_BUF_STS1 and IN_BUF_STS0 flags are updated from "00
"11
•In Double Buffer Mode
When the first packet data (Note 1) of double buffer is written while there is a space in IN FIFO,
the IN_BUF_STS0 and IN_BUF_STS1 flags are updated from "00
second packet data (Note 1) is ready to be written to the IN FIFO. In this case, second packet
data can be continuously prepared.
When there is only the first packet data (Note 1) in the IN FIFO and second packet data (Note 1)
is written, the IN_BUF_STS0 and IN_BUF_STS1 flags are updated from "01
that no more data can be written to the IN FIFO.
The USB function control unit transmits one packet data (Note 1) in the next IN token.
Note 1: In continuous transfer enable, read the description by substituting the underlined part with
Rev.2.00 Oct 16, 2006
REJ09B0340-0200
" (writable of second data in double buffer).
2
" (the IN FIFO full).
2
"buffer data". As for one buffer data, when SET_IN_BUF_RDY bit is set to "1" after data less
than the value set in the BUF_SIZ are written to IN FIFO, one buffer data transmit is pre-
pared. Also, the BUF_SIZ has to be equal to an integral multiple of the EPxIMP.
page 201 of 354
2. USB function
" (the IN
2
" (the IN FIFO empty) to
2
" to "01
", indicating that the
2
2
" to "11
", indicating
2
2

Advertisement

Table of Contents
loading

Table of Contents