Datasheet

V850ES/JG3-H, V850ES/JH3-H CHAPTER 21 USB FUNCTION CONTROLLER (USBF)
R01UH0042EJ0500 Rev.5.00 Page 1222 of 1513
Aug 12, 2011
21.9.6 Receiving data for bulk transfer (OUT) in DMA mode
Bulk transfer (OUT) is allocated to Endpoint2 and Endpoint4. The flowchart shown below illustrates how Endpoint2 is
controlled when DMA is used. Endpoint4 can also be controlled in the same sequence. To use this flowchart as the
control flow of Endpoint4, therefore, read the bit names of Endpoint2 in the flowchart as those of Endpoint4. The control
flowchart shown below illustrates how remaining data is read by the CPU.
If data for bulk transfer (OUT) has been correctly received by setting the DQBO1MS bit of the UF0IDR register to 1, the
DMA request signal for Endpoint2, instead of an interrupt request (INTUSBF0), becomes active. This DMA request signal
for Endpoint2 operates according to the setting of the MODEn bit of the UF0IDR register (n = 0, 1). If all the data stored in
the UF0BO1 register has been read by DMA, the DMA request signal for Endpoint2 becomes inactive. In this status, if
data for the next bulk transfer (OUT) has been correctly received, the DMA request signal for Endpoint2 becomes active
again. If the data for bulk transfer (OUT) that has been received is equal to or less than the FIFO size, a Short interrupt
request is issued and the INTUSBF0 (EP2_ENDINT) signal becomes active, as soon as reading the data by DMA is
completed. To read data by DMA again, set the DQBO1MS bit to 1 again. If DMA is completed by the DMA end signal for
Endpoint2, the DQBO1MS bit of the UF0IDR register is cleared to 0, and the DMA request signal for Endpoint2 becomes
inactive. At the same time, the DMA_END interrupt request is issued. If data remains in the UF0BO1 register at this time,
DMA can be started again by setting the DQBO1MS bit of the UF0IDR register again. However, the data for bulk transfer
(OUT) is always equal to or less than the FIFO size. Consequently, a Short interrupt request is issued, the INTUSBF0
(EP2_ENDINT) signal becomes active, the DQBO1MS bit is cleared, and the DMA request signal for Endpoint2 becomes
inactive, as soon as the data is read by DMA.
Cautions 1. The DMA request signal for Endpoint n (n = 2, 4) becomes active in the demand mode (MODE1
and MODE0 bits of the UF0IDR register = 10), as long as there is data to be transferred.
2. For a DMA transfer for which the data for a bulk transfer (OUT) is a Short packet (63 bytes or less),
after the transfer finishes, clear the UF0IC0.SHORTC and UF0IS0.SHORT bits.
If the SHORT bits are not cleared, the DMASTOP_EPnB signal is asserted and the next DMA
transfer operation is not performed.