![](http://datasheet.mmic.net.cn/30000/M30240MC-XXXFP_datasheet_2358667/M30240MC-XXXFP_44.png)
CONFIDENTIAL
46
Mitsubishi microcomputers
M16C / 24 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Preliminary Specifications REV.B
Specifications in this manual are tentative and subject to change
Universal Serial Bus
pending interrupts for a given endpoint. The USB FCU sets the interrupt status bits. The CPU writes a “1” to
clear the corresponding status bit. By writing back the same value it read, the CPU will clear all the existing
interrupts. The CPU must read then write both status registers, writing status register 1 first and status register
2 second to guarantee proper operation.
The suspend interrupt status bit is set if a USB suspend signal is received. If the device is in suspend mode,
the resume interrupt status bit is set when a USB resume signal is received. There is a single interrupt enable
bit for both of suspend and resume interrupts (bit 7 of the interrupt enable register 2).
The USB reset interrupt status bit is set if a USB reset signal is received. When this bit is set, all USB internal
registers is reset to their default values except this bit itself. This bit is cleared by the CPU writing a “0” to it.
When the CPU detects a USB reset interrupt, it needs to re-initialize the USB block in order to accept packets
from the host.
The Over/Underrun status bit is set (applicable to endpoints used for isochronous data transfer), when an
overrun condition occurs in an endpoint (CPU is too slow to unload the data from the FIFO), or when an un-
derrun condition occurs in an endpoint (CPU is too slow to load the data to the FIFO).
The USB Function Interrupt (sum of all individual function interrupts) is enabled by setting the corresponding
bit in the Interrupt Control Register of the Interrupt Control Unit.
USB SOF Interrupt
The USB SOF (Start-Of-Frame) interrupt is used to control the transfer of isochronous data. The USB FCU
generates a start-of-frame interrupt when a start-of-frame packet is received. The USB SOF interrupt is en-
abled by setting the corresponding bit in the Interrupt Control Register of the Interrupt Control Unit.
USB Endpoint FIFOs
The USB FCU has an IN (transmit) FIFO and an OUT (receive) FIFO for each endpoint. Both FIFOs support
up to two separate data sets of variable size (except Endpoint 0), and provide the ability of back-to-back trans-
mission and reception. Throughout this specification, the terms “IN FIFO” and “OUT FIFO” refer these FIFOs
associated with the current endpoint.
In the event of a bad transmission/reception, the USB FCU handles all the read/write pointer reversal and data
set management tasks when it is applicable.
IN (Transmit) FIFOs
The CPU/DMA writes data to the endpoint’s IN FIFO location specified by the FIFO write pointer, which auto-
matically increments by "1" after a write.
Endpoint 0 IN FIFO Operation:
The CPU writes a “1” to the IN_PKT_RDY bit after it finishes writing a packet of data to the IN FIFO. The USB
FCU clears the IN_PKT_RDY bit after the packet is successfully transmitted to the host (ACK is received from
the host) or the SETUP_END bit of the IN CSR is set to a “1”.
Endpoint 1-4 IN FIFO Operation when AUTO_SET (bit 7 of IN CSR) = “0”:
MAXP > half of the IN FIFO size: The CPU writes a “1” to IN_PKT_RDY bit after the CPU/DMAC finishes writ-
ing a packet of data to the IN FIFO. The USB FCU clears TX_NOT_EMPTY bit after the packet is successfully
transmitted to the host (ACK is received from the host). The CPU should only write data to the IN FIFO if the
TX_NOT_EMPTY bit of the IN CSR is a “0”.
MAXP <= half of the IN FIFO size: The CPU writes a “1” to the IN_PKT_RDY bit after the CPU/DMAC finishes
writing a packet of data to the IN FIFO. If only one packet of data is the FIFO TX_NOT_EMPTY bit gets set
to a “1” and the IN_PKT_RDY bit gets clear to a ‘0’. If two packets of data in the FIFO, then the
TX_NOT_EMPTY bit gets set to a “1” and the IN_PKT_RDY bit stays as a “1” (the FIFO can hold up to two
data packets at the same time in this configuration, for back-to-back transmission). The CPU should only write
data to the IN FIFO if the IN_PKT_RDY bit of the IN CSR is a “0”.
Endpoint 1-4 IN FIFO Operation when AUTO_SET (bit 7 of IN CSR) = “1”:
MAXP > half of the IN FIFO size: When the number of bytes of data equal to the MAXP (maximum packet
size) is written to the IN FIFO by the CPU/DMAC, the USB FCU sets the TX_NOT_EMPTY bit to a “1” auto-
matically. The USB FCU clears the TX_NOT_EMPTY bit after the packet is successfully transmitted to the
host (ACK is received from the host). The CPU should only write data to the IN FIFO if the TX_NOT_EMPTY
bit of the IN CSR is a “0”.