28 USB FUNCTION CONTROLLER (USB)
28-40
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
USB_Address (USB Address)
Register name Address
Bit
Name
Setting
Init. R/W
Remarks
USB_Address
(USB address)
0x300c38
(8 bits)
D7
AutoSetAddress
1 Auto set address
0 Do nothing
0
R/W
D6–0 USB_Address[6:0]
USB address
0x0 R/W
This register sets up the USB address.
D7
AutoSetAddress
Sets up the USB Address automatically. If this bit is set to 1 after receiving the SetAddress request and
before implementing the status stage, the address received by the SetAddress request will be written
into the USB_Address register when the status stage completes.
The processing procedure of the SetAddress request using this function is as follows.
(1) The SETUP transaction of the SetAddress request completes.
The RcvEP0SETUP bit of the MainIntStat register is set to 1. Read the EP0Setup_0–7 registers and
interpret the request.
(2) Set the AutoSetAddress bit.
(3) Set the INxOUT bit of the EP0Control register.
(4) Clear the ForceNAK bit of the EP0ControlIN register, and set the EnShortPkt bit.
(5) Wait for the end of the status stage.
The SetAddressCmp bit of the SIE_IntStat register is set to 1.
D[6:0]
USB_Address[6:0]
These bits set up the USB address.
The USB address is written automatically by the AutoSetAddress function. Or it can be written.
EP0Control (EP0 Control)
Register name Address
Bit
Name
Setting
Init. R/W
Remarks
EP0Control
(EP0 control)
0x300c39
(8 bits)
D7
INxOUT
1 In
0 Out
0
R/W
D6–1 –
–
–
–
0 when being read.
D0
ReplyDescriptor
1 Reply descriptor
0 Do nothing
0
W
This register sets up the endpoint EP0.
D7
INxOUT
Sets the transfer direction of the endpoint EP0.
Judging from the request received at the setup stage, set a value in this bit.
If the data stage exists, set the transfer direction at the data stage into this bit. As the setup of the
ForceNAK bits of the EP0ControlIN and EP0ControlOUT registers completes when the setup stage
completes, clear them during execution of the data stage or the status stage.
After the data stage is completed, set this bit again conforming to the direction of the status stage. When
the transfer direction of the data stage is IN, the transfer direction of the status stage is OUT. Therefore,
set this bit to 0. When the transfer direction of the data stage is OUT, or there is no data stage, the trans-
fer direction of the status stage is IN. Therefore, clear the FIFO of the endpoint EP0, and set this bit to 1.
For the IN or OUT transactions which have a transfer direction different from that of this bit, NAK re-
sponse is done. However, if the ForceSTALL bit of the EP0ControlIN or EP0ControlOUT register with
the transaction direction corresponding to the above one, is set, the STALL response will be done.
D[6:1]
Reserved
D0
ReplyDescriptor
Executes the Descriptor reply function.
If this bit is set to 1, this bit replies as much Descriptor data as specified as MaxPacketSize from the
FIFO, responding to the IN transaction of the endpoint EP0. The Descriptor data start from the address
specified in the DescAdrs_H, L register, and its data size is specified in the DescSize_H, L register.
Since these setting values are updated during execution of the Descriptor reply function, set these set-
ting values every time setting the ReplyDescriptor bit.