MCP2515 Stand-Alone CAN Controller PICtail™ Demo Board User’s Guide © 2005 Microchip Technology Inc. DS51572A 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 provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. 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 Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC, and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB, PICMASTER, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active Thermistor, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel, Total Endurance and WiperLock are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. 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. © 2005, 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, KEELOQ® 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. DS51572A-page ii © 2005 Microchip Technology Inc. MCP2515 PICtail™ DEMO BOARD USER’S GUIDE Table of Contents Preface ........................................................................................................................... 1 Chapter 1. Product Overview ........................................................................................ 5 1.1 Introduction ..................................................................................................... 5 1.2 What is the MCP2515 PICtail™ Demo Board ? ............................................. 5 1.3 What the MCP2515 PICtail™ Demo Board Kit Includes ................................ 5 Chapter 2. Installation and Operation .......................................................................... 7 2.1 Introduction ..................................................................................................... 7 2.2 Features ......................................................................................................... 7 2.3 Getting Started ............................................................................................... 8 2.4 Firmware Description ..................................................................................... 8 Appendix A. Schematics and Layouts ...................................................................... 11 A.1 Introduction .................................................................................................. 11 Appendix B. Bill of Materials (BOM) .......................................................................... 15 Worldwide Sales and Service .................................................................................... 16 © 2004 Microchip Technology Inc. DS51572A-page iii MCP2515 PICtail™ Demo Board User’s Guide NOTES: DS51572A-page iv © 2004 Microchip Technology Inc. MCP2515 PICtail™ DEMO BOARD USER’S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number. The numbering convention for the DS number is “DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the document. INTRODUCTION This chapter contains general information that will be useful to know before using the MCP2515 PICtail™ Demo Board. Items discussed in this chapter include: • • • • • • Document Layout Conventions Used in this Guide Recommended Reading The Microchip Web Site Customer Support Document Revision History DOCUMENT LAYOUT This document describes how to use the MCP2515 PICtail™ Demo Board. The manual layout is as follows: • Chapter 1. “Product Overview” – Important information about the MCP2515 PICtail™ Demo Board. • Chapter 2. “Installation and Operation” – Includes instructions on how to get started with this evaluation board. • Appendix A. “Schematics and Layouts” – Shows the schematic and layout diagrams for the MCP2515 PICtail™ Demo Board. • Appendix B. “Bill of Materials (BOM)” – Lists the parts used to build the MCP2515 PICtail™ Demo Board. © 2005 Microchip Technology Inc. DS51572A-page 1 MCP2515 PICtail™ Demo Board User’s Guide CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS Description Arial font: Italic characters Initial caps Quotes Underlined, italic text with right angle bracket Bold characters N‘Rnnnn Text in angle brackets < > Represents Examples Referenced books Emphasized text A window A dialog A menu selection A field name in a window or dialog A menu path MPLAB® IDE User’s Guide ...is the only compiler... the Output window the Settings dialog select Enable Programmer “Save project before build” A dialog button A tab A number in verilog format, where N is the total number of digits, R is the radix and n is a digit. A key on the keyboard Click OK Click the Power tab 4‘b0010, 2‘hF1 File>Save Press <Enter>, <F1> RECOMMENDED READING For more information regarding the Stand-Alone Controller Area Network (CAN) controller, CAN I/O Expander and CAN transceiver devices, refer to the appropriate data sheet. Table 1 shows the device and associated Data Sheet (DS) literature number. These documents can be downloaded from the Microchip web site at: www.microchip.com. TABLE 1: DEVICES AND DATA SHEET LITERATURE NUMBERS Device DS51572A-page 2 Literature # Device Literature # MCP2515 DS21801 MCP2502X/5X DS21664 MCP2551 DS21667 © 2005 Microchip Technology Inc. Preface THE MICROCHIP WEB SITE Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers. Accessible by using your favorite Internet browser, the web site contains the following information: • Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software • General Technical Support – Frequently Asked Questions (FAQs), technical support requests, online discussion groups, Microchip consultant program member listing • Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representatives CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • • • • • Distributor or Representative Local Sales Office Field Application Engineer (FAE) Technical Support Development Systems Information Line Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in the back of this document. Technical support is available through the web site at: http://support.microchip.com DOCUMENT REVISION HISTORY Revision A (August 2005) • Initial release of this document. © 2005 Microchip Technology Inc. DS51572A-page 3 MCP2515 PICtail™ Demo Board User’s Guide NOTES: DS51572A-page 4 © 2005 Microchip Technology Inc. MCP2515 PICtail™ DEMO BOARD USER’S GUIDE Chapter 1. Product Overview 1.1 INTRODUCTION This chapter provides an overview of the MCP2515 PICtail™ Demo Board and covers the following topics: • What is the MCP2515 PICtail™ Demo Board? • What the MCP2515 PICtail™ Demo Board kit includes 1.2 WHAT IS THE MCP2515 PICtail™ DEMO BOARD? The MCP2515 PICtail™ Demo Board allows the system designer to quickly evaluate the operation of the MCP2515 Stand-Alone CAN Controller. The board demonstrates the MCP2515 in a CAN bus environment. In addition, the kit includes an MCP25020 CAN I/O Expander node which demonstrates the device on a CAN bus. 1.3 WHAT THE MCP2515 PICtail™ DEMO BOARD KIT INCLUDES This MCP2515 PICtail™ Demo Board Kit includes: • One MCP2515 PICtail™ Demo Board with two CAN nodes - One node includes a PIC16F676, a MCP2515 CAN controller and a MCP2551 transceiver. - The other node includes a MCP25020 CAN I/O expander and an MCP2551 transceiver. - The CAN nodes can be physically separated by snapping them apart at the perforation. • One power/bus cable for connecting the two PCB sections together • MCP2515 Data Sheet (DS21801) (electronic version on CD) • MCP2502X/5X Data Sheet (DS21664) (electronic version on CD) • MCP2551 Data Sheet (DS21667) (electronic version on CD) • MCP2515 PICtail™ Demo Board User’s Guide (DS21572) (electronic version on CD) © 2005 Microchip Technology Inc. DS51572A-page 5 MCP2515 PICtail™ Demo Board User’s Guide NOTES: DS51572A-page 6 © 2005 Microchip Technology Inc. MCP2515 PICtail™ DEMO BOARD USER’S GUIDE Chapter 2. Installation and Operation 2.1 INTRODUCTION This chapter discusses the setup and operation of the MCP2515 PICtail™ Demo Board. The MCP2515 PICtail™ Demo Board is designed to demonstrate the MCP2515 and MCP25020 as simple, low-cost CAN nodes. Both nodes monitor an input push button and send CAN messages with the button condition at regular intervals. The CAN message is received by the other node, where a LED is set to mirror the button state. 2.2 FEATURES The MCP2515 PICtail™ Demo Board has the following features: • Two (2) CAN nodes consisting of: - Node A: MCP2515, PIC16F676 and a MCP2551 CAN transceiver. - Node B: MCP25020 CAN I/O Expander and MCP2551 CAN transceiver. • Each node also has one push button and one LED connected to the I/O. - The push button state from each node is sent to the other node via a CAN message. • Two headers on Node A, used for programming the PICmicro® Microcontroller Unit (MCU) using the programming features of the PICkit™ 1 Flash Starter Kit or PICkit™ 2 Microcontroller Programmer. Neither header is populated. Refer to Appendix A. “Schematics and Layouts”. © 2005 Microchip Technology Inc. DS51572A-page 7 MCP2515 PICtail™ Demo Board User’s Guide 2.3 GETTING STARTED The MCP2515 PICtail™ Demo Board is a fully-functional, assembled and tested board for evaluation of the MCP2515 Stand-Alone CAN controller in a simple CAN environment. In addition, the MCP25020 CAN I/O Expander can be observed in operation. The following describes the basic setup and operation (see Figure 2-1): 1. Either connect a power supply (5 V) using the VDD and GND test points, or plug a 9V power supply or power adapter into the plug. 2. Observe that RXCAN, TXCAN, and INT LEDs flash at regular intervals. 3. Node A (MCP2515) samples its input (push button) and sends to Node B instructing it to drive its LED to the input corresponding level of the switch. 4. Node A also requests Node B’s I/O status (push button) at the same interval and driveits LED as required. 2.3.1 PICkit™ 1 Flash Starter Kit and PICkit™ 2 Microcontroller Programmer Connections The MCP2515 PICtail™ Demo Board has two headers (not populated), which allows the PICkit™ 1 Flash Starter Kit or PICkit™ 2 Microcontroller Programmer to be used to reprogram the PICmicro® MCU. Refer to the PICkit™ 2 Microcontroller Programmer User’s Guide (DS51553) for more information on programming PICmicro MCUs. FIGURE 2-1: SETUP CONFIGURATION Perforation Node B Node A 9V DC Adapter MCP2515 PICtail™ Eval Bd. DS51572A-page 8 © 2005 Microchip Technology Inc. Installation and Operation 2.4 FIRMWARE DESCRIPTION See Figure 2-2 and Figure 2-3 for a simple firmware flow diagram for Node A (Node B does not contain any firmware). 1. The firmware first configures the PIC16F676 and the MCP2515. 2. The firmware then checks a global flag bit to determine if a message needs to be sent (a message containing the input button value is transmitted once every 224 ms). 2a. Node A sends a message to Node B requesting I/O status (i.e., push button status). 3. The firmware checks a global receive flag bit to determine if a message has been received by the MCP2515. If yes, the data is read and the LED is set accordingly. 4. The firmware loops back to #2. FIGURE 2-2: FIRMWARE FLOW DIAGRAM Start InitMCU Init2515 ServiceIO MAIN © 2005 Microchip Technology Inc. DS51572A-page 9 MCP2515 PICtail™ Demo Board User’s Guide FIGURE 2-3: SERVICE I/O FIRMWARE FLOW START This flag is set in the ISR when Timer 0 times out 16 times (256 ms). gSampleFlag? A =1 TX0D3<4> = 0 (TX0D3 = 0x00) LED = ON YES RC1 = 0 Button Pressed? No RC1 = 1 TX0D3<4> = 1 (TX0D3 = 0x10) LED = OFF SendMsg TXB0 =0 This is the message that requests the I/O status (i.e., push button status) from Node B (MCP25020) SendMsg TXB1 Clear gSampleFlag This flag is set in the ISR for the INT pin. gRXFlag? =0 A RXMsg RC2 = 0 OFF LED Status? (gLEDStatus) ON RC2 = 1 Clear gRXFlag A DS51572A-page 10 ServiceIO © 2005 Microchip Technology Inc. MCP2515 PICtail™ DEMO BOARD USER’S GUIDE Appendix A. Schematics and Layouts A.1 INTRODUCTION This appendix contains the schematic and PCB layout for the MCP2515 PICtail™ Demo Board. Diagrams included: • • • • Board Schematic – Sheet 1 of 2 Board Schematic – Sheet 2 of 2 Board – Top Layer (with silk-screen) Board – Bottom Layer © 2005 Microchip Technology Inc. DS51572A-page 11 MCP2515 PICtail™ Demo Board User’s Guide DS51572A-page 12 M BOARD SCHEMATIC – SHEET 1 OF 2 MCP2515 CAN Controller PICtail™ Demo Board FIGURE A-1: © 2005 Microchip Technology Inc. Schematics and Layouts © 2005 Microchip Technology Inc. M BOARD SCHEMATIC – SHEET 2 OF 2 MCP2515 CAN Controller PICtail™ Demo Board FIGURE A-2: DS51572A-page 13 MCP2515 PICtail™ Demo Board User’s Guide FIGURE A-3: BOARD – TOP LAYER (WITH SILK-SCREEN) FIGURE A-4: BOARD – BOTTOM LAYER DS51572A-page 14 © 2005 Microchip Technology Inc. MCP2515 PICtail™ DEMO BOARD USER’S GUIDE Appendix B. Bill of Materials (BOM) TABLE B-1: Qty BILL OF MATERIALS (BOM) Reference Description Manufacturer ® Part Number 5 C3, C4, C5, C7, C11 CAP .1 µF 16V CERAMIC X7R 0805 Panasonic - ECG 1 C6 CAP 1.0 µF 10V CERAMIC X7R 0805 Kemet® 2 C10, C13 CAP 10000PF 50V CERAMIC X7R 0805 Kemet C0805C103K5RACTU 6 D1, D2, D4, D6, D7, D8, D9 LED RED CLEAR 0805 SMD Lite-On Trading USA Inc LTST-C170CKT 8 GND, GND1, TP1, TP2, TP3, TP4, TP4, VDD, VDD1 PC TEST POINT COMPACT SMT Keystone Electronics® 5016 2 J2, J3 CONN HEADER 10POS .100 VERT TIN Molex®/Waldom® Electronics Corp 10-88-1101 1 J4 CONN HEADER 6POS .100 VERT TIN Molex/Waldom Electronics Corp 22-28-4061 2 J5, J6 CONN HEADER 6POS .100 VERT TIN Header Not Installed Molex/Waldom Electronics Corp 22-28-4062 2 JP1, JP2 CONN HEADER 2POS .100 VERT TIN Molex/Waldom Electronics Corp 22-28-4021 1 JP3 CONN HEADER 2POS .100 VERT TIN Jumper Not Installed Molex/Waldom Electronics Corp 22-28-4022 1 P1 CONN HEADER 14POS .100 R/A TIN Header Not Installed Molex/Waldom Electronics Corp 22-28-8140 7 R1, R2, R5, R11, RES 475 OHM 1/10W 1% 0805 SMD R17, R19, R20 Panasonic - ECG ERJ-6ENF4750V 1 R3 Yageo America 9C08052A1002FKHFT 2 R,6, R10 RES 510 OHM 1/8W 5% 0805 SMD Panasonic - ECG ERJ-6GEYJ511V 3 R12,R15,R18 RES 4.99K OHM 1/10W 1% 0805 SMD Panasonic - ECG ERJ-6ENF4991V 2 R16,R21 RES 121 OHM 1/10W 1% 0805 SMD Panasonic - ECG ERJ-6ENF1210V 3 SW1, SW2, SW5 SWITCH LT TOUCH 6X3.5 100GF SMD Panasonic - ECG EVQ-PJS04K 1 U1 Stand-alone Controller Area Network (CAN) controller Microchip Technology Inc. MCP2515-I/ST 1 U2 PIC® 14-Pin Flash-based 8-Bit CMOS Microcontroller Microchip Technology Inc. PIC16F676-I/SN 2 U3,U5 High-Speed CAN Transceiver Microchip Technology Inc. MCP2551-I/SL 1 U4 CAN I/O Expander for a Controller Area Network (CAN) system, Microchip Technology Inc. MCP25020-I/SL 1 Y1,Y2 Resonator 16.0 MHZ Ceramic Murata® Electronics North America CSTCE16M0V53-R0 RES 10.0K OHM 1/8W 1% 0805 SMD © 2005 Microchip Technology Inc. ECJ-2VB1C104K C0805C105K8RACTU DS51572A-page 15 WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.com Australia - Sydney Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 India - Bangalore Tel: 91-80-2229-0061 Fax: 91-80-2229-0062 China - Beijing Tel: 86-10-8528-2100 Fax: 86-10-8528-2104 India - New Delhi Tel: 91-11-5160-8631 Fax: 91-11-5160-8632 Austria - Weis Tel: 43-7242-2244-399 Fax: 43-7242-2244-393 Denmark - Copenhagen Tel: 45-4450-2828 Fax: 45-4485-2829 China - Chengdu Tel: 86-28-8676-6200 Fax: 86-28-8676-6599 India - Pune Tel: 91-20-2566-1512 Fax: 91-20-2566-1513 France - Paris Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 China - Fuzhou Tel: 86-591-8750-3506 Fax: 86-591-8750-3521 Japan - Yokohama Tel: 81-45-471- 6166 Fax: 81-45-471-6122 Germany - Munich Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 China - Hong Kong SAR Tel: 852-2401-1200 Fax: 852-2401-3431 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 Atlanta Alpharetta, GA Tel: 770-640-0034 Fax: 770-640-0307 Boston Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088 Chicago Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075 Dallas Addison, TX Tel: 972-818-7423 Fax: 972-818-2924 Detroit Farmington Hills, MI Tel: 248-538-2250 Fax: 248-538-2260 Kokomo Kokomo, IN Tel: 765-864-8360 Fax: 765-864-8387 Los Angeles Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608 San Jose Mountain View, CA Tel: 650-215-1444 Fax: 650-961-0286 China - Qingdao Tel: 86-532-502-7355 Fax: 86-532-502-7205 China - Shanghai Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 China - Shenyang Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 China - Shenzhen Tel: 86-755-8203-2660 Fax: 86-755-8203-1760 China - Shunde Tel: 86-757-2839-5507 Fax: 86-757-2839-5571 China - Wuhan Tel: 86-27-5980-5300 Fax: 86-27-5980-5118 China - Xian Tel: 86-29-8833-7250 Fax: 86-29-8833-7256 Malaysia - Penang Tel: 604-646-8870 Fax: 604-646-5086 Philippines - Manila Tel: 011-632-634-9065 Fax: 011-632-634-9069 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 Spain - Madrid Tel: 34-91-352-30-52 Fax: 34-91-352-11-47 UK - Wokingham Tel: 44-118-921-5869 Fax: 44-118-921-5820 Taiwan - Hsinchu Tel: 886-3-572-9526 Fax: 886-3-572-6459 Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Thailand - Bangkok Tel: 66-2-694-1351 Fax: 66-2-694-1350 Toronto Mississauga, Ontario, Canada Tel: 905-673-0699 Fax: 905-673-6509 07/01/05 DS51572A-page 16 © 2005 Microchip Technology Inc.