AN2294 Freescale Semiconductor / Motorola, AN2294 Datasheet

no-image

AN2294

Manufacturer Part Number
AN2294
Description
MC68SZ328 USB Configuration Setup Application Note
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
This document contains information on a product under development. Motorola reserves the right to change or
discontinue this product without notice. © Motorola, Inc., 2002. All rights reserved.
Application Note
AN2294/D
Rev. 1.1, 07/2003
MC68SZ328 USB
Configuration Setup
By Ed Kroitor
Contents
1 Introduction . . . . . . . . . . 1
1.1 USB Overview . . . . 1
2 Hardware Interface . . . . 2
2.1 Bus and Power
2.2 Transceiver . . . . . . 2
2.3 USB Crystal
3 Software Interface . . . . . 4
3.1 Initialization . . . . . . 4
3.2 Programming the
3.3 Receive and Transmit
Management
Configuration . . . . . 3
USB Device Core
(UDC)
Data . . . . . . . . . . . 15
2
9
1 Introduction
Due to the advancement of computers and computer peripherals, older systems of peripheral
communications have been replaced with new and faster technologies. Older technologies
such as the RS-232 have changed little since their introduction. Even though this
communication interface served as a cornerstone of serial communication, modern
applications demanded higher speed data transfers coupled with the ability to be hot
swappable. The creation of the USB (Universal System Bus) specification provides a high
speed method of data communications with true plug-and-play connectivity. The DragonBall
family of microprocessors has taken advantage of this advanced technology by introducing a
USB module within the Super VZ (MC68SZ328) DragonBall microprocessor. This
application note provides the information to configure the essential registers used to establish
communication via USB between a PC host and the DragonBall MC68SZ328 device.
1.1 USB Overview
The Universal System Bus module that is currently in the MC68SZ328 processor can only be
used for full speed mode (12 Mbps).
1.1.1 Endpoints and Types of Transfer
The DragonBall MC68SZ328 provides five physical FIFO registers (endpoints) that can be
used for communication with a host. These endpoints are used for the different types of
transfer that can be accomplished with the MC68SZ328 USB module. The data transfers
supported are control, interrupt, and bulk. The MC68SZ328 USB does not support
isochronous transfers.
Control endpoints are specifically used to inform the host or device about the data transfer
and the required setup information between host and client. Because endpoint zero represents
the control transfer buffer, it must be used for all data transfers. Endpoints one through four
are used for bulk or interrupt transfers and they can be configured by setting the desired bits
in the USB module registers.
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2294

AN2294 Summary of contents

Page 1

... Freescale Semiconductor, Inc. Application Note AN2294/D Rev. 1.1, 07/2003 MC68SZ328 USB Configuration Setup 1 Introduction By Ed Kroitor Contents Due to the advancement of computers and computer peripherals, older systems of peripheral 1 Introduction . . . . . . . . . . 1 communications have been replaced with new and faster technologies. Older technologies 1.1 USB Overview . . . . 1 such as the RS-232 have changed little since their introduction. Even though this 2 Hardware Interface ...

Page 2

Freescale Semiconductor, Inc. Hardware Interface 1.1.2 Pipes Pipes are abstract links between the host and the device. These links are not physical, instead, they are software relationships important to understand pipes relative to the types of data exchange ...

Page 3

Freescale Semiconductor, Inc. Figure 1. Connection From MC68SZ328 to the Transceiver Using USB Outputs Components R313, C252, R314 and C253 are not installed normally, they serve the purpose of fine tuning the circuit. 2.3 USB Crystal Configuration The USB uses ...

Page 4

Freescale Semiconductor, Inc. Software Interface Figure 3. 16 MHz Crystal Configuration Hardware 3 Software Interface This section provides the information to initialize the USB module with the host, program the USB Device Core (UDC) registers, and receive and transmit data. ...

Page 5

Freescale Semiconductor, Inc. UPFSR0 USBPLL Frequency Select Register 0 BIT UMFI TYPE RESET Figure 5. USBPLL Frequency Select Register 0 As these registers show, the values ...

Page 6

Freescale Semiconductor, Inc. Software Interface Table 2. Corresponding UPDF to the UPFSR1 Register Input Values (Continued) 3.1.2 Clock Configuration As shown in Figure 2 and Figure 3, there are two different clocks that can be used to drive the USB ...

Page 7

Freescale Semiconductor, Inc. The results are 192 MHz. However, because USBCDIV / 4 (CSCR bit 13-11) the USB_CLK output frequency will be 48 MHz. Refer to the Code Example 1 on page 8 for more information on programming the USBPLL ...

Page 8

Freescale Semiconductor, Inc. Software Interface Code Example 1. Programming the USBPLL Registers void init_USBPLL(void using 32.768 KHz crystal. */ reg_CSCR= 0x4C04; reg_UPFSR0= 0x2969; reg_UPFSR1= 0x01f3; reg_PLLCR= 0x6400; reg_CSCR= 0x4c03; void init_USBPLL(void using 16 MHz crystal. */ ...

Page 9

Freescale Semiconductor, Inc. 3.2 Programming the USB Device Core (UDC) The USB Device Core implements most of the USB protocol in hardware. As shown in Figure 7, the UDC is the front-end device for communication with the USB transceiver and ...

Page 10

Freescale Semiconductor, Inc. Software Interface 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 ...

Page 11

Freescale Semiconductor, Inc. Code Example 2. Programming EndptBufs via the USB_DDAT //Setup information that will go into the EndPtBufs register static unsigned char epcfg[NUM_ENDPOINT][ 0x00,0x00,0x08,0x00,0x00 }, { int i,ep; for ( < NUM_ENDPOINT; ep++) ...

Page 12

Freescale Semiconductor, Inc. Software Interface Table 4. EndPBufs Register Description Table (Continued) Bit Field Type [31:29] AltSetting Alternate setting number—Maximum alternate settings. [28:27] Type Type of endpoint Control 01 = Reserved 10 = Bulk 11 ...

Page 13

Freescale Semiconductor, Inc. There will be only one EndPoint0 for the entire device and this EndPoint is associated to all configurations and interfaces in the device. The UDC ignores the values programmed in the Ep_Config, Ep_Interface, and Ep_AltSetting fields of ...

Page 14

Freescale Semiconductor, Inc. Software Interface 3.2.2 USB Module Endpoint Specific Registers The USB module Endpoint specific registers cover the memory address locations identified in Table 6. Table 6. Endpoint Specific Register Memory Address Range Endpoint Endpoint 0 Endpoint 1 Endpoint ...

Page 15

Freescale Semiconductor, Inc. 3.3 Receive and Transmit Data When receiving and transmitting data certain rules of engagement must be taken into account. The first distinction between both actions is the way that they are processed. Both actions transmit from the ...

Page 16

Freescale Semiconductor, Inc. Software Interface When the WFR bit is set, it tells the device that the next transaction that takes place is the last data word (either bit) for that particular transaction. Even byte size packets: ...

Page 17

Freescale Semiconductor, Inc. Code Example 5. Sending Packets void Send_Odd_Packet(U32 start, U32 end) { U32 i; // write first 2 bytes of last packet // for (i=start; i<end; i=i++) // { // _reg_USBD_EP0_FDAT_byte_access = (USB_CONFIG_DESC[i]); // count ...

Page 18

Freescale Semiconductor, Inc. Software Interface 3.3.2 Receiving Data Customize the program to read USB_EPn_ISR (n=0-4) bit 1. After this bit is set, the end-of-transfer interrupt enables. When set, it tells the device that the last packet of the transfer has ...

Page 19

Freescale Semiconductor, Inc. MOTOROLA For More Information On This Product, Motorola Confidential Proprietary, NDA Required / Draft # NOTES MC68SZ328 Application Note Go to: www.freescale.com 19 ...

Page 20

... Motorola and the Stylized M Logo are registered in the U.S. Patent and Trademark Office. All other product or service names are the property of their respective owners. Motorola, Inc Equal Opportunity/Affirmative Action Employer. © Motorola, Inc. 2002 AN2294/D For More Information On This Product, Go to: www.freescale.com ...

Related keywords