M66291GP
M66291GP
1 Overview
The M66291 is a general purpose USB (Universal Serial Bus) device controller compliant with the USB
Specification Revision 2.0 and supports full speed transfer. The USB transceiver circuit is included, and the M66291
meets all transfer types which are defined in the USB specification. The M66291 has FIFO of 3 Kbytes for data
transfer and can set 7 endpoints (maximum). Each endpoint can be set programmable of its transfer condition, so can
correspond to each device class transfer system of USB.
1.1 Features
z USB Specification Revision 2.0 compliant
z Supports Full Speed (12 Mbps) transfer
z Built-in USB transceiver circuit
z Built-in oscillation buffer (Supports 6M/12M/24 MHz of oscillator) and PLL at 48 MHz
z Supports Vbus direct connection (5 V withstand voltage input), D+ pin pullup output
z Supports all transfer type which is defined in the USB specification.(Control transfer / Bulk transfer / Interrupt
transfer / Isochronous transfer)
z Low power consumption operation (Average 15 mA at operation)
z Robust against signal distortion on USB transfer line due to SIE/DPLL(Digital Phase Lock Loop) of the original
design
z Easy making enumeration program and timing design because hardware manages the device state / control
transfer state (transition timing)
z Reduction of CPU load due to continuous transmit/receive mode (the mode for buffering several transaction data
into FIFO) This enables high performance and throughput improvement.
z Up to 7 endpoints (EP0 to EP6) selectable
z Data transfer condition selectable for each endpoint (EP1 to EP6)
Compatible to various applications (device class)
• Data transfer type (Bulk transfer / Isochronous transfer / Interrupt transfer)
• Transfer direction (IN, OUT)
• Packet size
z Built-in FIFO buffer (3 Kbytes) for endpoints
z Buffering conditions of FIFO memory settable per endpoint (EP1 to EP6)
• FIFO buffer size (up to 1Kbyte)
• Presence/Absence of double buffer configuration (setting of buffer size x 2)
z Four pieces of configurable FIFO ports
• Endpoint number allocation
• Access method switching (CPU, DMAC)
• Bit width (8-bit / 16-bit)
• Endian switching
z ”Interrupt queuing function” that eliminates the need of complicated factor analysis
z Connectable to various CPU/DMAC
• Bus width(8-bit / 16-bit)
• Interface voltage(2.7V to 5.5V)
• Interrupt signal and DMA control signal polarities settable
• Supports multi-word DMA (burst)
z FIFO access cycle of maximum 24 Mbytes/sec
Applications
Support all PC peripheral built-in USB
DATA BUS
I/O POWER
PINCONFIGURATION
SUPPLY
(TOPVIEW)
D11/P3
D10/P2
D9/P1
D8/P0
IOVcc
GND
D7
D6
D5
D4
D3
D2
36
35
34
33
32
31
30
29
28
27
26
25
D12/P4 37 24 D1
DATA BUS
DATA D13/P5 38 23 D0
BUS D14/P6 39 22 A6
D15/A0 40 21 A5
HIGH-WRITE STROBE/BUS WIDTH SELECT HWR/BYTE 41 20 A4
42 19 ADDRESS BUS
INTERRUPT 0 A3
READ STROBE
INT0
RD 43 M66291GP 18 A2
LOW-WRITE STROBE LWR 44 17 A1
CHIP SELECT CS 45 16 CoreVcc CORE POWER SUPPLY
RESET RST 46 15 GND
DMA REQUEST 0 Dreq0 47 14 Xin OSCILLATION INPUT
DMA ACKNOWLEDGE 0 Dack0 48 13 Xout OSCILLATION OUTPUT
10
11
12
1
2
3
4
5
6
7
8
9
TEST
TrON
Vbus
IOVcc
TC1
GND
D-
D+
CoreVcc
Dack1
Dreq1
DMA REQUEST 1
TrON OUTPUT
USB DATA(+)
USB DATA(-)
TESTINPUT
VbusINPUT
TCINPUT
Outline
M66291GP: 48P6Q-
A(LQFP)
PINCONFIGURATION
(TOP VIEW)
D11/P3
D10/P2
D9/P1
D8/P0
IOVcc
GND
NC
D7
D6
D5
D4
D3
D2
39
38
37
36
35
34
33
32
31
30
29
28
27
D12/P4 40 26 D1
D13/P5 41 25 D0
D14/P6 42 24 A6
D15/A0 43 23 A5
HWR/BYTE 44 22 A4
INT0 45 21 A3
RD 46 M66291HP 20 A2
LWR 47 19 A1
CS 48 18 CoreVcc
RST 49 17 GND
Dreq0 50 16 Xin
Dack0 51 15 Xout
NC 52 10 14 NC
11
12
13
1
2
3
4
5
6
7
8
9
TEST
TrON
Vbus
IOVcc
TC1
GND
D-
D+
CoreVcc
Dack1
Dreq1
INT1/SOF
NC
Outline
M66291HP:52PJV(VQFN)
Reset Pins
•RST
FIFO Memory
Test Pins
•TEST
1.2.1 USB-IP
The USB-IP block contains a serial interface engine, a transfer controller, an endpoint controller, a FIFO
memory controller, an interrupt controller, and a CPU interface register.
Note 1: The polarities of *Dreq, *Dack, *INT, and *SOF pins can be changed by the internal registers.
Note 2: The Xin, Xout, Vbus, D+ and D- pins are all driven by CoreVcc.
Note 3: The pins for bus interface, interrupt, DMA control, reset and test are all driven by IOVcc. See Figure 1.2.
2 Registers
c Bit Numbers : Each register is connected with an internal bus of 16-bit wide, so the bit numbers of the
registers located at odd addresses are b15-b8, and those at even addresses are b7-b0.
<Example of representation>
Not implemented in the shaded portion.
c b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
d
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15 Reserved. 0 -
14 A bit 0: ------------------------ 0 0
(------------------------) 1: ------------------------
13 B bit 0: ------------------------ 0 0
(------------------------) 1: ------------------------
12 C bit 0: ------------------------ 0 0
(------------------------) 1: ------------------------
e f
The M66291 register mapping is shown in Figure 2.1 and Figure 2.2, and each register is described below.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
XCKE PLLC Xtal SCKE USBPC Tr_on USBE
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15 XCKE 0: Disable oscillation buffer (Disable clock supply to inside { {
Oscillation Buffer Enable PLL)
1: Enable oscillation buffer (Enable clock supply to inside
PLL)
14 PLLC 0: Disable PLL (PLL through) { {
PLL Operation Enable 1: Enable PLL
13~12 Xtal 00 : External clock frequency : 48 MHz (PLL through) { {
Clock Select 10 : External clock frequency : 24 MHz
01 : External clock frequency : 12 MHz
11 : External clock frequency : 6 MHz
11 SCKE 0: Disable Internal clock { {
Internal Clock Enable 1: Enable Internal clock
10 USBPC 0: Disable USB transceiver { {
USB Transceiver Power Control 1: Enable USB transceiver
9~8 Tr_on 00 : TrON output ="Hi-Z" (SIE operate stop) { {
Tr_on Output Control 01 : TrON output ="L"
10 : Reserved
11 : TrON output ="H"
7~1 Reserved. Set it to “0”. 0 0
0 USBE 0: S/W reset state { {
USB Module Operation Enable 1: S/W reset state release
.
Xtal bits
Multiplying
factor
O scillation
External clock PLL
buffer
Enable/Disable Enable/Disable
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
WKUP
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~1 Reserved. Set it to “0”. 0 0
0 WKUP Q Read { {
Remote Wakeup 0: Do not output the remote wakeup signal
1: Output the remote wakeup signal
Q Write
0: Invalid (Ignored when written)
1: Output the remote wakeup signal
Note : SCKE bit = “0” when XCKE bit = “1 ”, or XCKE bit = “0”.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
SQCLR
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 SQCLR Q Write 0 {
Sequence Bit Clear 0: Invalid (Ignored when written)
1: Clear Sequence bit
b6 corresponds to EP6, ---b1 corresponds to EP1 and b0
corresponds to EP0.
Note : Be sure to set the response PID of the endpoint whose sequence bit is desired to be cleared to NAK (EP0_PID
bits = “00”/EPi_PID bits = “00”) before writing “1” to this bit.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
USB_Addr
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : H'0000>
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 USB_Addr Q Read { ×
USB_Address USB address assigned by the host
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
FMOD FRNM
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~12 Reserved. Set it to “0”. ? 0
11 FMOD 0: At SOF receive { {
Frame Number Mode 1: At Isochronous transfer complete
10~0 FRNM Stores the frame number { ×
Frame Number
This register is valid only for isochronous transfer. In other words, the register is valid status for the endpoint
that is set EPi_TYP bits to “11”.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
SOFOE SOFA
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H’0000>
<USB bus reset : ->
b Bit name Function R W
15 SOFOE 0: Disable SOF signal output { {
SOF Output Enable 1: Enable SOF signal output
14 SOFA 0: "L" active { {
SOF Polarity 1: "H" active
13~0 Reserved. Set it to “0”. 0 0
SOF packet
SOF signal
("L" active) Fixed length Approx. 0.67us
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
VB01 RM01 SF01 DS01 CT01 BE01 NR01 RD01 RDYM INTL INTA
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H’0000>
<USB bus reset : ->
b Bit name Function R W
15 VB01 0: Assigns to INT0 pin { {
Vbus Interrupt Assign 1: Assigns to INT1 pin (Note)
14 RM01 0: Assigns to INT0 pin { {
Resume Interrupt Assign 1: Assigns to INT1 pin (Note)
13 SF01 0: Assigns to INT0 pin { {
SOF Detect Interrupt Assign 1: Assigns to INT1 pin (Note)
12 DS01 0: Assigns to INT0 pin { {
Device State Transition Interrupt Assign 1: Assigns to INT1 pin (Note)
11 CT01 0: Assigns to INT0 pin { {
Control Transfer Transition Interrupt Assign 1: Assigns to INT1 pin (Note)
10 BE01 0: Assigns to INT0 pin { {
Buffer Empty/Size Over Error Interrupt Assign 1: Assigns to INT1 pin (Note)
9 NR01 0: Assigns to INT0 pin { {
Buffer Not Ready Interrupt Assign 1: Assigns to INT1 pin (Note)
8 RD01 0: Assigns to INT0 pin { {
Buffer Ready Interrupt Assign 1: Assigns to INT1 pin (Note)
7~3 Reserved. Set it to “0”. 0 0
2 RDYM 0: Clears the EPB_RDY bits by reading/writing all data of { {
Buffer Ready Mode buffer
1: Clears the EPB_RDY bits by writing "0" to EPB_RDY bit
1 INTL 0: Edge sensitive output { {
Interrupt Output Sense 1: Level sensitive output
0 INTA 0: "L" active or change from “H” to “L” { {
Interrupt Polarity 1 : "H" active or change from "L" to "H"
Note : In order to allocate the interrupt output signal to the INT1/SOF pin, set the SOF signal output to “disable” (SOFOE bit =
“0”).
(6) BE01 (Buffer Empty/Size Over Error Interrupt Assign) Bit (b10)
This bit selects the pin to output the buffer empty/size over error interrupt signal.
Note : SCKE bit = “0” when XCKE bit = “1 ” , or XCKE bit = “0”.
<Edge sense>
Factor 1 occur Factor 2 occur Factor 1 clear Factor 2 clear
Interrupt factor 1
("H" active)
Interrupt factor 2
("H" active)
Interrupt pin
("L" active)
Negate period
(Approx.667ns)
<Leve sense>
Factor 1 occur Factor 2 occur Factor 1 clear Factor 2 clear
Interrupt factor 1
("H" active)
Interrupt factor 2
("H" active)
Interrupt pin
("L" active)
When this bit is set to “1”, the occurrence of interrupt is notified when;
In case of edge sense (INTL bit = “0”) : Change from “L” to “H”
In case of level sense (INTL bit = “1”) : “H” level
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
VBSE RSME SOFE DVSE CTRE BEMPE INTNE INTRE URST SADR SCFG SUSP WDST RDST CMPL SERR
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15 VBSE 0: Disable interrupt { {
Vbus Interrupt Enable 1: Enable interrupt
(Interrupt occurs when VBUS bit is set to “1”)
14 RSME 0: Disable interrupt { {
Resume Interrupt Enable 1: Enable interrupt
(Interrupt occurs when RESM bit is set to "1")
13 SOFE 0: Disable interrupt { {
SOF Detect Interrupt Enable 1: Enable interrupt
(Interrupt occurs when SOFR bit is set to "1")
12 DVSE 0: Disable interrupt { {
Device State Transition Interrupt Enable 1: Enable interrupt
(Interrupt occurs when DVST bit is set to "1")
11 CTRE 0: Disable interrupt { {
Control Transfer Transition Interrupt Enable 1: Enable interrupt
(Interrupt is occurs when CTRT bit is set to "1")
10 BEMPE 0: Disable interrupt { {
Buffer Empty/Size Over Error Interrupt Enable 1 : Enable interrupt
(Interrupt is occurs when BEMP bit is set to "1")
9 INTNE 0: Disable interrupt { {
Buffer Not Ready Interrupt Enable 1: Enable interrupt
(Interrupt occurs when INTN bit is set to "1")
8 INTRE 0: Disable interrupt { {
Buffer Ready Interrupt Enable 1: Enable interrupt
(Interrupt occurs when INTR bit is set to "1")
7 URST 0: Disable DVST bit set { {
USB Reset Detect 1: Enable DVST bit set
6 SADR 0: Disable DVST bit set { {
SET_ADDRESS Execute 1: Enable DVST bit set
5 SCFG 0: Disable DVST bit set { {
SET_CONFIGURATION Execute 1: Enable DVST bit set
4 SUSP 0: Disable DVST bit set { {
Suspend Detect 1: Enable DVST bit set
3 WDST 0: Disable CTRT bit set { {
Control Write Transfer Status Stage 1: Enable CTRT bit set
2 RDST 0: Disable CTRT bit set { {
Control Read Transfer Status Stage 1: Enable CTRT bit set
1 CMPL 0: Disable CTRT bit set { {
Control Transfer Complete 1: Enable CTRT bit set
0 SERR 0: Disable CTRT bit set { {
Control Transfer Sequence Error 1: Enable CTRT bit set
This register sets enable of interrupt and enable/disable of setting DVST and CTRT bits to “1”.
Also refer to “3.1 Interrupt Function”.
Note : At SCKE bit = “0” when XCKE bit = “1 ” or XCKE bit = “0”.
Note : At SCKE bit = “0” when XCKE bit = “1 ” or XCKE bit = “0”.
(6) BEMPE (Buffer Empty/Size Over Error Interrupt Enable) Bit (b10)
This bit sets enable/disable of buffer empty/size over error interrupt.
When this bit is set to “1”, the interrupt occurs if BEMP bit is set to “1”.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPB_RE
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 EPB_RE 0: Disable INTR bit set { {
Buffer Ready Interrupt Enable 1: Enable INTR bit set
b6 corresponds to EP6, ---b1 corresponds to EP1 and b0
corresponds to EP0.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPB_NRE
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 EPB_NRE 0: Disable INTN bit set { {
Buffer Not Ready Interrupt Enable 1: Enable INTN bit set
b6 corresponds to EP6, ---b1 corresponds to EP1 and b0
corresponds to EP0.
Note : Do not set the corresponding bit of this register to “1” when the endpoint is set to isochronous transfer (set by
EPi _TYP bits).
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPB_EMPE
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 EPB_EMPE 0: Disable BEMP bit set { {
Buffer Empty/Size Over Error Interrupt Enable 1 : Enable BEMP bit set
b6 corresponds to EP6, ---b1 corresponds to EP1 and b0
corresponds to EP0.
(1) EPB_EMPE (Buffer Empty/Size Over Error Interrupt Enable) Bits (b6~b0)
These bits select whether to set the BEMP bit to “1” or not when the EPB_EMP_OVR bit is set to “1”.
Also refer to “3.1 Interrupt Function”.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
VBUS RESM SOFR DVST CTRT BEMP INTN INTR Vbus DVSQ VALID CTSQ
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - 1 - - - - 0 0 0 1 - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : B'---1----0001---->
b Bit name Function R W
15 VBUS Q Read { {
Vbus Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
0: Clear Interrupt
1: Invalid (Ignored when written)
14 RESM Q Read { {
Resume Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
0: Clear Interrupt
1: Invalid (Ignored when written)
13 SOFR Q Read { {
SOF Detect Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
0: Clear Interrupt
1: Invalid (Ignored when written)
12 DVST Q Read { {
Device State Transition Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
0: Clear Interrupt
1: Invalid (Ignored when written)
11 CTRT Q Read { {
Control Transfer Stage Transition Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
0: Clear Interrupt
1: Invalid (Ignored when written)
10 BEMP Q Read { ×
Buffer Empty/Size Over Error Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
Invalid (Ignored when written)
9 INTN Q Read { ×
Buffer Not Ready Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
Invalid (Ignored when written)
8 INTR Q Read { ×
Buffer Ready Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
Invalid (Ignored when written)
The b15 to b8 of this register are interrupt status bits. When the bit of the Interrupt Enable Register
corresponding to these bits are set to “1” (interrupt enable), the interrupt occurs by setting these bits to “1”.
Note : SCKE bit = “0” when XCKE bit = “1 ”, or XCKE bit = “0”.
Note : At SCKE bit = “0” when XCKE bit = “1 ” or XCKE bit = “0”.
(A) USB bus reset detect (Arbitrary state -> Default state):
When the SE0 state continues for 2.5 us or more in D+ and D- pins, the USB bus reset is detected,
causing this bit to be set to “1”.
(a) “SET_ADDRESS” request in case device address value in default state is not “0”:
In case the wValue in default state is “0”, this bit is not set to “1”. When this request is
received, the device address value is set to the USB_Address Register, irrespective of the
setting of this bit.
The Conditions that this bit indicates "1" depend on the URST, SADR, SCFG or SUSP bits.
This bit is cleared to “0” by writing “0” (interrupt is cleared).
The present device state can be confirmed by the DVSQ bits.
The Conditions that this bit indicates "1" depend on the WDST, RDST, CMPL or SERR bits.
This bit is cleared to “0” by writing “0” (interrupt is cleared).
The present stage can be confirmed by the CTSQ bits.
Note : SCKE bit = “0” when XCKE bit = “1 ”, or XCKE bit = “0”.
Depending on the changes of these device states, the DVST bit and the RESM bit are set to “1” (set
enable/disable by the URST, SADR, SCFG or SUSP bits). For details, refer to “DVST bit” and Figure 2.6.
Suspend detection
(W hen SUSP bit="1", DVST bit is set to "1")
Powered Suspended
state state
(DVSQ bits ="000") (DVSQ bits="100")
Suspend detection
(W hen SUSP bit="1", DVST bit is set to "1")
SET_ADDRESS excecution
(W hen SADR bit="1", DVST bit is set to "1")
Suspend detection
(W hen SUSP bit="1", DVST bit is set to "1")
Address Suspended
state state
(DVSQ bits="010") (DVSQ bits="110")
Suspend detection
(W hen SUSP bit="1", DVST bit is set to "1")
Configured Suspended
state state
(DVSQ bits="011") (DVSQ bits="111")
Note : The URST , SADR, SCFG and SUSP bits (Interrupt Enable Register 0) in the parenthesis set enable/disable to set the DVST bit to "1" for the
corresponding stage transition. There is no bit to set enable/disable to set the RESM bit to "1".
The stage transition takes place even if these bits are inhibited to set to "1".
The control transfer sequence error is described below. When this error occurs, the EP0_PID bits are set to
“1x” (stall state).
<At control read transfer>
• OUT token is received when data is never transferred against the IN token of the data stage.
• IN token is received at status stage.
• Data packet other than the zero-length packet is received at status stage.
<At control write transfer>
• IN token is received when ACK response is never made against the OUT token of the data
stage.
• OUT token is received in status stage.
<At control write no data transfer>
• OUT token is received in status stage.
<Others>
• Data exceeding in size set by the EP0 Packet Size Register is received (the EPB_EMP_OVR
bit of the Interrupt Status Register 3 is set to “1”).
In case the amount of received data exceeds the wLength value in the request at the data stage of the
control write transfer, it is not recognized as the control transfer sequence error.
ACK ACK
[CTSQ bits ="011"] [CTSQ bits ="100"]
transmit IN token receive receive
Control write Control write
transfer transfer
(1) data stage (3) status stage
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPB_RDY
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset :H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 EPB_RDY Q Read { {
Buffer Ready Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
<When RDYM bit is set to "0">
Invalid (Ignored when written)
<When RDYM bit is set to "1">
0: Clear interrupt clear
1: Invalid (Ignored when written)
b6 corresponds to EP6, ---b1 corresponds to EP1 and b0
corresponds to EP0.
z Endpoint 0
{ When set to control write transfer (ISEL bit = “0”)
The condition for this bit to be set to “1” is as follows:
• When the IVAL bit of the EP0_FIFO Control Register changes from “0” to “1”
The condition for this bit to be cleared to “0” differs according to the RDYM bit:
• RDYM bit = “0” : When the IVAL bit of the EP0_FIFO Control Register changes from
“1” to“0”
• RDYM bit = “1” : Writes “0” to this bit
z Endpoint 1~6
{ When set to OUT buffer (EPi_DIR bit = “0”)
The condition for this bit to be set to “1” is as follows:
<The endpoint not specified by DMA_EP bits>
<The endpoint specified by DMA_EP bits with INTM bit set to “1”>
• When the IVAL bit of the endpoint changes from “0” to “1”
<The endpoint specified in DMA_EP bits with INTM bit set to “0”>
• When the buffer data including the received short packet (including the zero-length
packet) are all read out
The condition for this bit to be cleared to “0” differs according to the RDYM bit (Note):
• RDYM bit = “0” : When the IVAL bit of the endpoint changes from “1” to “0”
• RDYM bit = “1” : Writes “0” to this bit
Note : When the INTM bit at the endpoint specified by the DMA_EP bit is set to “0”, the IVAL bit is
retained to “1”. Thus, it is necessary to write “1” to the BCLR bit and to clear the IVAL bit to
“0” when RDYM bit is set to “0”. Even when the RDYM bit is set to “1”, this bit can be cleared
by writing “0”. It is necessary to write “1” to the BCLR bit and to clear the IVAL bit.
The condition for this bit to be cleared to “0” differs according to the RDYM bits:
• RDYM bit = “0” : When the IVAL bit of the endpoint changes from “0” to “1”
• RDYM bit = “1” : Writes “0” to this bit
Note : The IVAL bit is located per endpoint. For details, refer to “3.2.4 IVAL Bit and EPB_RDY Bit”.
Figure 2.8 Examples of Buffer Ready Interrupt Occurrence Timing (OUT transfer)
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPB_NRDY
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 EPB_NRDY Q Read { {
Buffer Not Ready Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
0: Clear interrupt
1: Invalid (Ignored when written)
b6 corresponds to EP6, ---b1 corresponds to EP1 and b0
corresponds to EP0.
Note: In case the endpoint is set to isochronous transfer (set by EPi_TYP bits), the corresponding bit of this register
may be set to “1”. Hence, do not set the corresponding bit of the Interrupt Enable Register 2 to “1”.
NAK/STALL
OUT token Data packet packet
USB bus SYNC PID Addr Endp CRC EOP SYNC PID Data CRC EOP SYNC PID EOP
Figure 2.9 Examples of Buffer Not Ready Interrupt Occurrence Timing (OUT transfer)
NAK/STALL
IN token packet
USB bus SYNC PID Addr Endp CRC EOP SYNC PID EOP
Figure 2.10 Examples of Buffer Not Ready Interrupt Occurrence Timing (IN transfer)
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPB_EMP_OVR
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 EPB_EMP_OVR Q Read { {
Buffer Empty/Size Over Interrupt 0: No occurrence of interrupt
1: Occurrence of interrupt
Q Write
0: Clear interrupt
1 : Invalid (Ignored when written)
b6 corresponds to EP6, ---b1 corresponds to EP1 and b0
corresponds to EP0.
The conditions for this bit to be cleared to “0” in all bits are as follows:
• Writes “0” to this bit.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
bRequest bmRequestType
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~8 bRequest Q Read { ×
Request Request received in the setup stage
Q Write
Invalid (Ignored when written)
7~0 bmRequestType Q Read { ×
Request Type Request type received in the setup stage
Q Write
Invalid (Ignored when written)
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
wValue
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~0 wValue Q Read { ×
Value Parameter of device request received in the setup stage
Q Write
Invalid (Ignored when written)
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
wIndex
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~0 wIndex Q Read { ×
Index Parameter of device request received in the setup stage
Q Write
Invalid (Ignored when written)
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
wlength
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : H'0000>
<USB bus reset : ->
b Bit name Function R W
15~0 wlength Q Read { ×
Length Parameter of device request received in the setup stage
Q Write
Invalid (Ignored when written)
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
CTRR Ctr_Rd_Buf_Nmb CTRW Ctr_Wr_Buf_Nmb
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset :->
<USB bus reset : ->
b Bit name Function R W
15 CTRR 0: Single transmit mode { {
Control Read Transfer Continuous Transmit 1: Continuous transmit mode
Mode
14 Reserved. Set it to "0". 0 0
13~8 Ctr_Rd_Buf_Nmb The top block number for the Control Read buffer { {
Control Read Buffer Start Number
7 CTRW 0: Unit receive mode { {
Control Write Transfer Continuous Receive 1: Continuous receive mode
Mode
6 Reserved. Set it to “0”. 0 0
5~0 Ctr_Wr_Buf_Nmb The top block number for the Control Write buffer { {
Control Write Buffer Start Number
(1) CTRR (Control Read Transfer Continuous Transmit Mode) Bit (b15)
This bit sets the transmit mode at data stage of the control read transfer.
In case of single transmit mode, the transmit completes after transmitting one packet under the condition as
follows:
• Transmits the data equivalent to the size set by the EP0 Packet Size Register or transmits a short
packet by setting the IVAL bit to “1”.
In case of continuous transmit mode, the transmit completes after transmitting several packets under the
condition as follows:
• Transmits the data equivalent to the size set by the EP0_FIFO Continuous Transmit Data Length
Register or transmits a short packet by setting the IVAL bit to “1”.
In case of single transmit mode, the writing completes under the conditions as follows:
• Writes the data equivalent to the size set by the EP0 Packet Size Register to the buffer
(The IVAL bit of the EP0_FIFO Control Register changed to “1”).
• Writes “1” to the IVAL bit of the EP0_FIFO Control Register.
In case of continuous transmit mode, the writing completes under the conditions as follows:
• Writes the data equivalent to the size set by the EP0_FIFO Continuous Transmit Data Length
Register (The IVAL bit of the EP0_FIFO Control Register changed to “1”).
• Writes “1” to the IVAL bit of the EP0_FIFO Control Register.
The setting conditions of the IVAL bit of the EP0_FIFO Control Register change due to this bit.
Note 1: The M66291 is equipped with 3 Kbytes FIFO buffer and has blocks from H’0 to H’2F.
Note 2: Make sure that several endpoints do not get overlapped in the same buffer area.
(3) CTRW (Control Write Transfer Continuous Receive Mode) Bit (b7)
This bit sets the receive mode at data stage of the control write transfer.
In case of unit receive mode, the receive completes after receiving one packet under the condition as follows:
• Receives the data equivalent to the size set by the EP0 Packet Size Register.
• Receives a short packet.
In case of continuous receive mode, the receipt completes after receiving several packets under the condition
as follows:
• Receives automatically the data equivalent to the size set by the EP0 Packet Size Register several
times and receives the data equivalent to 256 bytes.
• Receives the short packet.
The setting conditions of the IVAL bit of the EP0_FIFO Control Register change due to this bit.
Note 1: The M66291 is equipped with 3 Kbytes FIFO buffer and has blocks from H’0 to H’2F.
Note 2: Make sure that several endpoints do not get overlapped in the same buffer area.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EP0_MXPS
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0008>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 EP0_MXPS Upper limit of the transmit/receive data for one packet transfer { {
Maximum Packet Size (Settable only 8,16,32 and 64)
Note: Set these bits after setting the response PID to NAK (EP0_PID bits = “00”).
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
ASCN ASAD
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~2 Reserved. Set it to “0”. 0 0
1 ASCN 0: Invalid of automatic response mode for { {
SET_CONFIGURATION Automatic Response SET_CONFIGURATION
Mode 1: Valid of automatic response mode for
SET_CONFIGURATION
0 ASAD 0: Invalid of automatic response mode for SET_ADDRESS { {
SET_ADDRESS Automatic Response Mode 1: Valid of automatic response mode for SET_ADDRESS
No automatic response is executed when the SET_CONFIGURATION request other than the ones given
above is received. In such case, the CTRT bit is set to “1” (control transfer stage transition interrupt occurs).
When the state gets changed after receiving the aforesaid requests, the DVST bit is set to “1” if the SCFG bit is
set to “1”, irrespective of the validity of this function (device state transition interrupt occurs).
No automatic response is executed when the SET_ADDRESS request other than the ones given above is
received. In such case, the CTRT bit is set to “1” (control transfer stage transition interrupt occurs).
When the state gets changed after receiving the aforesaid requests, the DVST bit is set to “1” if the SADR bit
is set to “1”, irrespective of the validity of this function (device state transition interrupt occurs).
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
RCNT Octl BSWP ISEL
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15 RCNT 0: The ODLN bits are cleared by reading all receive data { {
Read Count Mode 1: The ODLN bits are counted down by reading receive data
14~11 Reserved. Set it to “0”. 0 0
10 Octl 0: EP0_FIFO Data Register is 16-bit mode { {
Register 8-Bit Mode 1: EP0_FIFO Data Register is 8-bit mode
9~8 Reserved. Set it to “0”. 0 0
7 BSWP 0: Byte is treated as little ENDIAN { {
Byte Swap Mode 1: Byte is treated as big ENDIAN
6~1 Reserved. Set it to “0”. 0 0
0 ISEL 0: Control write transfer { {
Buffer Select 1: Control read transfer
Note : Use the *HWR/*BYTE pin or the Octl bit of this register for setting the 8-bit/16-bit mode.
b15~b8 b7~b0
Little Endian odd number address even number address
Big Endian even number address odd number address
Note: Don’t set this bit to “1” when the mode is set to 8-bit (set by the Octl bit or *HWR/*BYTE pin).
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EP0_PID IVAL BCLR E0req CCPL ODLN
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0800>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~14 EP0_PID 00 : NAK { {
Response PID 01 : BUF
(Transmits response PID/data according to the state of
buffer etc,)
1x : STALL
13 IVAL <When set to control write transfer> { {
IN Buffer Set/OUT Buffer Status Q Read
0: Disables the reading of data from the buffer
1: Enables the reading of data from the buffer
Q Write
Invalid (Ignored when written)
<When set to control read transfer>
Q Read
0: Incomplete to write the data to buffer
1: Complete to write the data to buffer
Q Write
0: Invalid (Ignored when written)
1: Complete to write the data to buffer
(Forced completion : Transmits the short packet)
12 BCLR <When set to control write transfer > 0 {
Buffer Clear Q Write
0: Invalid (Ignored when written)
1: Buffer clear (When the IVAL bit is set to "1")
<When set to control read transfer>
Q Write
0: Invalid (Ignored when written)
1: Buffer clear (Note : When the IVAL bit is set to “1”,
make sure to set the EP0_PID bits to “00” before
executing the aforesaid operations.)
11 E0req 0: Enables to access EP0_FIFO Data Register etc, { ×
EP0_FIFO Ready 1: Disables to access EP0_FIFO Data Register etc,
10 CCPL 0: NAK response at status stage { {
Control Transfer Control 1: Normal completion response at status stage
(ACK response/zero-length packet transmit)
9 Reserved. Set it to “0”. 0 0
8~0 ODLN Stores the receive data length in control write transfer { ×
Control Write Receive Data Length
The NAK response is not executed even if these bits are set to “00” when the data is being received at data
stage. The settings of these bits are reflected from the next transaction.
Similarly, the transmission is not interrupted even if these bits are set to “00” when the data is being
transmitted at data stage.
Further, these bits are automatically set to the values below when the following states occur:
z When setup token is received
• "00" (NAK)
z When the request set to automatic response (SET_ADDRESS or SET_CONFIGURATION) is received
• "01" (BUF)
The CCPL bit also is automatically set to “1” and transmits the zero-length packet at the succeeding
status stage (IN transaction).
z When sequence error occurs (CTSQ bits are set to “110”)
• "1x" (STALL)
When “1” is written to this bit, the write is forcibly completed. When some written data exists
in the buffer, that data is transmitted as the short packet. Here, if the buffer is empty or
cleared, the zero-length packet is transmitted. The buffer can be cleared using the BCLR bit.
Further, the zero-length packet can be transmitted by writing “1” simultaneously to this bit
and to the BCLR bit. In this case the buffer is cleared by setting “1” to BCLR bit, and this bit
is cleared to “0” after the zero-length packet is transmitted.
When the IVAL bit is set to “1”, the following operations are executed by writing “1” to this bit:
• Clears SIE side buffer (Unlike the other endpoints, the SIE side buffer can also be cleared by
this bit).
• Clears the IVAL bit of this register.
Note: When the IVAL bit is set to “1”, make sure to set the EP0_PID bits to “00” before executing the aforesaid
operations.
When this bit is set to “0”, NAK response is executed to the host after receiving the IN token/OUT token at
status stage of the control transfer.
This bit is automatically cleared to “0” by receiving the setup token.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EP0_FIFO
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'????>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~0 EP0_FIFO <When set to control write transfer> { {
EP0_FIFO Data Q Read
Reads receive data
<When set to control read transfer>
Q Write
Writes transmit data
Note:The upper 8 bits (b15 to b8) become invalid in the 8-bit-mode (using the Octl bit of the EP0_FIFO Select Register or
*HWR/*BYTE pin).
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
SDLN
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~9 Reserved. Set it to “0”. 0 0
8~0 SDLN Control read continuous transmit data length { {
Control Read Continuous Transmit Data Length
(1) SDLN (Control Read Continuous Transmit Data Length) Bits (b8~b0)
These bits are valid when the EP0 is set to continuous transmit mode (CTRR bit = “1”) at the time of control
read transfer (ISEL bit = “1”).
These bits set the total byte count of the data transmitted (over multiple transactions) during data stage of
control read transfer.
These bits can be set to maximum 256 bytes. When total byte count exceeds 256, set the 256 bytes and the
excess byte in several cycles.
When the integral multiples of the value set by the EP0 Packet Size Register is set to these bits, the zero-
length packet is automatically added after all data are transmitted. The zero-length packet is not
automatically added if the SDLN are set to 256 to transmit 256 bytes data or more.
Write to the buffer after setting this bit. Set these bits before writing to the buffer.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
RCNT RWND BSWP Octl CPU_EP
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15 RCNT 0: The CPU_DTLN bits are cleared by reading all receive { {
Read Count Mode data
1: The CPU_DTLN bits are counted down by reading receive
data
14~13 Reserved. Set it to “0”. 0 0
12 RWND <When set to OUT buffer> 0 {
Buffer Rewind Q Write
0: Invalid (Ignored when written)
1: Clears the buffer reading pointer
<When set to IN buffer>
Q Write
0: Invalid (Ignored when written)
1: Clears the buffer writing pointer
11~8 Reserved. Set it to “0”. 0 0
7 BSWP 0: Byte is treated as little ENDIAN { {
Byte Swap Mode 1: Byte is treated as big ENDIAN
6 Octl 0: CPU_FIFO Data Register is 16-bit mode { {
Register 8-Bit Mode 1: CPU_FIFO Data Register is 8-bit mode
5~4 Reserved. Set it to “0”. 0 0
3~0 CPU_EP 0001 :EP1 (Endpoint 1) { {
CPU Access Endpoint Designate 0010 :EP2 (Endpoint 2)
0011 :EP3 (Endpoint 3)
0100 :EP4 (Endpoint 4)
0101 :EP5 (Endpoint 5)
0110 :EP6 (Endpoint 6)
Other than those above : Invalid
Note : Use the *HWR/*BYTE pin or the Octl bit of this register for setting the 8-bit/16-bit mode.
b15~b8 b7~b0
Little Endian odd number address even number address
Big Endian even number address odd number address
Note: Do not set this bit to “1” when the mode is set to 8-bit (set by the Octl bit or *HWR/*BYTE pin).
Note: The access width of the CPU_FIFO Data Register is controlled by the logical sum of this bit and the EPi_Octl
bits of the EPi Configuration Register 1 specified by the CPU_EP bits. Hence, the mode is set to 8-bit if “1” is
set to either this bit or to the EPi_Octl bits of the EPi Configuration Register 1. Make sure that both bits must be
set to “0” to change to 16-bit mode.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
IDLY IVAL BCLR Creq CPU_DTLN
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0800>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15 Reserved. Set it to “0”. 0 0
14 IDLY 0: Disable of IDLY function { {
Isochronous Transmit Delay Set 1: Enable of IDLY function
13 IVAL <When set to OUT buffer> { {
IN Buffer Set/OUT Buffer Status Q Read
0: Disables reading data from the buffer
1: Enables reading data from the buffer
Q Write
Invalid (Ignored when written)
<When set to IN buffer>
Q Read
0: Incomplete to write the data to buffer
1: Complete to write the data to buffer
Q Write
0: Invalid (Ignored when written)
1: Complete to write the data to buffer
(Forced completion : Transmits short packet)
12 BCLR <When set to OUT buffer> 0 {
Buffer Clear Q Write
0: Invalid (Ignored when written)
1: Buffer clear (When the IVAL bit is set to "1")
<When set to IN buffer>
Q Write
0: Invalid (Ignored when written)
1: Buffer clear (When the IVAL bit is set to "0")
11 Creq 0: Enables accessing CPU_FIFO Data Register etc, { ×
CPU_FIFO Ready 1: Disables accessing CPU_FIFO Data Register etc,
10~0 CPU_DTLN Stores the receive data length (byte count) { ×
CPU_FIFO Receive Data Length Register
Note: Set the transmit data size + 1 byte or more to the EPi_MXPS bits. When set to transmit data size, the IVAL bit is
set to “1” when the writing to the buffer completes. Hence, this function is not applicable when set to 1023
bytes, the maximum value of the EPi_MXPS bits.
SO F z z z IN z z z SO F z z z IN z z z z z z
Flame #m
SO F z z z IN z z z z z z
When “1” is written to this bit, the write operation is forcibly completed. When some written
data exists in the buffer, that data is solely transmitted as the short packet. Here, if the
buffer is empty or cleared, the zero-length packet is transmitted. The buffer can be cleared
using the BCLR bit. Further, the zero-length packet can be transmitted by writing “1”
simultaneously to this bit and to the BCLR bit. In this case the buffer is cleared by setting “1”
to BCLR bit, and this bit is cleared to “0” after the zero-length packet is transmitted.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
CPU_FIFO
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'????>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~0 CPU_FIFO <When set to OUT buffer> { {
CPU_FIFO Data Q Read
Reads receive data
<When set to IN buffer>
Q Write
Writes transmit data
Note:The upper 8 bits (b15 to b8) become invalid in the 8-bit mode (using the Octl bits or *HWR/*BYTE pin).
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
TGL SCLR Sreq SIE_DTLN
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~14 Reserved. Set it to “0”. 0 0
13 TGL <When set to OUT buffer> 0 {
Buffer Toggle Q Write
0: Invalid (Ignored when written)
1: Forces the buffer to toggle in receive ready state to read
ready state
<When set to IN buffer>
Q Write
0: Invalid (Ignored when written)
1: Inhibited
12 SCLR <When set to OUT buffer> 0 {
Buffer Clear Q Write
0: Invalid
1: Inhibited
<When set to IN buffer>
0: Invalid (Ignored when written)
1: Clears the buffer in transmit ready state
11 Sreq 0: Enables to be write to TGL bit/SCLR bit { ×
SIE_FIFO Ready 1: Disables to be write to TGL bit/SCLR bit
10~0 SIE_DTLN Receive data length of SIE internal FIFO { ×
SIE_FIFO Receive Data Length
This register is valid against the endpoint set by the CPU_EP bits.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
BUST DFORM RWND ACKA REQA INTM DMAEN BSWP Octl DMA_EP
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15 BUST 0: Cycle Steal Transfer { {
Burst Mode 1: Burst Transfer
13~14 DFORM 00 : Controls by DACK signal and read/write signal { {
Transfer Method 01 : Controls by DACK signal only
10 : Controls by chip select/address signal and read/write signal
11 : Reserved
12 RWND <When set to OUT buffer> 0 {
Buffer Rewind Q Write
0: Invalid (Ignored when written)
1: Clears the buffer reading pointer
<When set to IN buffer>
Q Write
0: Invalid (Ignored when written)
1: Clears the buffer writing pointer
11 ACKA 0: "L" active { {
DACK Polarity 1: "H" active
10 REQA 0: "L" active { {
DREQ Polarity 1: "H" active
9 INTM 0: Sets “1” to EPB_RDY bit by completion of DMA transfer { {
DMA Interrupt Mode 1: Sets “1” to EPB_RDY bit by completion of receiving
8 DMAEN 0: Disable DMA transfer { {
DMA Enable 1: Enable DMA transfer (assertion of DREQ signal)
7 BSWP 0: Byte is treated as little ENDIAN { {
Byte Swap Mode 1: Byte is treated as big ENDIAN
6 Octl 0: Dn_FIFO Data Register is 16-bit mode { {
Register 8-Bit Mode 1: Dn_FIFO Data Register is 8-bit mode
5~4 Reserved. Set it to “0”. 0 0
3~0 DMA_EP 0001 :EP1 (Endpoint 1) { {
DMA Transfer Endpoint Designate 0010 :EP2 (Endpoint 2)
0011 :EP3 (Endpoint 3)
0100 :EP4 (Endpoint 4)
0101 :EP5 (Endpoint 5)
0110 :EP6 (Endpoint 6)
Other than those above : Invalid
When the endpoint set to the OUT buffer (EPi_DIR bit = “0”) is assigned to the DMA_EP, writing operation to
the Dn_FIFO Data Register is ignored.
Similarly, when the endpoint set to the IN buffer (EPi_DIR bit = “1”) is assigned to the DMA_EP, reading
operation to the Dn_FIFO Data Register is ignored (undefined value is read).
When this bit is set to “1”, the EPB_RDY bit is set to “1” under the same conditions as the endpoint not
specified by the DMA_EP bits (buffer ready interrupt occurs).
When this bit is set to “1”, the EPB_RDY bit is set to “1” under the same conditions as the endpoint not
specified by the DMA_EP bits (buffer ready interrupt occurs).
Note: Do not use with DMAEN = “0” when this bit is set to “0”.
Note: Do not use with INTM = “0” when this bit is set to “0”.
b15~b8 b7~b0
Little Endian odd number address even number address
Big Endian even number address odd number address
Note: Don’t set this bit to “1” when the mode is set to 8-bit (set by the Octl bit or *HWR/*BYTE pin).
Note: The access width of the Dn_FIFO Data Register is controlled by the logical sum of this bit and the EPi_Octl bits
of the EPi Configuration Register 1 specified by the DMA_EP bits. Hence, the mode is set to 8-bit if “1” is set to
either this bit or to the EPi_Octl bits of the EPi Configuration Register 1. Make sure that both bits must be set to
“0” to change to 16-bit mode.
Note: Do not change this bit while accessing the Dn_FIFO Data Register.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
TRCLR TREN IVAL BCLR Dreq DMA_DTLN
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0800>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15 TRCLR Q Write 0 {
Transaction Count Clear 0: Invalid (Ignored when written)
1: Clears the DMAn_Transaction Count Register
14 TREN 0: Disable of transaction count function { {
Transaction Count Enable 1: Enable of transaction count function
13 IVAL <When set to OUT buffer> { {
IN Buffer Set/OUT Buffer Status Q Read
0: Disables the reading of data from the buffer
1: Enables the reading of data from the buffer
Q Write
Invalid (Ignored when written)
<When set to IN buffer>
Q Read
0: Incomplete to write the data to buffer
1: Complete to write the data to buffer
Q Write
0: Invalid (Ignored when written)
1: Complete to write the data to buffer
(Forced completion : Transmits short packet)
12 BCLR <When set to OUT buffer> 0 {
Buffer Clear Q Write
0: Invalid (Ignored when written)
1: Buffer clear (When the IVAL bit is set to "1")
<When set to IN buffer>
Q Write
0: Invalid (Ignored when written)
1: Buffer clear
11 Dreq 0: Enables to access Dn_FIFO Data Register { ×
D_FIFO Ready 1: Disables to access Dn_FIFO Data Register
10~0 DMA_DTLN Stores the receive data length (byte count) { ×
D_FIFO Receive Data Length Register
These bits indicate the valid value when the Dreq bit of this register is equal to “0”.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
D_FIFO
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'????>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~0 D_FIFO <When set to OUT buffer> { {
D_FIFO Data Q Read
Reads receive data
<When set to IN buffer>
Q Write
Writes transmit data
Note:The upper 8 bits (b15 to b8) become invalid in the 8-bit mode (using the Octl bits or *HWR/*BYTE pin).
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
TRNCNT
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~0 TRNCNT <TREN bit = "0"> { {
Transaction Count Packet count that completes the receiving
(behaving as the compare register)
<TREN bit = "1">
Q Read
The number of the received packets (behaving as the current
register)
Q Write
Packet count that completes the receiving
(behaving as the compare register)
With the transaction count function set to be enabled (TREN bit = “1”), the following conditions are added to
the buffer receive completion condition. In case of the receive completion, refer to the “EPi_RWMD bit of the
EPi Configuration Register 0”.
• When the value set by this register conforms to the packet receive count.
(Conformity between current register and compare register; See below.)
It is necessary to clear the TNCNT bits as the current register to “0” by writing “1” to the TRCLR bit before the
next transfer.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPB_STS
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
<H/W reset : H’0000>
<S/W reset : H’0000>
<USB bus reset : ->
b Bit name Function R W
15~7 Reserved. Set it to “0”. 0 0
6~0 EPB_STS Q Read { ×
Endpoint 0~6 Buffer Status 0: Disables the reading and writing of data to and from the
buffer
1: Enables the reading and writing of data to and from the
buffer
The condition for clearing this bit to “0” is always the same as in the case of the RDYM bit set to “0”. Hence,
the presence/absence of data in the buffer can be confirmed by reading these bits even after the interrupt is
cleared by writing “0” to the Interrupt Status Register 1.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
PIEN PDIR
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
The port pins, P0 ~ P6, automatically turn to input/output ports by setting to 8-bit bus interface mode
(controlled by HWR/BYTE pin). When set to 16-bit bus interface mode, all functions of this register become
invalid. Further, the writing into this register at 16-bit bus interface mode becomes invalid while the reading
becomes H’0000.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
PDAT
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
The port pins, P0 ~ P6, automatically turn to input/output ports by setting to 8-bit bus interface mode
(controlled by HWR/BYTE pin). When set to 16-bit bus interface mode, all functions of this register become
invalid. Further, the writing into this register at 16-bit bus interface mode becomes invalid while the reading
becomes H’0000.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
LDRV
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~1 Reserved. Set it to “0”. 0 0
0 LDRV 0: When IOVcc=2.7~3.6V { {
Drive Current Adjust 1: When IOVcc=4.5~5.5V
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPi_DIR EPi_ EPi_ EPi_
EPi_TYP ITMD EPi_Buf_siz DBLB RWMD EPi_Buf_Nmb
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0000>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~14 EPi_TYP 00 : Invalid { {
Transfer Type 01 : Bulk transfer
10 : Interrupt transfer
11 : Isochronous transfer
13 EPi_DIR 0: OUT buffer (Receives data from the host) { {
Transfer Direction 1: IN buffer (Transmits data to the host)
12 EPi_ITMD 0: Enable data resend function (normal toggle mode) { {
Interrupt Toggle Mode 1: Disable data resend function (forced toggle mode)
11~8 EPi_Buf_siz Endpoint buffer size { {
Buffer Size
7 EPi_DBLB 0: Single buffer mode { {
Double Buffer Mode 1: Double buffer mode
6 EPi_RWMD 0: Single transmit /receive mode { {
Continuous Transmit/Receive Mode 1: Continuous transmit/receive mode
5~0 EPi_Buf_Nmb The top block number of buffer { {
Buffer Start Number
When the data resend function is set to disable, the new data is transmitted at the next transmission by
toggling the DATA PID and the buffer, even if the ACK is not received after transmitting the data at interrupt
transfer. Here, the IVAL bit is cleared to “0” and the EPB_RDY bit is set to “1” (buffer ready interrupt has
occurred).
When the data resend function is set to enable, the normal toggle sequence is executed. When the
transmission completes normally, the DATA PID and the buffer got toggled to transmit the next data. In case
ACK cannot be received after the data is transmitted, the DATA PID and the buffer do not get toggle, and the
same data in the buffer is resent.
When set to IN buffer (EPi_DIR bit = “1”), if the integral multiples of the value set by the EPi_MXPS bits is set
to these bits, the zero-length packet can be added after all data are transmitted. For details, refer to the
setting of “1” to the EPi_NULMD bit.
Note: The M66291 is equipped with 3 Kbytes FIFO buffer. The Maximum buffer size is 1024Bytes for an endpoint, and
the minimum one is 64Bytes.
zDouble buffer mode when set to OUT buffer (EPi_DIR bit = “0”)
{SIE side buffer:
• The data received by SIE can be written.
• Can not be accessed by CPU/DMA.
{CPU side buffer:
• Can not be accessed by SIE.
• The received data can be read by CPU/DMA.
{Buffer toggle condition (switching of SIE side buffer and CPU side buffer)
• SIE side buffer receive completion and CPU side buffer read completion (empty)
The receive completion changes according to the single/continuous transmit/receive mode.
For details, refer to the “EPi_RWMD bit” and the “TGL bit”.
In case of single transmit/receive mode, the write completes under the conditions as follows:
• Writes the data equivalent to the size set by the EPi_MXPS bits to the buffer (IVAL bit
changed to “1”).
• Writes “1” to the IVAL bit of the CPU_FIFO Control/Dn_FIFO Control Register.
In case of continuous transmit/receive mode, the write completes under the conditions as follows:
• Writes the data equivalent to the size set by the EPi_Buf_siz bit to the buffer (IVAL bit
changed to “1”).
• Writes “1” to the IVAL bit.
The set/clear conditions of the IVAL bit change according to this bit.
Note 1: The M66291 is equipped with 3 Kbytes FIFO buffer and has the blocks from H’0 to H’2F.
Note 2: Make sure that several endpoints may not get overlapped in the same buffer area.
b15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 b0
EPi_ EPi_ EPi_
EPi_PID NULMD ACLR Octl EPi_MXPS
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
<H/W reset : H'0040>
<S/W reset : ->
<USB bus reset : ->
b Bit name Function R W
15~14 EPi_PID 00 : NAK { {
Response PID 01 : BUF
(Transmits response PID/data according to the state of
buffer etc,)
1x : STALL
13 Reserved. Set it to “0”. 0 0
12 EPi_NULMD 0: Disable to transmit zero-length packet automatically { {
Zero-Length Packet Addtion Transmit Mode 1: Enable to transmit zero-length packet automatically
When these bits are set to “1x”, the STALL response is executed, regardless of the buffer state.
When set to OUT buffer, if a data exceeding the maximum packet size is received, regardless of these bit
values, these bits are set automatically to “1x” (STALL).
This bit is valid at continuous transmit/receive mode (EPi_RWMD bit = “1”) when set to IN buffer (EPi_DIR
bit = “1”). Set to “0” for the other modes.
In case of the completion of SIE side buffer transmit, if the IVAL bit is set to “0”, the zero-length packet
automatically transmitted in the last under the condition as follows:
• When the buffer size set by the EPi_Buf_siz bit is the integral multiple of the size set by the
EPi_MXPS bits.
In case of the continuous transmit/receive mode, the data equivalent to the size set by the EPi_MXPS bits is
automatically transmitted several times before transmitting the data equivalent to the size set by the
EPi_Buf_siz bit.
When set to IN buffer (EPi_DIR bit = “1”), only the SIE side buffer and the buffer with the writing completed
(the buffer when IVAL bit = “1”) are cleared by setting “1” to this bit.
When this bit is set to “1”, if BUF is set to the EPi_PID bits, the NAK response is given against the received IN
token. Further, with the EPi_PID bits set to NAK/STALL, the NAK/STALL response is executed.
Note: When set to IN buffer, make sure to set the response PID to NAK (EPi_PID bits = “00”) before setting this bit to
“1”.
Note: Set this bit after setting the response PID to NAK (EPi_PID bits = “00”).
3 M66291 OPERATIONS
VBSE
VBUS
Edge/level
generator RSME
INT0 circuit
RESM
WDST
Control write transfer
Status stage transition
RDST
Control read transfer
CTRE Status stage transition
CMPL
CTRT
Control transfer complete
SERR
Control transfer sequence error
Setup stage complete
<<<Interrupt Enable Register 3>>>
EPB_EMPE
b6 ~ b1 b0 <<Interrupt Status Register 3>>>
EPB_EMP_OVR
b6
~
BEMPE
b1
BEMP
b0
ReadOnly
Endpoint 0:
• Control Transfer Control Register
• EP0 Packet Size Register
• EP0_FIFO Continuous Transmit Data Length Register
Endpoint 1~6:
• EPi Configuration Register 0
• EPi Configuration Register 1
3.2.2 Buffer Access
The buffers of endpoints 0 to 6 can be accessed by the four data registers as follows:
<EP0_FIFO Data Register>
• Quantity : 1 piece
• Exclusively used for endpoint 0
<CPU_FIFO Data Register >
• Quantity : 1 piece
• Shared with endpoints 1 to 6 (specified by the CPU_EP bits)
<Dn_FIFO Data Register >
• Quantity : 2 pieces
• Shared with endpoints 1 to 6 (specified by the DMA_EP bits)
• Can be accessed by DMAC
These four data registers can be set independently to 8-bit/16-bit mode by the Octl bit.
ACK Receive
data IVAL bit ="0"
NAK Receive
data IVAL bit ="1"
Note 1. Response to the host when EP0_PID/EPn_PID bits are set to "01(BUF)".
Accessable
Note 2. About the receives completion, refer to the follows:
z Endpoint 0
Not accessable
CTRW bit of Control Transfer Control Register
z O thers endpoint 0
EPnRW MD bit of EPn Configuration Register
Figure 3.2 Relation between Buffer State and IVAL Bit (when set to OUT buffer)
Response (Note1) SIE bus SIE side buffer CPU side buffer CPU bus
NAK Empty IVAL bit ="0"
Note 1. Response to the host when EP0_PID/EPn_PID bits are set to "01(BUF)".
Accessable
Note 2. About the transmit/write completions, refer to the follows:
z Endpoint 0
Not accessable
CTRR bit of Control Transfer Control Register
z O thers endpoint 0
EPnRW MD bit of EPn Configuration Register
Figure 3.3 Relation between Buffer State and IVAL Bit (when set to IN buffer)
Endpoint 0 Fix
EP0_FIFO Data Register
Endpoint 1
CPU_FIFO Data Register
IVAL IVAL bit (CPU_FIFO Control Register)
Endpoint 2
D0_FIFO Data Register
IVAL IVAL bit (D0_FIFO Control Register)
Endpoint 3
D1_FIFO Data Register
z
z z
z z
z z
z
Endpoint i Designates by DMA_EP bit
Dn_FIFO Data Register
IVAL IVAL bit (Dn_FIFO Control Register)
1 16
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
DMA_REQ DMA_REQ
DMA_ACK DMA_ACK
W rite Read
Data Data
Input O utput
DMA_REQ DMA_REQ
DMA_ACK DMA_ACK
Data Data
Input O utput
• T he read/write pin is ignored. • T he read/write pin is ignored.
DMA_REQ DMA_REQ
W rite Read
Data Data
Input O utput
• T he DMA_ACKn/read pin is ignored. • T he DMA_ACKn/write pin is ignored.
Note: T his figure indicates the DMA_REQ and DMA_ACK pins at "L" active.
DMA_REQ DMA_REQ
DMA_ACK DMA_ACK
W rite Read
Data Data
Input Input Input Output Output Output
DMA_REQ DMA_REQ
Address ∗ ∗ ∗ Address ∗ ∗ ∗
W rite Read
Data Data
Input Input Input Output Output Output
Note: T his figure indicates the DMA_REQ and DMA_ACK pins at "L" active.
The examples of control write transfer, control read transfer, control write no data transfer, control transfer
error and continuous setup operations are shown in Figure 3.7 to Figure 3.12.
When the setup token is received, the VALID bit is set to “1”, the EP0_PID and CCPL bits are changed as
shown below, then these bits are protected until the VALID bit is cleared:
• EP0_PID bits “00” : NAK response (response at data stage)
• CCPL bit “0” : NAK response (response at status stage)
VALID='1'
DATA0 8 bytes data (CW) CRC16 EP0_PID="00"
CCPL='0'
ACK
Interrupt
CTRT='1'
CTSQ ="011" CTRT interrupt confirm
OUT ADDR EP CRC5 CTRT interrupt clear
VALID clear
Request data analysis
DATA1 MAX packet size data CRC16 CTRT='0'
VALID='0'
NAK
VALID='1'
VALID confirm
OUT ADDR EP CRC5
VALID='0'
DATA1 MAX packet size data CRC16 Execute the following Abandon request data
processing on the basis of the analysis result
request data analysis result. Wait for the next CTRT
NAK Set the EP0 response PID to interrupt
EP0_PID = "01" BUF (“01”).
OUT ADDR EP CRC5
ACK
ACK
Interrupt
INTR= '1'
EPB_RDY[0] interrupt confirm
EPB_RDY[0]='1'
IN ADDR EP CRC5 Read receive data from EP0_FIFO
EPB_RDY[0]='0'
Interrupt
CTRT='1'
NAK
CTSQ ="100" CTRT interrupt confirm
CTRT interrupt clear
IN ADDR EP CRC5
CTRT='0'
NAK
Transmit problem
no-problem confirm
IN ADDR EP CRC5
NAK No-problem
ACK
Interrupt
CTRT='1'
CTSQ ="000" CTRT interrupt confirm
CTRT interrupt clear
CTRT='0'
SETUP : SETUP PID DATA0 : DATA0 PID
OUT : OUT PID DATA1 : DATA1 PID
IN : IN PID CR : Control read transfer : Data to device from host
ADDR : USB address (H'00~H'7F) CW : Control write transfer ACK : ACK PID
EP : Endpoint (H'0~H'3) ND : Control no data transfer NAK : NAK PID : Data to host from device
CRC5 : 5 bits CRC CRC16 : 16 bits CRC STALL : STALL PID
VALID='1'
DATA0 8 bytes data (CR) CRC16 EP0_PID="00"
CCPL='0'
ACK
Interrupt
CTRT='1'
CTSQ ="001" CTRT interrupt confirm
CT RT interrupt clear
IN ADDR EP CRC5 VALID clear
Request data analysis
CTRT='0'
NAK VALID='0'
VALID='1'
VALID confirm
IN ADDR EP CRC5
VALID='0'
ACK
IN ADDR EP CRC5
ACK
Interrupt
CTRT='1'
CTSQ ="010" CTRT interrupt confirm
O UT ADDR EP CRC5
CT RT interrupt clear
CTRT='0'
DATA1 CRC16 (0 byte length data)
O UT ADDR EP CRC5
No-problem
DATA1 CRC16 (0 byte length data) Set the CCPL Set EP0 response
CCPL = '1' PID to STALL("1x")
ACK
Interrupt
CTRT='1'
CTSQ ="000" CTRT interrupt confirm
CT RT interrupt clear
CTRT='0'
VALID='1'
DATA0 8 bytes data (ND) CRC16 EP0_PID="00"
CCPL='0'
ACK Interrupt
CTRT='1'
CTSQ ="101" CTRT interrupt confirm
IN ADDR EP CRC5
CTRT interrupt clear
VALID clear
Request data analysis
NAK
CTRT='0'
VALID='0'
IN ADDR EP CRC5
VALID='1'
VALID confirm
NAK
NAK
No-problem
IN ADDR EP CRC5
Execute the following
Set EP0 response
processing on the basis of the
PID to STALL("1x")
NAK request data analysis result.
1. Set the EP0 response PID
to BUF ("01")
EP0_PID = "01" 2. Set the CCPL
IN ADDR EP CRC5 CCPL='1'
ACK
Interrupt
CTRT='1'
CTSQ ="000" CTRT interrupt confirm
CTRT interrupt clear
CTRT='0'
SETUP : SETUP PID CR : Control read transfer : Data to device from host
OUT : OUT PID CW : Control write transfer
IN : IN PID ND : Control no data transfer : Data to host from device
ADDR : USB address (H'00~H'7F) CRC16 : 16 bits CRC
EP : Endpoint (H'0~H'3) ACK : ACK PID
CRC5 : 5 bits CRC NAK : NAK PID
DATA0 : DATA0 PID STALL : STALL PID
DATA1 : DATA1 PID
VALID='1'
DATA0 8 bytes data (CR) CRC16 EP0_PID="00"
CCPL='0'
ACK
Interrupt
CTRT='1'
CTSQ ="001" CTRT interrupt confirm
CTRT interrupt clear
IN ADDR EP CRC5 VALID clear
Request data analysis
CTRT='0'
NAK VALID='0'
VALID='1'
VALID confirm
IN ADDR EP CRC5
VALID='0'
STALL
Interrupt
CTRT='1'
CTSQ ="110" CTRT interrupt confirm
EP0_PID="10" CTRT interrupt clear
CTRT='0'
SETUP ADDR EP CRC5
VALID='1'
DATA0 8 bytes data(CR) CRC16 EP0_PID="00"
CCPL='0'
ACK
Interrupt
CTRT='1'
CTSQ ="001" CTRT interrupt confirm
IN ADDR EP CRC5 CTRT interrupt clear
VALID clear
Request data analysis
NAK
VALID='1'
DATA0 8 bytes data (CR) CRC16 EP0_PID="00"
CCPL='0'
ACK
Interrupt
CTRT='1'
CTSQ ="001" CTRT interrupt confirm
IN ADDR EP CRC5
CTRT interrupt clear
VALID clear
Request data analysis
NAK
CTRT='0'
VALID='0'
IN ADDR EP CRC5
CTRT interrupt confirm
CTRT interrupt clear
NAK VALID clear
Request data analysis
IN ADDR EP CRC5
VALID='1'
VALID confirm
NAK
VALID='0'
ACK
SETUP : SETUP PID CR : Control read transfer : Data to device from host
OUT : OUT PID CW : Control write transfer
IN : IN PID ND : Control no data transfer : Data to host from device
ADDR : USB address (H'00~H'7F) CRC16 : 16 bits CRC
EP : Endpoint (H'0~H'3) ACK : ACK PID
CRC5 : 5 bits CRC NAK : NAK PID
DATA0 : DATA0 PID STALL : STALL PID
DATA1 : DATA1 PID
VALID='1'
DATA0 8 bytes data (CR) CRC16 EP0_PID="00"
CCPL='0'
ACK
Interrupt
CTRT='1'
CTSQ ="001" CTRT interrupt confirm
CTRT interrupt clear
IN ADDR EP CRC5 VALID clear
Request data analysis
CTRT='0'
NAK VALID='0'
VALID='1'
VALID confirm
IN ADDR EP CRC5
VALID='0'
ACK
VALID='1'
DATA0 8 bytes data (CR) CRC16 EP0_PID="00"
CCPL='0'
ACK
Interrupt
CTRT='1'
CTSQ ="001" CTRT interrupt confirm
IN ADDR EP CRC5 CTRT interrupt clear
VALID clear
Request data analysis
NAK
VALID='1'
IN ADDR EP CRC5 VALID confirm
NAK VALID='0'
SETUP : SETUP PID CR : Control read transfer : Data to device from host
OUT : OUT PID CW : Control write transfer
IN : IN PID ND : Control no data transfer : Data to host from device
ADDR : USB address (H'00~H'7F) CRC16 : 16 bits CRC
EP : Endpoint (H'0~H'3) ACK : ACK PID
CRC5 : 5 bits CRC NAK : NAK PID
DATA0 : DATA0 PID STALL : STALL PID
DATA1 : DATA1 PID
3.5 Enumeration
Figure 3.13 shows the overview of enumeration operations.
Powered state
Initialize procedure
(DVSQ ="000")
USBbus connect
(PC power O N etc.)
Vbus interrupt
FullSpeed
device notification
(Set the T r_O N bits)
FullSpeed
device recognition
G ET_DESCRIPT O R
request (ADDR=0) Control transfer
stage transition
interrupt
Descriptor
data set
Descriptor receive
Device state
SET_ADDRESS
Address state transition interrupt
request
(DVSQ ="010") (SetAddress)
Control transfer
stage transition interrupt
(at disabled autom atic
SetAddress procedure
response)
G ET_DESCRIPT O R
request (ADDR ≠ 0) Control transfer
stage transition
interrupt
Descriptor
data set
Descriptor receive
Device state
SET _CO NFIG URAT IO N Configured transition interrupt
request
state (SetConfiguration)
(DVSQ ="011") Control transfer
stage transition interrupt
(at disabled autom atic
Configuration receive
response)
W hen select to 8-bit bus width W hen select to 16-bit bus width
RST RST
X : Don’t care
Hi-Z : High impedance
Note 1: The D15/A0 become input pins, while the others depend on the ports setting.
Note 2: The above figure is not applicable when accessing to the FIFO Data Register.
CS
HWR
LW R
D15~8
D7~0
CS
H W R/ "L"
BYT E
LW R
D7~0
Note: The above figures are not applicable when accessing the FIFO Data Register.
3.5.6 Clock
48 MHz clock is needed for the internal operation of the M66291.
A built-in PLL enables an external clock of 6, 12, 24, or 48 MHz to be input. Selection is realized by XTAL bit
of the USB Operation Enable Register. When an external 48 MHz clock is used, the PLL is not needed, so the
PLL operation should be disabled.
A built-in oscillation buffer enables the device to be clocked from a crystal unit.
The device is set to standby state by the USB Operation Enable Register. Oscillation is halted (clock input
halted) by XCKE bit, PLL is halted by PLLC bit, and clock supply to the USB block is halted by SCKE bit.
To prevent unstable behavior, clock supply to USB block must be applied as follow:
a. Enables clock input by the XCKE,
b. Wait until oscillation stabilizes,
c. Start PLL by the PLLC bit,
d. Wait until PLL oscillation stabilizes (less than 1ms),
e. then start clock supply to USB block by the SCKE bit.
4 ELECTRICAL CHARACTERISTICS
Icc(S) Supply current in static mode Note 7 Oscillator disable, PLL disable, 30 200 uA
USB transceiver enable,
TrON=H/L output
*CS,*HWR/*BYTE,*LWR,
*Dack0,*Dack1=IOVcc,
D15-0=0 ~ IOVcc,
Other input VI=IOVcc or GND
IOVcc = 3.6V,CoreVcc=3.6V
Vbus=5.0V, suspend state
Icc(S) Supply current in static mode Note 7 Oscillator disable, PLL disable, 10 100 uA
USB transceiver enable,
TrON=Hi-Z
*CS,*HWR/*BYTE,*LWR,
*Dack0,*Dack1=IOVcc,
D15-0=0 ~ IOVcc,
Other input VI=IOVcc or GND
IOVcc = 3.6V,CoreVcc=3.6V
Vbus=GND, H/W reset state
Icc(S) Supply current in static mode Note 7 Oscillator disable, PLL disable, 30 200 uA
USB transceiver enable,
TrON=H/L output
*CS,*HWR/*BYTE,*LWR,
*Dack0,*Dack1=IOVcc,
D15-0=0 ~ IOVcc,
Other input VI=IOVcc or GND
IOVcc = 5.5V,CoreVcc=3.6V
Vbus=5.0V, suspend state
Icc(S) Supply current in static mode Note 7 Oscillator disable, PLL disable, 10 100 uA
USB transceiver enable,
TrON=Hi-Z
*CS,*HWR/*BYTE, *LWR,
*Dack0,*Dack1=IOVcc,
D15-0=0 ~ IOVcc,
Other input VI=IOVcc or GND
IOVcc = 5.5V,CoreVcc=3.6V
Vbus=GND,H/W reset state
4.5.2 AC Characteristics
Vcc
Input Vcc Item SW 1 SW 2
R L =1k Ω close open
tdis(CTRL(LZ))
SW 1 tdis(CTRL(HZ)) open close
D15-0 ta(CT RL(ZL)) close open
SW 2 ta(CT RL(ZH)) open close
Elem ents to CL
P.G. R L =1k Ω
be m easured (1) Input pulse level : 0 ~ 3.3V, 0 ~ 5.0V
Input pulse rise/fall time : tr,tf=3ns
D15-0 other output Input timing standard voltage : IO Vcc/2
50 Ω O utput timing judge voltage : IO Vcc/2
(The tdis (LZ) is judged by 10% of the
CL output amplitude and the tdis (HZ) by
G ND 90% of the output amplitude.)
(2) T he electrostatic capacity CL includes
the stray capacitance of the wire
connection and the input capacitance
of the probe.
Vcc
Vcc
R L =1.5K Ω
(1) T he tr and tf are judged by the trans ition tim e of
D+
the 10% am plitude point and 90% am plitude point
res pec tively.
R L =27 Ω
E lem ents to R L = 15k Ω CL (2) T he elec tros tatic c apac ity C L inc ludes the s tray
c apac itanc e of the w ire c onnec tion and the
be m easured D- input c apac itanc e of the probe.
R L =27 Ω
R L = 15k Ω CL
GND
32
tsuw(A) 30 thw(A)
A6-1
Address is established
(A6-0)
CS
40 tw(cycle) Note 1
34 trec(CTRL), trecr(CTRL)Note 1
tw(CTRL)
LW R
(HW R) 35 36
Note 2
38 39
tsu(D) th(D)
D15-0
Data is established
(D7-0) Note 7
ta(A ) 1
31 tsur(A ) thr(A ) 33
A 6-1 A ddress is established
(A 6-0)
CS
40 tw (cycle) N ote 1
ta(C T R L) 35 36
3 47
tw r(C T R L) trec(C T R L), trecr(C T R L)
RD tv(A ) 2
N ote 3
tv(C T R L) 4
ten(C T R L)
5
tdis(C T R L) 6
D 15-0
(D 7-0) D ata is established
N ote 7
tdis(CTRL-Dreq) twh(Dreq) 16
Dreq 7
Note 4 ten(CTRL-Dreq)
18
Dack
17
ten(Dack-Dreq)
34
tw(CTRL)
LW R
(HW R)
Note 5 38
tsu(D) th(D) 39
D15-0
Data is established
(D7-0)
Note 7
D req 7
ten(C T R L-D req )
N ote 4
18
D ack
17
3
ta(C T R L) ten(D a ck-D req )
tw r(C T R L) 47
RD
N ote 6
tv(C T R L )
4
ten(C T R L)
5
tdis(C T R L ) 6
D 15 -0
(D 7-0) D ata is established
N o te 7
Note 4: *Dack="L" level is the condition for inactive *Dreq, and the latter signal of twh(Dreq) or ten(CTRL-Dreq)
becomes valid as the specification of active *Dreq at the time of next DMA transfer.
Note 5: Writing through the combination of *Dack, *HWR and *LWR is carried out during the overlap of active (“L”).
The specification of the rising edge is valid from the earliest inactive signal.
The specification of pulse width is valid during the overlap of active (“L”).
Note 6: Reading through the combination of *Dack and *RD is carried out during the overlap of active (“L”).
The specification from the falling edge is valid from the latest active signal.
The specification from the rising edge is valid from the earliest inactive signal.
The specification of pulse width is valid during the overlap of active (“L”).
Note 7: In 8-Bit Mode, D7~0 becomes valid.
tdis(Dack-Dreq) twh(Dreq) 16
Dreq 8
Note 4
tw(Dack) 37 ten(Dack-Dreq) 17
Dack
38 39
tsu(D) th(D)
D15-0
Data is established
(D7-0)
Note 7
twh(Dreq) 16
Dreq
Note 4
tdis(Dack-Dreq) 8 ten(CTRL-Dreq) 18
Dack tw(Dack) 37
tdis(Dack)
ta(Dack) 12
9
tv(Dack)
ten(Dack) 11
10
D15-0
Data is established
(D7-0)
Note 7
Note 4: *Dack="L" level is the condition for inactive *Dreq, and the latter signal of twh(Dreq) or ten(Dack-Dreq)
becomes valid as the specification of active *Dreq at the time of next DMA transfer.
Note 7: In 8-Bit Mode, D7~0 becomes valid.
13 16
tdis(CTRLH-Dreq) twh(Dreq)
Dreq 18
ten(CTRL-Dreq)
thd(A)
tsud(A) 41 42
A6-1
Address is established
(A6-0)
CS
Note 2
34
tw(CTRL)
LW R
(HW R)
Note 2
38 39
tsu(D) th(D)
D15-0
Data is established
(D7-0)
Note 7
Note 2: Writing through the combination of *CS, *HWR and *LWR is carried out during the overlap of active (“L”).
The specification of the rising edge is valid from the earliest inactive signal.
The specification of pulse width is valid during the overlap of active (“L”).
Note 7: In 8-Bit Mode, D7~0 and A6~0 become valid.
7 thw(Dreq) 16
tdis(CTRL-Dreq)
Dreq 18
ten(CTRL-Dreq)
ta(A) 1
31 tsur(A) thr(A) 33
A6-1 Address is established
(A6-0)
CS
Note 3
ta(CTRL)
3 47
twr(CTRL)
RD tv(A) 2
Note 3
tv(CTRL) 4
ten(CTRL)
5
tdis(CTRL) 6
D15-0
(D7-0) Data is established
Note 7
Note 3: Reading through the combination of *CS and *RD is carried out during the overlap of active (“L”).
The specification of the falling edge is valid from the latest active signal.
The specification of the rising edge is valid from the earliest inactive signal.
The specification of pulse width becomes valid during the overlap of active (“L”).
Note 7: In 8-Bit Mode, D7~0 and A6~0 become valid.
7 tdis(CTRL-Dreq)
Dreq
Dack
RD
34 tw(CTRL) trec(CTRL) 35
LW R
(HW R) 40
Note 5
tw(cycle)
D15-0
(D7-0)
Note 7 38 39
tsu(D) th(D)
7 tdis(CTRL-Dreq)
Dreq
Dack
47 twr(CTRL) trec(CTRL)
35
RD
Note 6
tw(cycle) 40
LW R
(HW R)
tv(CTRL)
3 ta(CTRL) 4
D15-0
(D7-0)
Note 7
Note 5: Writing through the combination of *Dack, *HWR and *LWR is carried out during the overlap of active (“L”):
The specification of the rising edge is valid from the earliest inactive signal.
The specification of pulse width becomes valid during the overlap of active (“L”).
Note 6: Reading through the combination of *Dack and *RD is carried out during the overlap of active (“L”).
The specification from the falling edge is valid from the latest active signal.
The specification from the rising edge is valid from the earliest inactive signal.
The specification of pulse width becomes valid during the overlap of active (“L”).
Note 7: In 8-Bit Mode, D7~0 becomes valid.
tsuw(A) thw(A)
30 32
CS
7 tdis(CTRL-Dreq)
Dreq
RD
34 tw(CTRL) trec(CTRL) 35
LW R
(HW R) 40
Note 5
tw(cycle)
D15-0
(D7-0)
Note 7 38 39
tsu(D) th(D)
1 ta(A)
tsur(A) thr(A) 33
31
CS
7
tdis(CTRL-Dreq)
Dreq
47 twr(CTRL) trec(CTRL)
35
RD
Note 6
tw(cycle) 40
LW R
(HW R)
tv(A) 2
4
3 ta(CTRL) tv(CTRL)
D15-0
(D7-0)
Note 7
Note 5: Writing through the combination of *Dack, *HWR and *LWR is carried out during the overlap of active (“L).
The specification from the rising edge is valid from the earliest inactive signal.
The specification of pulse width becomes valid during the overlap of active (“L”).
Note 6: Reading through the combination of *Dack and *RD is carried out during the overlap of active (“L”).
The specification from the falling edge is valid from the latest active signal.
The specification from the rising edge is valid from the earliest inactive signal.
The specification of pulse width becomes valid during the overlap of active (“L”).
Note 7: In 8-Bit Mode, D7~0 becomes valid.
(3-5) TC timing
48 td1(Dack-TC)
td2(Dack-TC)
49
Dack Dack
TC TC
15
twh(INT)
INT
14
td(CTRL-INT)
CS, LW R
(HW R)
Note 2
43
tw(RST)
RST
44
tst(RST)
CS, LW R
(HW R)
Note 2
Note 2: Writing through the combination of *CS, *HWR and *LWR is carried out during the overlap of active (“L”).
The specification from the rising edge is valid from the earliest inactive signal.
RST 46
45 tsu(BYTE) th(BYTE)
Description
Rev. Date
Page Summary
1.00 Apr 9, 2001 - First edition issued
Modified:
1,6
USB Specification Revision 2.0
Added:
3
M66291HP Pin Configration
Moved:
9
How to Read Register Tables
1.01 Nov 1, 2004
10,42,43,60, Modified:
69,77,78 M66291
Modified:
102
4.2 Recommended Operating Conditions (CoreVcc,Topr)
Added:
125
52PJV-A PKG Code.
48P6Q-A MMP Plastic 48pin 7✕7mm body LQFP
EIAJ Package Code JEDEC Code Weight(g) Lead Material MD
LQFP48-P-77-0.50 – – Cu Alloy
ME
HD
b2
D
48 37
I2
Recommended Mount Pad
1 36
Dimension in Millimeters
Symbol
Min Nom Max
HE
E A – – 1.7
A1 0 0.1 0.2
A2 – 1.4 –
12 25 b 0.17 0.22 0.27
c 0.105 0.125 0.175
13 24 D 6.9 7.0 7.1
A E 6.9 7.0 7.1
e – 0.5 –
F HD 8.8 9.0 9.2
L1 HE 8.8 9.0 9.2
e
L 0.35 0.5 0.65
L1 – 1.0 –
A2
A3
Lp 0.45 0.6 0.75
A3 – 0.25 –
x – – 0.08
A1
y L
c y – – 0.1
b 0° – 8°
x M Detail F Lp
b2 – 0.225 –
I2 1.0 – –
MD – 7.4 –
ME – 7.4 –
52PJV-A Plastic 52pin 7 X 7mm body VQFN
Sales Strategic Planning Div. Nippon Bldg., 2-6-2, Ohte-machi, Chiyoda-ku, Tokyo 100-0004, Japan