AN2294 Freescale Semiconductor / Motorola, AN2294 Datasheet - Page 10

no-image

AN2294

Manufacturer Part Number
AN2294
Description
MC68SZ328 USB Configuration Setup Application Note
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Software Interface
To program all required 40 bits (5 bytes) per endpoint into the EndPtBufs buffer, the information must be
programmed into the DDAT field byte per byte. The USB Device Core in the MC68SZ328 processor has
five EndPutBuf registers that must be programmed. Each register represents one endpoint (Ep0–EP4).
Once loaded, the values in these buffers cannot be changed while the device is powered on.
The first EndPtBuf is reserved for information about control endpoint (or endpoint 0). The value for this
register is always 0x0000080000. Figure 9 on page 11 explains the EndPtBuf register.
When entering the endpoint buffer (EndPtBufs) information to the USB_DDAT register, the first byte
written is EPn[39:32] and the last byte written is EPn[7:0]. After writing each byte, and before performing
any other operation on the USB module, check that the BSY bit and the CFG bit have cleared in the
USB_CFGSTAT register. This check tells the program when the byte is written to the UDC, therefore
allowing the device to program this DDAT field with the byte, USB_CFGSTAT = 0x0000 0000.
Code Example 2 shows how to program the EndptBufs via the USB_DDAT field.
10
USB_DDAT
RESET
RESET
TYPE
TYPE
BIT
BIT
2. Download configuration data (EndptBufs) to the device via the USB_DDAT register shown
in Figure 8.
EndptBufs—A personality file that contains the bytes of the five endpoint buffers (40 bits) that
loads directly into the UDC module via DDAT[7:0]. The EndPtBufs register contains the necessary
setup data for each endpoint while configuring the USB module in the MC68SZ328.
31
15
0
0
30
14
0
0
29
13
0
0
28
12
0
0
Freescale Semiconductor, Inc.
For More Information On This Product,
27
11
Figure 8. USB Endpoint Buffer Register
0
0
USB Endpoint Buffer Register
MC68SZ328 Application Note
26
10
0
0
Go to: www.freescale.com
25
0
9
0
24
0
8
0
0x0000
0x0001
23
rw
X
0
7
22
rw
X
0
6
21
rw
X
0
5
20
rw
DDAT[7:0]
X
0
4
19
rw
X
0
3
0x(FF)FE0414
18
rw
X
0
2
MOTOROLA
17
rw
0
1
X
Addr
16
rw
X
0
0

Related parts for AN2294