Top Banner

Click here to load reader

Embedded Programming Guide

Apr 24, 2015

ReportDownload

Documents

r4royalc

Philips SemiconductorsConnectivity

June 2002

AN10008-01

ISP1362 Embedded Programming GuideRev: 0.9

Revision History: Rev. Date 0.9 4/15/2002 0.81 1/3/2002 0.80 28/02/2002 0.70 19/02/2002 0.65 07/02/2002 0.61 05/02/2002 0.60 29/01/2002

Descriptions Added content on OTG Update on the Host Controller information Content on the Device Controller added Modification based on 9th Jan review OTG chapter added Complete the Host Controller information added Three advanced features

Author Wang Zhong Wei Ng Chee Yu Alvin Lim Ng Chee Yu Wang Zhong Wei Ng Chee Yu Ng Chee Yu

We welcome your feedback. Send it to [email protected]

Philips Semiconductors - Asia Product Innovation Centre Visit http://www.flexiusb.com

Connectivity

2 of 99

ISP1362 Embedded Programming Guide

Rev. 0.9

This is a legal agreement between you (either an individual or an entity) and Philips Semiconductors. By accepting this product, you indicate your agreement to the disclaimer specified as follows:

DISCLAIMERPRODUCT IS DEEMED ACCEPTED BY RECIPIENT. THE PRODUCT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, PHILIPS SEMICONDUCTORS FURTHER DISCLAIMS ALL WARRANTIES, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANT ABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. THE ENTIRE RISK ARISING OUT OF THE USE OR PERFORMANCE OF THE PRODUCT AND DOCUMENTATION REMAINS WITH THE RECIPIENT. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL PHILIPS SEMICONDUCTORS OR ITS SUPPLIERS BE LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, DIRECT, INDIRECT, SPECIAL, PUNITIVE, OR OTHER DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OUT OF THIS AGREEMENT OR THE USE OF OR INABILITY TO USE THE PRODUCT, EVEN IF PHILIPS SEMICONDUCTORS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

________________________________________________________________________________________________________ Philips Semiconductors - Asia Product Innovation Centre Visit www.flexiusb.com or www.semiconductors.philips.com/buses/usb

Connectivity

3 of 99

ISP1362 Embedded Programming Guide

Rev. 0.9

CONTENTS1. 2. 3. INTRODUCTION.......................................................................................................................................... 9 ISP1362 PROGRAMMERS MODEL............................................................................................................10 ACCESSING REGISTERS ............................................................................................................................ 11 3.1. SOFTWARE ACCESSIBLE HARDWARE COMPONENTS .................................................................................................11 3.2. I/O PORTS OF THE ISP1362..........................................................................................................................................12 3.3. BASIC REGISTER ACCESSES ............................................................................................................................................12 3.3.1. Reading and Writing of 8-Bit and 16-Bit Registers......................................................................................................12 3.3.2. Reading and Writing of 32-Bit Registers .....................................................................................................................13 3.3.3. I/O Functions ............................................................................................................................................................14 3.3.4. Example: Reading the Chip ID ..................................................................................................................................15 3.3.5. Example: Testing the HcScratch Register ....................................................................................................................16 4. ACCESSING HOST CONTROLLER BUFFERS........................................................................................16 4.1. INDIRECT ADDRESSING..................................................................................................................................................16 4.2. DIRECT ADDRESSING .....................................................................................................................................................17 4.2.1. Setting Up the HcDirectAddressLength Register..........................................................................................................18 4.2.2. Accessing Memory Using the Direct Addressing Mode .................................................................................................19 5. SETTING UP THE ISP1362 HOST CONTROLLER FOR USB OPERATIONS ....................................19 5.1. SETTING UP THE BUILT-IN HOST CONTROLLER BUFFER ........................................................................................19 5.2. SETTING UP REGISTERS .................................................................................................................................................19 5.2.1. Control and Status Setup ............................................................................................................................................20 5.2.2. Frame Counter Setup..................................................................................................................................................20 5.2.3. Root Hub Setup .........................................................................................................................................................21 5.2.4. Interrupt Setup ...........................................................................................................................................................22 5.2.5 Hardware Configuration Setup......................................................................................................................................23 5.3. HOST CONTROLLER IN THE OPERATIONAL MODE ...................................................................................................23 6. BASIC USB TRANSFER ...............................................................................................................................25 6.1. PREPARING OR FORMATTING DATA IN THE PTD .....................................................................................................25 6.1.1. Generic PTD fields .....................................................................................................................................................26 6.1.2. Traffic Specific Fields ..................................................................................................................................................26 6.2. COPYING DATA TO THE ISP1362 .................................................................................................................................26 6.3. ACTIVATING THE ISP1362 AND CHECKING TRANSFER STATUS .............................................................................27 6.3.1. Overall Buffer-Level ActivationHcBufferStatus Register ..........................................................................................27 6.3.2. Block-Level ActivationHcATLSkipMap and HcATLLastPTD..........................................................................27 6.4. CHECKING STATUS OF THE ATL TRANSFER...............................................................................................................28 6.4.1. Checking the PTD (Polling)........................................................................................................................................28 6.4.2. Checking HcATLDoneMap (Polling) ........................................................................................................................28 6.4.3. Interrupt Driven Checking ..........................................................................................................................................28 6.5. NOT ACKNOWLEDGE (NAK)........................................................................................................................................28 6.6. POST-TRANSFER PROCESSING .......................................................................................................................................28 6.7. EXAMPLE: SENDING OUT A SETUP TOKEN ...............................................................................................................28 6.7.1. Constructing the PTD.................................................................................................................................................29 6.7.2. Activating the PTD....................................................................................................................................................29 6.7.3. Looking at the Result..................................................................................................................................................29 6.8. ERROR HANDLING ..........................................................................................................................................................30 7. CASE STUDY: USB MOUSE ........................................................................................................................30________________________________________________________________________________________________________ Philips Semiconductors - Asia Product Innovation Centre Visit www.flexiusb.com or www.semiconductors.philips.com/buses/usb

Connectivity

4 of 99

ISP1362 Embedded Programming

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.