M MCP250XX Development Kit User’s Guide 2004 Microchip Technology Inc. DS51266C Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip's Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. No representation or warranty is given and no liability is assumed by Microchip Technology Incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. Use of Microchip’s products as critical components in life support systems is not authorized except with express written approval by Microchip. No licenses are conveyed, implicitly or otherwise, under any intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, MPLAB, PIC, PICmicro, PICSTART, PRO MATE and PowerSmart are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AmpLab, FilterLab, microID, MXDEV, MXLAB, PICMASTER, SEEVAL, SmartShunt and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Application Maestro, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, rfLAB, rfPIC, Select Mode, SmartSensor, SmartTel and Total Endurance are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. Serialized Quick Turn Programming (SQTP) is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2004, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received ISO/TS-16949:2002 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona and Mountain View, California in October 2003. The Company’s quality system processes and procedures are for its PICmicro® 8-bit MCUs, KEEL OQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified. DS51266C-page ii 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Table of Contents Preface ............................................................................................................................ 1 Chapter 1. Product Overview and Installation 1.1 1.2 1.3 1.4 1.5 1.6 1.7 Introduction and Highlights ........................................................................ 5 What is the MCP250XX Development Kit? ............................................... 5 System Requirements .............................................................................. 5 MCP250XX Development Kit Components .............................................. 6 MCP2515 Components ............................................................................ 7 Hardware Installation .............................................................................. 10 Software Installation ............................................................................... 11 Chapter 2. MCP250XX Basic View Tutorial 2.1 2.2 2.3 2.4 2.5 Introduction ............................................................................................. 13 Highlights ................................................................................................ 13 Setting up the Basic Template Evaluation Mode .................................... 13 Establishing Communications ................................................................ 20 Explaining the CAN Messages ............................................................... 22 Chapter 3. MCP250XX Register View Tutorial 3.1 3.2 3.3 3.4 3.5 Introduction ............................................................................................. 23 Highlights ................................................................................................ 23 Setting up the Register Template Evaluation Mode ............................... 23 Establishing Communication .................................................................. 27 Explaining the Register Template Windows ........................................... 27 Chapter 4. Programming the MCP250XX User Defaults 4.1 4.2 4.3 4.4 Introduction ............................................................................................. 29 Highlights ................................................................................................ 29 Device Programmer ................................................................................ 29 Programming via the ICSP™ Connector ................................................ 34 Chapter 5. Other Capabilities of the Development Board 5.1 5.2 5.3 5.4 5.5 Introduction ............................................................................................. 35 Highlights ................................................................................................ 35 Oscillator Configurations ........................................................................ 35 Node A Prototyping Area and Header Pinout ......................................... 36 External Bus Connections ...................................................................... 37 2004 Microchip Technology Inc. DS51266C-page iii MCP250XX User’s Guide Appendix A. Schematics and Layouts A.1 A.2 A.3 A.4 A.5 A.6 A.7 Introduction ............................................................................................. 39 VPP Step-up Regulator ........................................................................... 40 Clock and Data for Programming ........................................................... 41 PC Node ................................................................................................. 42 CAN Physical Layer ................................................................................ 43 Node A and Node B ................................................................................ 44 Caps Page .............................................................................................. 45 Index ..............................................................................................................................47 Worldwide Sales and Service .....................................................................................48 DS51266C-page iv 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Preface INTRODUCTION AND HIGHLIGHTS This section provides general information that will be useful to know before using the MCP250XX Development Kit and touches on the following topics: • • • • • About This Guide Recommended Reading Troubleshooting The Microchip Internet Web Site Customer Support ABOUT THIS GUIDE Document Layout The User’s Guide layout is as follows: • Chapter 1: Product Overview and Installation – details the hardware and software components and discusses installation procedures. • Chapter 2: MCP250XX Basic View Tutorial – covers some of the key elements of the MCP250XX by going through the steps for setting up and running the demonstration program. • Chapter 3: MCP250XX Register View Tutorial – details the demonstration software and the CAN system, as well as discussing the steps required to successfully communicate with the MCP250XX while in the Register template. • Chapter 4: Programming the MCP250XX Using the Development Board – describes the procedure for programming the MCP250XX using the programming circuitry and special software. • Chapter 5: Other Capabilities of the MCP250XX Development Kit - details the other capabilities of the MCP250XX Development Kit, including configuring the board for multiple oscillators, connecting the board to the MCP2515 development board and connecting the board to external CAN busses. Appendices • Appendix A: Schematics and Layouts – lists the schematics and layout diagrams for the MCP250XX Development Kit. • Index – cross-reference listing of terms, features and sections of this document. • Worldwide Sales and Service – provides the address, telephone and fax numbers for Microchip Technology Inc. sales and service locations throughout the world. Updates Since Microchip tools are constantly evolving to meet customer needs, some software dialogs and/or tool descriptions may differ from this document. Please refer to the Microchip web site to obtain the latest documentation available (www.microchip.com). 2004 Microchip Technology Inc. DS51266C-page 1 MCP250XX User’s Guide RECOMMENDED READING For more information regarding the MCP250XX devices and other CAN related topics, the following are recommended reading. The following data sheets may be downloaded from our internet web site at www.microchip.com. MCP2502X/2505X Data Sheet (DS21664) This data sheet provides detailed information regarding the MCP250XX CAN I/O Expanders. MCP2515 Data Sheet (DS21291) This data sheet provides detailed information regarding the MCP2515 Stand-Alone CAN Controller, which is the master node on the board. PRO MATE® II User’s Guide (DS30082) This manual contains a section explaining how to program the MCP250XX devices using the specified socket module. MCP250XX Programming Specification (DS20072) This specification explains the requirements for programming the MCP250XX using the ICSP™ protocol. AN815 – Understanding the MCP250XX Devices (DS00815). AN816 – A CAN System Using Multiple MCP250XX I/O Expanders (DS00816). AN713 – An Introduction to the CAN Protocol Application Note (DS00713) This application note provides “the basics” for those not familiar with the CAN protocol. AN754 – Understanding Microchip’s CAN Module Bit Timing Application Note (DS00754) This application note is an in-depth discussion of bit timing using Microchip’s CAN module. A CAN Kingdom by Lars-Berno Fredriksson (Kvaser AB) This document covers the CAN Kingdom Specification and should help give some insight into the main software and some of the menu items that refer to CAN Kingdom-specific functions. For more information, please visit CAN Kingdom web site at www.cankingdom.org CANKing Help Files The help files are a good resource for answering some common questions about the MCP250XX Development Kit, including the CAN Kingdom-specific menu items. README Files Contains the latest information on the MCP250XX evaluation system. Microsoft® Windows® Manuals These manuals assume that users are familiar with the Microsoft Windows operating system. Many excellent references exist for this software program and should be consulted for general operation of the Windows® operating system. TROUBLESHOOTING See the README files for information regarding common problems not addressed in this user’s guide. DS51266C-page 2 2004 Microchip Technology Inc. Preface THE MICROCHIP INTERNET WEB SITE Microchip provides easy access to our documentation and on-line support through our World Wide Web Site at www.microchip.com. You can download files from the web site or from our FTP site at ftp://ftp.microchip.com. CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • • • • • Distributor or Representative Local Sales Office Field Application Engineer (FAE) Corporate Applications Engineer (CAE) Hot Line Customers should call their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. See the back cover for a listing of sales offices and locations. Corporate applications engineers (CAEs) may be contacted at: (480) 792-7627. In addition, there is a Systems Information and Upgrade Line. This line provides system users a listing of the latest versions of all of Microchip’s development systems software products. Plus, this line provides information on how customers can receive any currently available upgrade kits. The Hot Line numbers are: 1-800-755-2345 for U.S. and most of Canada, and 1-480-792-7302 for the rest of the world. 2004 Microchip Technology Inc. DS51266C-page 3 MCP250XX User’s Guide NOTES: DS51266C-page 4 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Chapter 1. Product Overview and Installation 1.1 INTRODUCTION AND HIGHLIGHTS This chapter provides an overview of the MCP250XX Development Kit and covers the following topics: • • • • • • 1.2 What is the MCP250XX Development Kit? System Requirements MCP250XX Development Kit Components MCP2515 Components Hardware Installation Software Installation WHAT IS THE MCP250XX DEVELOPMENT KIT? The MCP250XX Development Kit is an evaluation, demonstration and development tool for Microchip Technology’s 14-pin CAN I/O Expanders. The MCP250XX can be evaluated easily by installing the provided software and running the demonstration program. Furthermore, development can be accomplished by utilizing the bare CAN node with the prototyping area, as well as with the on-board device programmer. The development board has the ability to program the user-defined defaults by using the device programmer module and the supplied software. Alternatively, the In-Circuit Serial Programming™ (ICSP™) protocol can be used to program the MCP250XX using the 5-pin header, which is connected to a 14-pin socket on the board. See the MCP250XX Programming Specification (DS20072) for details on programming via ICSP. Some of the key features of the MCP250XX Development Kit include: • • • • 1.3 Evaluation of Microchip’s CAN I/O Expanders Programming the MCP2505X devices using supplied software Programming the MCP2505X devices via the ICSP protocol Connectable to external CAN networks SYSTEM REQUIREMENTS To take full advantage of the MCP250XX features, you must install the supplied demonstration/evaluation software on a host computer. The MCP250XX requires: • Microsoft Windows 95/98/ME/NT/2000 operating system • One free parallel port • CD-ROM drive 2004 Microchip Technology Inc. DS51266C-page 5 MCP250XX User’s Guide 1.4 MCP250XX DEVELOPMENT KIT COMPONENTS The MCP250XX Development Kit contains: • • • • • • • • MCP250XX Development Board MCP250XX Development Kit User’s Guide MCP250XX Development Kit CD-ROM with demo and programming software Parallel port cable 9V DC power supply adapter Warranty/Registration card Three MCP25020 CAN I/O Expanders Three MCP25050 CAN I/O Expanders FIGURE 1-1: DS51266C-page 6 MCP250XX DEVELOPMENT KIT 2004 Microchip Technology Inc. Product Overview and Installation 1.5 MCP2515 COMPONENTS The MCP2515 consists of four main parts (see Figure 1-4): 1. 2. 3. 4. PC Node Node A Node B Device Programmer 1.5.1 PC Node The PC Node is the master node for the demonstration program that controls Node B. This node contains a MCP2515 Stand-Alone CAN Controller that is controlled by the host PC via a custom parallel port interface. Note: 1.5.2 All three nodes are connected to a common CAN bus that has external connections via the DB9 connector. Node A Node A is a bare CAN node next to the prototyping area. This node is used for MCP250XX prototyping and can also be used to program the user defaults via the ICSP protocol. See Figure 1-2 for pinout description. FIGURE 1-2: NODE A PINOUT ICSP™ Header MCP250XX 2004 Microchip Technology Inc. VPP 1 14 VDD 2 13 VSS 3 12 DATA 4 11 5 10 6 9 7 8 CLOCK DS51266C-page 7 MCP250XX User’s Guide 1.5.3 Node B Node B is the slave node for the demonstration program. Analog inputs (potentiometers), PWM outputs (piezo buzzer and incandescent lamp) and digital inputs (push buttons) are all connected to the MCP25050 device. It responds to inputs and CAN messages to demonstrate device functionality. See Figure 1-3 for the pinout description. FIGURE 1-3: NODE B PINOUT MCP250XX GP0 LP1 R20 GP2 GP4 GP5 R17 VSS 1 14 2 13 3 12 4 11 5 10 6 9 7 8 VDD S1 GP6 BZ1 S2 DS51266C-page 8 S3 S4 2004 Microchip Technology Inc. Product Overview and Installation 1.5.4 Device Programmer The Device Programmer module is used with PC software to configure the user-defined defaults. FIGURE 1-4: MCP250XX DEVELOPMENT BOARD DB25 J1 U3 U2 L1 Y1 U6 PC NODE U15 Y2 Y3 NODE A DEVICE PROGRAMMER D2 D3 D4 D5 R17 R20 NODE B 100 100 J3 BZ1 J5 S1 U14 J4 GP4 1.5.5 GP5 GP6 Key Areas of the MCP2515 There are a few key areas on the board. Figure 1-4 illustrates these areas, while Table 1-1 details them. TABLE 1-1: MCP250XX BOARD LAYOUT Key Areas Description DB25 DB25 is the connection to the host PC interface. The PC controls both the PC Node and the Device Programmer circuit. U6 U6 is the CAN Controller (MCP2515) of the PC Node that is controlled by the host PC. U15, J5 and JP4 U15 is the prototyping node. J5 is the ICSP™ header for U15. JP4 jumpers board power to the VDD pin of U15 and should be removed if using J5 (ICSP header) to isolate U15 from the rest of the board during In-Circuit Serial Programming™. U14 The MCP250XX for the demonstration program. Connected to the potentiometers, piezo, buttons and lamp. U3 U3 is the socket for programming the user-defined defaults using the programming software. Y1, Y2, Y3, JP1 and JP2 Y1, Y2 and Y3 are the oscillator sockets for each of the three CAN nodes. By default, all of the Yx outputs are connected together (JP1 and JP2 are shorted via a trace on the back of the board) and only Y1 is populated (i.e., Y1 clocks all three CAN nodes). To separate the oscillator sockets, the traces shorting JP1 and JP2 must be cut. U11, U12, U13, J3 and J4 U11-U13 are the CAN drivers all connected to a common CAN bus. The two DB9s (J3 and J4) are the external CAN bus connections. Only J4 is populated. D2, D3, D4 and D5 CAN traffic indicator LEDs. D2 represents all traffic. D3-D5 represent transmitted traffic of each of the three nodes. 2004 Microchip Technology Inc. DS51266C-page 9 MCP250XX User’s Guide 1.6 HARDWARE INSTALLATION 1.6.1 Connecting the DB25 Cable The included DB25 cable is a male-to-male configuration and plugs into the parallel port of the host PC. Figure 1-5 shows the pin configuration. 11 12 24 13 25 G N G N D D 23 D 10 22 G N G N G N D D D 9 21 D 8 20 D 7 19 G N 6 18 G N /C /C 5 17 G N 4 16 N /C N /C N 1.6.2 3 15 N 2 14 SP I_ SP I_ /C N 1 DB25 PIN CONFIGURATION SO /P gm D SC at aO K SP /P ut gm I_ C C S/ lk Pg O 25 ut m 15 D R a ES ta W ET 25 R 15 /P EN gm R TS VP 25 O P_ /P 15 g O R m N TS VD 1/ 25 D P _O 15 gm R N C TS L Bu KE 2 ffe N rE na 25 bl e 15 IN T/ Pg SP m I_ D SI AT A_ 25 15 IN R XB F0 25 15 R XB F1 FIGURE 1-5: 9V Power Supply Adapter The power supply is rated at 9V, 750 mA DC. 1.6.3 DB9 External CAN Bus Connectors (optional) The DB9 connector, as shown in Figure 1-6, is used to connect the MCP2515 to an external CAN bus and is not necessary for basic board operation. Only the DB9 at J4 is populated. J3 is available as needed. D DB9 CAN CONNECTOR d N R 8 /C es er ve AN 4 /C AN H 7 5 9 C C N /C 6 3 _V + 2 N 1 C C R es AN L er ve _G N d FIGURE 1-6: AN Note: DS51266C-page 10 2004 Microchip Technology Inc. Product Overview and Installation 1.7 SOFTWARE INSTALLATION Insert the MCP250XX Development Kit CD-ROM into the CD-ROM drive. 1.7.1 Auto-run Enabled If auto-run is enabled, the installation program will automatically start. Follow the instructions on the screen to install the software. 1.7.2 Auto-run Not Enabled If auto-run is not enabled: 1. Click the Start button and select Run. Enter d:\setup.exe (where d:\ is your CD-ROM drive). Click OK. Or alternatively, find the CDROM drive using “Windows Explorer” and double click “setup.exe”. Note: Windows NT® and Windows 2000 users must have administrative privileges in order to install the MXLAB® software. 2. Follow the online instructions to install the software. 2004 Microchip Technology Inc. DS51266C-page 11 MCP250XX User’s Guide NOTES: DS51266C-page 12 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Chapter 2. MCP250XX Basic View Tutorial 2.1 INTRODUCTION This tutorial discusses the evaluation portion of the kit, details the demonstration software (Basic template), CAN system (PC Node and Node B) and covers the steps required to successfully run the demonstration network. The user defaults for Node B are preprogrammed at the factory. Therefore, no user default programming is necessary. No discussion of programming user defaults will take place in this chapter, as this is detailed in Chapter 4. “Programming the MCP250XX User Defaults”. Note: 2.2 The software must be installed and the hardware connected to run the demonstration program. HIGHLIGHTS This chapter covers the following topics: • Setting up Evaluation mode • Establishing communications • Explaining the CAN messages 2.3 SETTING UP THE BASIC TEMPLATE EVALUATION MODE The MCP250XX Development Kit’s “Basic” template contains the following major elements: 1. Menu Bar (Figure 2-1) – The layout is typical of most Windows menu bars. 2. PC Node Bit Timing and Mode (Figure 2-2) – The bit timing and the mode of operation (Normal and Configuration) for the MCP2515 (PC Node) are configured with this window. 3. Board Status (Figure 2-3) – Indicates if the board is connected to the PC and also indicates the parallel port address used. 4. Message Format Window (Figure 2-4) – Selects how CAN messages are formatted and interpreted. The default is “Standard Text Format” and is used for the demonstration program. The other format is used with the CAN Kingdom higher layer protocol. 5. Bus Monitor Window (Figure 2-5) – Also known as the “Output” window. This window shows all bus traffic. 6. MCP250XX Demonstration (Figure 2-6) – This window is the graphical interpretation of Node B (the demonstration node). FIGURE 2-1: 2004 Microchip Technology Inc. MENU BAR DS51266C-page 13 MCP250XX User’s Guide DS51266C-page 14 FIGURE 2-2: PC NODE BIT TIMING AND MODE FIGURE 2-3: BOARD STATUS 2004 Microchip Technology Inc. MCP250XX Basic View Tutorial FIGURE 2-4: MESSAGE FORMAT WINDOW FIGURE 2-5: BUS MONITOR WINDOW 2004 Microchip Technology Inc. DS51266C-page 15 MCP250XX User’s Guide FIGURE 2-6: DS51266C-page 16 MCP250XX DEMONSTRATION WINDOW 2004 Microchip Technology Inc. MCP250XX Basic View Tutorial 2.3.1 Starting the Program 1. Start the software by any of the following: • From the “Start” menu, select “Programs > Microchip > CANKing” • Select “C:\Program Files\Microchip\Mcan\WC32.exe” • Double-click on the desktop icon for the MCP250XX Development Kit 2. A notice will appear warning of the potential undesired results if connecting to an existing CAN bus (Figure 2-7). Select “OK, I know what I am doing”. 3. A dialog will appear asking if a new template or a saved project should be opened. Select “New Template” (Figure 2-9). 4. When the template dialog appears, select “MCP250XX Evaluation” (Figure 2-10). The software is now started. There are a few other options that the user may want to configure for convenience before saving the project and capturing the defaults. 2.3.2 Setting the Numeric Base for Transmit and Monitor Windows The default numeric base can be changed, as desired, for both the Transmit Buffer window and the Bus Monitor window. Base 16 (hex) numbers are preceded by a “$”. 2.3.2.1 TRANSMIT BUFFER WINDOW The numeric base for the transmit buffer is configured by selecting “Options > Global...” from the menu. Check desired numeric base. 2.3.2.2 BUS MONITOR WINDOW If the Select Formatters window is not visible, select it from the View menu. Highlight (do not uncheck) Standard Text Format in the Select Formatters window. Click Properties and check the desired numeric base (see Figure 2-8). A few other items must be addressed before proper communication can occur. These are discussed in the next section. 2004 Microchip Technology Inc. DS51266C-page 17 MCP250XX User’s Guide DS51266C-page 18 FIGURE 2-7: WARNING ON START-UP FIGURE 2-8: CHANGING NUMERIC BASE FOR BUS MONITOR 2004 Microchip Technology Inc. MCP250XX Basic View Tutorial FIGURE 2-9: OPEN DIALOG FIGURE 2-10: TEMPLATE DIALOG 2004 Microchip Technology Inc. DS51266C-page 19 MCP250XX User’s Guide 2.4 ESTABLISHING COMMUNICATIONS When the software is started from a new template (as it must be the first time it is started), some steps must be taken to insure proper operation and to set up the software defaults. These defaults can be saved by saving the template as a project and opening the project in subsequent sessions. 2.4.1 Configure Parallel Port The board status (including parallel port address and connection status) is indicated in the Board Status window (Figure 2-3). Assuming the port address, as displayed in the window, matches the address as configured by the PC, the board status should indicate “connected”, with the indicator in the window being green. If the status indicator is red and indicates “not connected”, check the port address. To change the port address that the software uses, select “Options > MCP2515” and enter the correct port address in the appropriate dialog box (Figure 2-11). Note: Port address is entered as a hex value. FIGURE 2-11: 2.4.2 PC NODE OPTIONS Match Oscillator Frequency with Board The CAN data rate is a function of the oscillator frequency. Therefore, the proper oscillator frequency must be set in order for the software to calculate the CAN data rate correctly. Open the same window that was opened to set the parallel port address (Figure 2-11). The frequency of oscillation units are displayed in kilohertz (kHz). DS51266C-page 20 2004 Microchip Technology Inc. MCP250XX Basic View Tutorial 2.4.3 Configuring the Output Window Display Format The Output (Bus Monitor) window (Figure 2-5) can display the CAN messages in five different ways: 1. Fixed Positions – Messages with the same identifier maintain a fixed position (slot) within the window. The data and time-stamp update normally. To turn fixed positions on/off, right-click the mouse while the cursor is over the Output window area and select “Fixed Positions”. 2. Dynamic Positions (Fixed Positions = off) – Each new message is displayed below the previous message, regardless of the identifier. This mode is activated by unchecking Fixed Positions (right mouse click). 3. Auto-Scroll – Keeps the Output window from auto-scrolling to the most recent message (bottom message). This is useful when messages are being regularly received and the user would like to observe old messages at the top of the buffer without having the focus shift to the end of the buffer each time a message is received. To activate, right-click the mouse while the cursor is over the Output window and select “Auto-Scroll”. 4. Delta Time – This is a time-stamp that indicates the time(s) between two messages with the same identifier. Delta time is activated as follows (Figure 2-8): If the Select Formatters window is not visible, select it from the View menu. Highlight (do not uncheck) the “Standard Text Format” option in the Select Formatters window. Click Properties and check the “Delta Times” box. 5. Free-Running Time – A free-running time-stamp between messages with the same identifiers. This mode is activated by unchecking the “Delta Times” box. 2004 Microchip Technology Inc. DS51266C-page 21 MCP250XX User’s Guide 2.5 EXPLAINING THE CAN MESSAGES At this point, the two nodes (PC Node and Node B) should be communicating normally and a message should be showing up in the Output window (Figure 2-5) at regular intervals. Pushing GP4, GP5 or GP6 causes other messages to show up in the Output window, with the status being reflected graphically in the Demo window. Turning the potentiometers will cause the data fields to change. This section explains the CAN messages as seen in the Output (Bus Monitor) window. TABLE 2-1: DS51266C-page 22 CAN MESSAGES EXPLAINED Identifier Length Data Explanation 0x008 3 “Write Register” Input Message (IM) DB0 (address) is either 0x23 or 0x26 (PR1 or PWM2DCH). 0x018 8 Read A/D Regs “Read A/D Regs“ IRM followed by OM. 0x280 0 None On-bus message. 0x290 8 Read A/D Regs A/D Threshold Detection (R20, POT and PWM2 duty cycle). 0x7FF 0 None Command Acknowledge in response to IM. 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Chapter 3. MCP250XX Register View Tutorial 3.1 INTRODUCTION A few topics covered in this chapter were also covered in the last chapter detailing the Basic template tutorial. To avoid duplication, the appropriate sections of Chapter 2 “MCP250XX Basic View Tutorial” will be referenced. This chapter details the demonstration software (Register template) and CAN system (PC Node and Node B). It also covers the steps required to successfully communicate with the MCP250XX while in the Register template. Note: 3.2 The software must be installed, and the hardware connected, to run the demonstration program. HIGHLIGHTS This chapter covers the following topics: • Setting up the Evaluation Mode • Establishing Communications • Explaining the Windows 3.3 SETTING UP THE REGISTER TEMPLATE EVALUATION MODE The MCP250XX Development Kit’s “Register” template contains the following major elements that will be discussed, in detail, later in this chapter: 1. The Menu Bar, PC Node Bit Timing and Mode and Board Status windows are all discussed in Section 2.3 “Setting up the Basic Template Evaluation Mode”. 2. MCP250XX Filters – Used to set up and test the MCP250XX mask and filters. 3. MCP250XX Error Status – Used to read the current Transmit and Receive Error Counters (TEC and REC), as well as the EFLG register. 4. MCP250XX Physical Layer – Displays the bit timing registers (CNF1, CNF2 and CNF3). 5. MCP250XX Command Messages – Implements the command messages as described in the data sheet. Information Request Messages (IRM), output and input messages are all represented in this window to enable the main functionality of the MCP250XX. 2004 Microchip Technology Inc. DS51266C-page 23 MCP250XX User’s Guide DS51266C-page 24 FIGURE 3-1: MCP250XX FILTERS FIGURE 3-2: MCP250XX ERROR STATES 2004 Microchip Technology Inc. MCP250XX Register View Tutorial FIGURE 3-3: 2004 Microchip Technology Inc. MCP250XX PHYSICAL LAYER DS51266C-page 25 MCP250XX User’s Guide FIGURE 3-4: MCP250XX COMMAND MESSAGES 3.3.1 Starting the Program Because the start procedures are the same as in Section 2.3.1 “Starting the Program”, there are references to figures in Chapter 2 “MCP250XX Basic View Tutorial” in this section. 1. Start the software by any of the following: • From the “Start” menu, select “Programs > Microchip > CANKing” • Or select “C:\Program Files\Microchip\Mcan\WC32.exe” • Or double-click on the desktop icon for the MCP250XX Development Kit 2. A notice will appear warning of the potential undesired results if connecting to an existing CAN bus (Figure 2-7). Select “OK, I know what I am doing”. 3. Next, a dialog will appear asking if a new template or a saved project should be opened. Select “New Template” (Figure 2-9). 4. When the template dialog appears, select “MCP250XX Evaluation” (Figure 2-10). DS51266C-page 26 2004 Microchip Technology Inc. MCP250XX Register View Tutorial 3.3.2 Setting the Numeric Base for Bus Monitor Window If the Select Formatters window is not visible, select it from the View menu. Highlight (do not uncheck) “Standard Text Format” in the Select Formatters window. Click Properties and check the desired numeric base (see Figure 2-8). A few other items must be addressed before proper communication can occur, as discussed in the next section. 3.4 ESTABLISHING COMMUNICATION Because the method for establishing communications is exactly the same as the last chapter, please refer to Section 2.4, “Establishing Communications”. 3.5 EXPLAINING THE REGISTER TEMPLATE WINDOWS The Register template provides access to all of the user registers by using the command messages as defined in the data sheet. 3.5.1 General Information There are three different ways to enter values into the windows, depending on the window function: 1. Entering byte value in the appropriate box. 2. Clicking up/down counters to increase/decrease the value by one. 3. Double-clicking the desired bit location to toggle the bit to its opposite state. The register bit names will be displayed for the location directly under the mouse pointer (Physical Layer and Configuration windows only). 3.5.2 MCP250XX Filters Window The MCP250XX Filters window allows the user to read, modify and test the mask and filters settings. Care must be taken when modifying the mask and filter settings, as all, or partial communications with the MCP250XX may be lost due to improper filter and mask settings. Mask and filter settings can be tested against various identifiers simply by entering the desired identifier in the Test Identifier window and pressing the “Test Buf” button. This tests the entered identifier with the entered mask and filter settings, indicating pass/fail for each filter. Example 3.1: Figure 3-1 shows a test where the mask is configured to accept IDs of Eh and Fh only (bit 0 = 0 = “don’t care”). 2004 Microchip Technology Inc. DS51266C-page 27 MCP250XX User’s Guide 3.5.3 MCP250XX Error States The current Receive and Transmit Error Counters (REC and TEC) can be read, as can the EFLG register. The is the same as the “Read CAN Error” Information Request Message (IRM). 3.5.4 MCP250XX Physical Layer The bit timing (CNF registers) cannot be changed from the default values. However, these registers can be read and displayed along with the parsed prescaler and T Q settings. 3.5.5 MCP250XX Command Messages This window implements the command messages as described in the data sheet. Both IRMs and input messages can be implemented by selecting the appropriate radio button (see Figure 3-4). This window also gives the added functionality of reading and/or writing individual registers. Reading individual registers is actually an IRM that contains the desired register (e.g., reading IOINTEN register is actually a “Read Control Register” IRM command with the resulting output message). Writing an individual register is a “Write Register” input command. DS51266C-page 28 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Chapter 4. Programming the MCP250XX User Defaults 4.1 INTRODUCTION The user memory for MCP250XX devices is initially blank when shipped from the factory. The user must program the user memory with user-defined defaults. There are three methods for programming the user memory. 1. Using MPLAB® IDE with the PRO MATE® II device programmer and the MCP250XX socket module. 2. Using the device programmer circuit on the MCP2515 with the programming software. 3. In-Circuit Serial Programming™ (ICSP™) while following the MCP250XX Programming Specification (DS20072). 4.2 HIGHLIGHTS The MCP250XX Development Kit supports two methods for programming the user defaults. 1. Using the Device Programmer circuit with the programming software. 2. Node A has an ICSP connector. 4.3 DEVICE PROGRAMMER A device programmer circuit is built into the board to allow the user to easily program MCP250XX devices with the existing board (i.e., PRO MATE II is not needed). 4.3.1 Circuit Description The programming circuitry is designed to use the ICSP methodology as defined in the MCP250XX Programming Specification (DS20072). The circuitry routes all of the required signals, including the 13V VPP signal that is generated by a step-up voltage regulator. Figure 4-1 shows the pinout for the MCP250XX socket in the device programmer circuitry. 2004 Microchip Technology Inc. DS51266C-page 29 MCP250XX User’s Guide FIGURE 4-1: DEVICE PROGRAMMER DIAGRAM To Host PC MCP250XX 1 14 2 13 3 12 4 11 5 10 6 9 7 8 Step-up Regulator Circuit 4.3.2 PC Software The programming circuitry is controlled by a host PC application through the DB25 connector. The PC application is a graphical interface that allows the device to be quickly and easily configured with the user defaults. Figure 4-2 shows the main screen, which is used to navigate to all of the MCP250XX device peripherals that can be configured with the defaults. The other screens, as shown in Figure 4-3 thru Figure 4-7, are used to configure all peripherals. Together, both the hardware and software use the ICSP methodology as described in the MCP250XX programming specification. The software has the ability to save user defaults into IHEX8 format, which can be imported to the PRO MATE II device programmer through MPLAB® IDE for programming the MCP250XX devices. DS51266C-page 30 2004 Microchip Technology Inc. Programming the MCP250XX User Defaults FIGURE 4-2: PROGRAMMER SOFTWARE MAIN SCREEN FIGURE 4-3: USER MEMORY Screen Capture 2004 Microchip Technology Inc. DS51266C-page 31 MCP250XX User’s Guide DS51266C-page 32 FIGURE 4-4: CAN MODULE FIGURE 4-5: PWM MODULES 2004 Microchip Technology Inc. Programming the MCP250XX User Defaults FIGURE 4-6: A/D MODULE FIGURE 4-7: GPIO MODULE 2004 Microchip Technology Inc. DS51266C-page 33 MCP250XX User’s Guide 4.4 PROGRAMMING VIA THE ICSP™ CONNECTOR There is an ICSP connector on Node A that can be used to program the user defaults with an external programmer. To insure successful programming, the MCP250XX Programming Specification (DS20072) must be adhered to. The JP4 jumper allows the MCP250XX socket to be isolated from board power so the programmer does not have to drive the board while programming. FIGURE 4-8: PROGRAMMING VIA THE ICSP™ CONNECTOR VDD MCP250XX DS51266C-page 34 JP4 ICSP™ Connector VPP 1 14 VDD 2 13 VSS 3 12 DATA 4 11 5 10 6 9 7 8 CLOCK 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Chapter 5. Other Capabilities of the Development Board 5.1 INTRODUCTION The capabilities and configurations of the MCP2515 are discussed in this chapter. 5.2 HIGHLIGHTS This chapter discusses: • Oscillator Configurations • Node A Prototyping Area and Header Pinout • External CAN Bus Connections 5.3 OSCILLATOR CONFIGURATIONS The MCP2515 is configured, by default, to use a common oscillator for all three CAN nodes. While there are three oscillator sockets, only one is populated. The oscillator sockets are connected together with their outputs. The two jumpers (JP1 and JP2) can be used to disconnect the outputs and use individual oscillators for the nodes. The jumpers are shorted by a trace on the bottom of the board by default. These traces can be cut and jumper pins can be installed to control the oscillator output wiring. See Figure 5-1 for details on the oscillator configurations. FIGURE 5-1: OSCILLATOR SOCKET LAYOUT Y1 Y2 Y3 Out Out Out To Node B To PC Node JP2 To Node A JP1 Shorted by trace on bottom of board 2004 Microchip Technology Inc. DS51266C-page 35 MCP250XX User’s Guide 5.4 NODE A PROTOTYPING AREA AND HEADER PINOUT In addition to ICSP capabilities, Node A can also be used for prototyping custom MCP250XX configurations. This node has a prototyping area as well as a header that can be used for probing the MCP250XX pinout. Figure 5-2 shows the layout of the header. Note: JP4 must be shorted to enable board power to the MCP250XX socket. FIGURE 5-2: NODE A HEADER LAYOUT Node A Header GP0 GP1 GP2 GP3 GP4 GP5 GP6 GP7 TXCAN DS51266C-page 36 RXCAN 2004 Microchip Technology Inc. Other Capabilities of the Development Board 5.5 EXTERNAL BUS CONNECTIONS The MCP2515 can be connected to an external CAN bus through the DB9(s). The DB9 pinout is the same as the defacto standard, as recommended by the CAN in Automation (CiA) group. At a minimum, CANH (pin 7) and CANL (pin 2) must be connected. However, CAN_GND (pin 3) and CAN_V+ (pin 9) may also be connected to supply power to and from another board. Table 5-1 and Figure 5-3 show the pinout and connector, respectively. If supplying power to or from the MCP2515, be sure the voltage regulator specification is not violated. CAN CONNECTOR PINOUT Description Reserved 2 CANL 3 CAN_GND 4 — 5 N/C Not connected 6 N/C Not connected 7 CANH 8 — 9 CAN_V+ CAN ground Reserved CAN high bus line Reserved CAN power D EXTERNAL CAN BUS CONNECTOR 3 er /C 8 /C N 4 N AN H 7 5 9 C C ve d _G N C 2 6 /C C AN es R 1 N AN L er ve d FIGURE 5-3: CAN low bus line es — R Name 1 + Pin# _V TABLE 5-1: AN Note: 2004 Microchip Technology Inc. DS51266C-page 37 MCP250XX User’s Guide NOTES: DS51266C-page 38 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Appendix A. Schematics and Layouts A.1 INTRODUCTION This appendix contains the schematics and layouts for the MCP250XX Development Kit. Diagrams included in this appendix include: • • • • • • VPP Step-Up Regulator circuit Programming Clock/Data Logic circuit PC Interface/CAN Node circuit CAN Bus Interface circuit Node A/Node B circuit Capacitors circuit 2004 Microchip Technology Inc. DS51266C-page 39 GND 11 GND 15 12 4 CAP VREF 8 OAOUT SWC 16 3 SWE DRVC VIN 13 14 SENSE LM78S40 1 CATHODE 2 ANODE 7 OAIN– 6 OAIN+ 5 OAV COMPIN– 9 COMPIN+ 10 C7 GND .25 - 1% R1 R3 680 pF L1 GND {Value} A D1 K R4 100 µF - 16V 6.3 MM DS51266C-page 40 23.7K GND C3 2.21K - 1% GND .1 µF C4 GND GND .1 µF C5 µ GND .1 µF C6 VCC NV PP _ON µ NV PP _ON Q1 100 R2 Q3 PFET – MTSF2P02 VDD Q2 PFET – MTSF2P02 V PP FIGURE A-1: R7 A.2 10K U2 VCC VCC MCP250XX User’s Guide VPP Step-up Regulator VPP STEP-UP REGULATOR CIRCUIT 2004 Microchip Technology Inc. R8 10K R5 160 A.3 CLOCK AND DATA FOR PROGRAMMING FIGURE A-2: PROGRAMMING CLOCK/DATA LOGIC CIRCUIT VCC VCC VDD VDD VPP SN74AHCT1G126 VSS SN74AHCT1G126 2004 Microchip Technology Inc. MCP25050 DS51266C-page 41 MCP250XX User’s Guide A.4 PC NODE PC INTERFACE/CAN NODE CIRCUIT VSS MCP2515 VCC VCC VCC .1 µF .1 µF FIGURE A-3: DS51266C-page 42 2004 Microchip Technology Inc. A.5 CAN PHYSICAL LAYER CAN BUS INTERFACE CIRCUIT 2004 Microchip Technology Inc. VCC MCP2551 VREF VREF VCC MCP2551 VCC VCC VCC VREF MCP2551 VCC VCC FIGURE A-4: DS51266C-page 43 MCP250XX User’s Guide A.6 NODE A AND NODE B NODE A/NODE B CIRCUIT DS51266C-page 44 VCC 2.2 µF VCC VCC MCP25050 VSS VDD VCC VCC VCC VCC VCC VCC VCC VCC VDD MCP25050 VSS VCC ™ VCC FIGURE A-5: 2004 Microchip Technology Inc. A.7 CAPS PAGE FIGURE A-6: CAPACITORS CIRCUIT VCC VCC VCC .1 µF VCC .1 µF VCC .1 µF 2004 Microchip Technology Inc. VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF VCC .1 µF .1 µF VCC 33 µF 100 pF DS51266C-page 45 MCP250XX User’s Guide NOTES: DS51266C-page 46 2004 Microchip Technology Inc. M MCP250XX USER’S GUIDE Index B R Basic View Tutorial: Setting the Numeric Base ................................. 17 Setting up the Basic Template .......................... 13 Starting the Program......................................... 17 Board Components .................................................... 7 Recommended Reading ............................................ 2 Register Template Windows .................................... 27 Register View Tutorial: Setting the Numeric Base ................................. 27 Setting Up the Evaluation Mode ....................... 23 Starting the Program......................................... 26 C CAN Messages ........................................................ 22 Customer Support ...................................................... 3 D Document Layout ....................................................... 1 E Establishing Communications .................................. 20 H Hardware Installation ............................................... 10 I Installing: Hardware .......................................................... 10 Software............................................................ 11 S Schematic and Layouts............................................ 39 Software Installation................................................. 11 System Requirements................................................ 5 T Troubleshooting ......................................................... 2 U Updates...................................................................... 1 W What is the MCP250XX Development Kit? ................ 5 K Kit Components ......................................................... 6 M Microchip Internet Web Site ....................................... 3 O Other Capabilities: External Bus Connections .................................. 7 External CAN Bus Connector ............................. 7 Oscillator Configurations................................... 35 Prototyping Area ............................................... 36 P Product Overview and Installation: Board Components ............................................. 7 Key Areas of the Development Board ................ 6 Kit Components .................................................. 6 System Requirements ........................................ 5 Programming the User Defaults: Device Programmer .......................................... 29 PC Software...................................................... 30 Programming via the ICSP™ Connector .......... 34 2004 Microchip Technology Inc. DS51266C-page 47 M WORLDWIDE SALES AND SERVICE AMERICAS Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: 480-792-7627 Web Address: http://www.microchip.com China - Beijing Korea Unit 706B Wan Tai Bei Hai Bldg. No. 6 Chaoyangmen Bei Str. Beijing, 100027, China Tel: 86-10-85282100 Fax: 86-10-85282104 168-1, Youngbo Bldg. 3 Floor Samsung-Dong, Kangnam-Ku Seoul, Korea 135-882 Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 China - Chengdu 200 Middle Road #07-02 Prime Centre Singapore, 188980 Tel: 65-6334-8870 Fax: 65-6334-8850 3780 Mansell Road, Suite 130 Alpharetta, GA 30022 Tel: 770-640-0034 Fax: 770-640-0307 Rm. 2401-2402, 24th Floor, Ming Xing Financial Tower No. 88 TIDU Street Chengdu 610016, China Tel: 86-28-86766200 Fax: 86-28-86766599 Boston China - Fuzhou Atlanta 2 Lan Drive, Suite 120 Westford, MA 01886 Tel: 978-692-3848 Fax: 978-692-3821 Chicago 333 Pierce Road, Suite 180 Itasca, IL 60143 Tel: 630-285-0071 Fax: 630-285-0075 Dallas 4570 Westgrove Drive, Suite 160 Addison, TX 75001 Tel: 972-818-7423 Fax: 972-818-2924 Detroit Tri-Atria Office Building 32255 Northwestern Highway, Suite 190 Farmington Hills, MI 48334 Tel: 248-538-2250 Fax: 248-538-2260 Kokomo 2767 S. Albright Road Kokomo, IN 46902 Tel: 765-864-8360 Fax: 765-864-8387 Los Angeles 18201 Von Karman, Suite 1090 Irvine, CA 92612 Tel: 949-263-1888 Fax: 949-263-1338 San Jose 1300 Terra Bella Avenue Mountain View, CA 94043 Tel: 650-215-1444 Fax: 650-961-0286 Toronto 6285 Northam Drive, Suite 108 Mississauga, Ontario L4V 1X5, Canada Tel: 905-673-0699 Fax: 905-673-6509 ASIA/PACIFIC Australia Suite 22, 41 Rawson Street Epping 2121, NSW Australia Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 Unit 28F, World Trade Plaza No. 71 Wusi Road Fuzhou 350001, China Tel: 86-591-7503506 Fax: 86-591-7503521 China - Hong Kong SAR Unit 901-6, Tower 2, Metroplaza 223 Hing Fong Road Kwai Fong, N.T., Hong Kong Tel: 852-2401-1200 Fax: 852-2401-3431 Singapore Taiwan Kaohsiung Branch 30F - 1 No. 8 Min Chuan 2nd Road Kaohsiung 806, Taiwan Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan Taiwan Branch 11F-3, No. 207 Tung Hua North Road Taipei, 105, Taiwan Tel: 886-2-2717-7175 Fax: 886-2-2545-0139 EUROPE China - Shanghai Austria Room 701, Bldg. B Far East International Plaza No. 317 Xian Xia Road Shanghai, 200051 Tel: 86-21-6275-5700 Fax: 86-21-6275-5060 Denmark China - Shenzhen Rm. 1812, 18/F, Building A, United Plaza No. 5022 Binhe Road, Futian District Shenzhen 518033, China Tel: 86-755-82901380 Fax: 86-755-8295-1393 China - Shunde Room 401, Hongjian Building, No. 2 Fengxiangnan Road, Ronggui Town, Shunde District, Foshan City, Guangdong 528303, China Tel: 86-757-28395507 Fax: 86-757-28395571 China - Qingdao Rm. B505A, Fullhope Plaza, No. 12 Hong Kong Central Rd. Qingdao 266071, China Tel: 86-532-5027355 Fax: 86-532-5027205 India Divyasree Chambers 1 Floor, Wing A (A3/A4) No. 11, O’Shaugnessey Road Bangalore, 560 025, India Tel: 91-80-2290061 Fax: 91-80-2290062 Japan Benex S-1 6F 3-18-20, Shinyokohama Kohoku-Ku, Yokohama-shi Kanagawa, 222-0033, Japan Tel: 81-45-471- 6166 Fax: 81-45-471-6122 Durisolstrasse 2 A-4600 Wels Austria Tel: 43-7242-2244-399 Fax: 43-7242-2244-393 Regus Business Centre Lautrup hoj 1-3 Ballerup DK-2750 Denmark Tel: 45-4420-9895 Fax: 45-4420-9910 France Parc d’Activite du Moulin de Massy 43 Rue du Saule Trapu Batiment A - ler Etage 91300 Massy, France Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 Germany Steinheilstrasse 10 D-85737 Ismaning, Germany Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 Italy Via Quasimodo, 12 20025 Legnano (MI) Milan, Italy Tel: 39-0331-742611 Fax: 39-0331-466781 Netherlands P. A. De Biesbosch 14 NL-5152 SC Drunen, Netherlands Tel: 31-416-690399 Fax: 31-416-690340 United Kingdom 505 Eskdale Road Winnersh Triangle Wokingham Berkshire, England RG41 5TU Tel: 44-118-921-5869 Fax: 44-118-921-5820 01/26/04 DS51266C-page 48 2004 Microchip Technology Inc.