28 USB FUNCTION CONTROLLER (USB)
28-16
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
FIFO Management
28.5.2
FIFO memory map
This section describes the memory map for the FIFO region.
EPc Area
EPd Area
EPb Area
EPa Area
Descriptor Area
EP0 Area
(Single Buffer)
0x000
(EP0MaxSize)
EPaStartAdrs
EPbStartAdrs
== EPaEndAdrs
EPcStartAdrs
== EPbEndAdrs
EPdStartAdrs
== EPcEndAdrs
5.2.1 FIFO Memory Map
Figure 28.
The FIFO memory is roughly divided into six areas: EP0 area, descriptor area, EPa area, EPb area, EPc area,
and EPd area, and each of these areas can be divided according to the settings for the EP0MaxSize register,
EPaStartAdrs register, EPbStartAdrs register, EPcStartAdrs register, and EPdStartAdrs register.
The EP0 area is used for the required USB endpoint 0, and can be used both for IN and OUT directions. This
area is uniquely determined to be the maximum packet size of endpoint 0 that is set up in the EP0MaxSize reg-
ister. This means that it can only receive/transmit one packet (Single Buffer) at a time.
EPa, EPb, EPc, and EPd areas are for the general-purpose endpoint that can take an endpoint number and an IN/
OUT setting. The EPa area extends from the address set in the EPaStartAdrs register up to the point before the
address set in the EPbStartAdrs register. The EPb area extends from the address set in the EPbStartAdrs register
up to the point before the address set in the EPcStartAdrs register. The EPd area extends from the address set in
the EPdStartAdrs register up to the end of FIFO RAM. The addresses available in the area setup registers must
be written in the unit of four bytes (meaning that the lowest two bits cannot be written). Additionally, a space
exceeding the maximum packet size must be assigned to these areas. Although there should be no problem as
far a value larger than the maximum packet size is assigned, we recommend that you use its integral multiple to
set them up.
The descriptor area extends from the address set in the EP0MaxSize register up to the point before the address
set in the EPaStartAdrs. (Actually, the entire FIFO region can be used as the descriptor area. We recommend,
however, that the area described here be used in order to avoid operational contentions.) The practical use is de-
scribed later.
Set the EPnControl.AllFIFO_Clr bit for the initial setting or re-setting of an area set-up register. Once the initial
setting for an area is established, the EPnControl.AllFIFO_Clr bit is cleared. This bit will never cause the RAM
data to be cleared. Therefore, unless you have changed the descriptor area, there is no need to re-set the infor-
mation recorded within the area since will never be cleared otherwise.