• PICDEM CAN-LIN 3 Development Kit for 64/80-Pin Enhanced CAN ...


  •   
  • FileName: 51423a Users Guide.pdf
    • Abstract: applications and the like is intended through suggestion only ... ensure that your application meets with your specifications. No representation or ...

Download the ebook

PICDEM™ CAN-LIN 3
Development Kit
for 64/80-pin
Enhanced CAN Devices
User’s Guide
 2003 Microchip Technology Inc. DS51423A
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 Trademarks
applications and the like is intended through suggestion only The Microchip name and logo, the Microchip logo, Accuron,
and may be superseded by updates. It is your responsibility to dsPIC, KEELOQ, MPLAB, PIC, PICmicro, PICSTART,
ensure that your application meets with your specifications.
PRO MATE and PowerSmart are registered trademarks of
No representation or warranty is given and no liability is
Microchip Technology Incorporated in the U.S.A. and other
assumed by Microchip Technology Incorporated with respect
countries.
to the accuracy or use of such information, or infringement of
patents or other intellectual property rights arising from such AmpLab, FilterLab, microID, MXDEV, MXLAB, PICMASTER,
use or otherwise. Use of Microchip’s products as critical SEEVAL and The Embedded Control Solutions Company are
components in life support systems is not authorized except registered trademarks of Microchip Technology Incorporated
with express written approval by Microchip. No licenses are in the U.S.A.
conveyed, implicitly or otherwise, under any intellectual Application Maestro, dsPICDEM, dsPICDEM.net, ECAN,
property rights. ECONOMONITOR, FanSense, FlexROM, fuzzyLAB,
In-Circuit Serial Programming, ICSP, ICEPIC, microPort,
Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM,
PICkit, PICDEM, PICDEM.net, PowerCal, PowerInfo,
PowerMate, PowerTool, rfLAB, rfPIC, Select Mode,
SmartSensor, SmartShunt, 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.
© 2003, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
Microchip received QS-9000 quality system
certification for its worldwide headquarters,
design and wafer fabrication facilities in
Chandler and Tempe, Arizona in July 1999
and Mountain View, California in March 2002.
The Company’s quality system processes and
procedures are QS-9000 compliant for its
PICmicro® 8-bit MCUs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals,
non-volatile memory and analog products. In
addition, Microchip’s quality system for the
design and manufacture of development
systems is ISO 9001 certified.
DS51423A-page ii  2003 Microchip Technology Inc.
PICDEM™ CAN-LIN 3
USER’S GUIDE
Table of Contents
Preface
Introduction............................................................................................................ 1
Highlights............................................................................................................... 1
About This Guide................................................................................................... 1
Warranty Registration............................................................................................ 3
Recommended Reading........................................................................................ 3
Troubleshooting..................................................................................................... 3
Microchip On-Line Support.................................................................................... 4
Customer Change Notification Service ................................................................. 4
Customer Support ................................................................................................. 5
Chapter 1. Introduction to the PICDEM CAN-LIN 3 Board
1.1 Introduction...................................................................................................... 7
1.2 Highlights......................................................................................................... 7
1.3 PICDEM CAN-LIN 3 Development Kit Contents ............................................. 7
1.4 Overview of the PICDEM CAN-LIN 3 Board ................................................... 7
1.5 PICDEM CAN-LIN 3 Board Features .............................................................. 9
1.6 CANKing Host Software ................................................................................ 12
Chapter 2. Getting Started with the PICDEM CAN-LIN 3 Board
2.1 Highlights....................................................................................................... 13
2.2 Host Computer Requirements....................................................................... 13
2.3 Using the PICDEM CAN-LIN 3 Board for the First Time ............................... 13
2.4 Checking the Board in Evaluation Mode ....................................................... 18
Chapter 3. Getting Started with the CANKing Software
3.1 Highlights....................................................................................................... 19
3.2 Software Overview ........................................................................................ 19
3.3 Starting the Program ..................................................................................... 19
3.4 Introduction to the Templates ........................................................................ 20
3.5 The Main Menu ............................................................................................. 20
3.6 The Output Window....................................................................................... 21
3.7 Customizing Projects..................................................................................... 22
 2003 Microchip Technology Inc. DS51423A-page iii
PICDEM™ CAN-LIN 3 User’s Guide
Chapter 4. Using the CANKing Templates
4.1 Highlights....................................................................................................... 23
4.2 PIC Register View Template ......................................................................... 23
4.3 The Basic Template ...................................................................................... 29
4.4 PIC18+CAN Evaluation Board Template ...................................................... 33
4.5 Template Specific Variations in the Main Menu ............................................ 37
Chapter 5. Reconfiguring the PICDEM CAN-LIN 3 Hardware
5.1 Highlights....................................................................................................... 39
5.2 Node Configurations...................................................................................... 39
5.3 Oscillator Configurations ............................................................................... 40
5.4 Configuring the Development Board Options................................................ 40
5.5 Restoring the PICDEM CAN-LIN 3 Firmware................................................ 43
Chapter 6. Troubleshooting
6.1 Highlights....................................................................................................... 45
6.2 Common Problems........................................................................................ 45
Appendix A. PICDEM CAN-LIN 3 Board Technical Information
A.1 Highlights ...................................................................................................... 47
A.2 PICDEM CAN-LIN 3 Block Diagram ............................................................. 47
A.3 PICDEM CAN-LIN 3 Board Schematics ....................................................... 48
Appendix B. FAQs on Configuring PIC18 CAN Devices
B.1 Highlights ...................................................................................................... 57
B.2 FAQs............................................................................................................. 57
Appendix C. PICDEM CAN-LIN 3 Software CD
C.1 Highlights ...................................................................................................... 59
C.2 What’s on the CD.......................................................................................... 59
Index .............................................................................................................................61
Worldwide Sales and Service .....................................................................................64
DS51423A-page iv  2003 Microchip Technology Inc.
PICDEM™ CAN-LIN 3
USER’S GUIDE
Preface
INTRODUCTION
This chapter contains general information about this manual and contacting customer
support.
HIGHLIGHTS
Items discussed in this chapter are:
• About this Guide
• Warranty Registration
• Recommended Reading
• Troubleshooting
• Microchip On-Line Support
• Customer Change Notification Service
• Customer Support
ABOUT THIS GUIDE
Document Layout
This document describes how to use the PICDEM™ CAN-LIN 3 Development Board
as a development system for Microchip Technology’s PIC18F6585/6680/8585/8680
family of enhanced CAN microcontrollers. The manual layout is as follows:
• Chapter 1: Introduction to the PICDEM™ CAN-LIN 3 Board – What the
PICDEM CAN-LIN 3 board is, what makes it a desirable development tool and
what features are available.
• Chapter 2: Getting Started with the PICDEM™ CAN-LIN 3 Board – Describes
how to connect and begin to use the PICDEM CAN-LIN 3 board.
• Chapter 3: Getting Started with the CANKing Software – Gives a brief overview
of the CANKing host software and the concept of the predefined templates.
• Chapter 4: Using the CANKing Templates – Provides a more detailed
description of the individual templates and how to use them.
• Chapter 5: Reconfiguring the PICDEM™ CAN-LIN 3 Hardware – Describes
various multi-node configurations of the board, and how to customize certain
features.
• Chapter 6: Troubleshooting – Provides information on solving common
problems.
• Appendix A: PICDEM™ CAN-LIN 3 Technical Information – Provides the block
diagram and detailed schematics of the PICDEM CAN-LIN 3 board.
• Appendix B: FAQs on Configuring PIC18 CAN Devices – Provides a list of
the most commonly encountered issues when programming PIC18 CAN
microcontrollers, as well some solutions.
• Appendix C: PICDEM™ CAN-LIN 3 Software CD – Provides a summary of the
software on the accompanying CD-ROM.
 2003 Microchip Technology Inc. DS51423A-page 1
PICDEM™ CAN-LIN 3 User’s Guide
• Index – Cross-reference listing of terms, features and sections of this document.
• Worldwide Sales and Service – Lists the address, telephone and fax number for
Microchip Technology Inc. sales and service locations throughout the world.
Conventions Used in This Guide
This manual uses the following documentation conventions:
TABLE 1: DOCUMENTATION CONVENTIONS
Description Represents Examples
Code (Courier font):
Plain characters Sample code #define START
File names and paths c:\autoexec.bat
Angle brackets: < > Variables ,
Square brackets [ ] Optional arguments MPASMWIN [main.asm]
Curly brackets and pipe Choice of mutually exclusive errorlevel {0|1}
character: { | } arguments; An OR selection
Lower case characters Type of data “filename”
in quotes
Ellipses... Used to imply (but not show) list
additional text that is not relevant to [“list_option...,
the example “list_option”]
0xnnn A hexadecimal number where n is a 0xFFFF, 0x007A
hexadecimal digit
Italic characters A variable argument; it can be either a char isascii (char,
type of data (in lower case characters) ch);
or a specific example (in upper case
characters).
Interface (Arial font):
Underlined, italic text A menu selection from the menu bar File > Save
with right arrow
Bold characters A window or dialog button to click OK, Cancel
Characters in angle A key on the keyboard ,
brackets < >
Documents (Arial font):
Italic characters Referenced books MPLAB® IDE User’s Guide
Documentation Updates
All documentation becomes dated and this user’s guide is no exception. Since
MPLAB® IDE, MPLAB C1X and other Microchip tools are constantly evolving to meet
customer needs, some actual dialogs and/or tool descriptions may differ from those in
this document. Please refer to our web site to obtain the latest documentation available.
Documentation Numbering Conventions
Documents are numbered with a “DS” number. The 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 = The document number.
A = The revision level of the document.
DS51423A-page 2  2003 Microchip Technology Inc.
Preface
WARRANTY REGISTRATION
Please complete the enclosed Warranty Registration Card and mail it promptly.
Sending in your Warranty Registration Card entitles you to receive new product
updates. Interim software releases are available at the Microchip web site.
RECOMMENDED READING
This user’s guide describes how to use the PICDEM CAN-LIN 3 Development Kit. The
data sheets contain current information on programming the specific microcontroller
devices.
MPLAB® IDE User’s Guide (DS51025)
Comprehensive guide that describes installation and features of Microchip’s MPLAB
Integrated Development Environment (IDE), as well as the editor and simulator
functions in the MPLAB IDE environment.
MPASM™ User’s Guide with MPLINK™ and MPLIB™ (DS33014)
This user’s guide describes how to use the Microchip PICmicro® MCU MPASM
assembler, the MPLINK object linker and the MPLIB object librarian.
Technical Library CD-ROM (DS00161)
This CD-ROM contains comprehensive application notes, data sheets and technical
briefs for all Microchip products. To obtain this CD-ROM, contact the nearest Microchip
Sales and Service location (see back page) or download individual data sheet files from
the Microchip web site (http://www.microchip.com).
Embedded Control Handbook (DS00711)
This handbook consists of several documents that contain a wealth of information
about microcontroller applications. To obtain these documents, contact the nearest
Microchip Sales and Service location (see back page).
The application notes described in these manuals are also obtainable from Microchip
Sales and Service locations or from the Microchip web site (http://www.microchip.com).
PICmicro® Mid-Range MCU Family Reference Manual (DS33023) and
PICmicro® 18C MCU Family Reference Manual (DS39500)
These manuals explain the general details and operation of the mid-range and
advanced MCU family architecture and peripheral modules. They are designed to
complement the device data sheets.
PIC18F6585/6680/8585/8680 Device Data Sheet (DS30491)
This is the definitive reference for Microchip’s 64 and 80-pin Enhanced CAN
microcontrollers, that are at the heart of the PICDEM CAN-LIN 3 Demonstration Kit.
Microsoft® Windows® Manuals
This manual assumes 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 Windows.
TROUBLESHOOTING
See Chapter 6 “Troubleshooting” for information on common problems.
 2003 Microchip Technology Inc. DS51423A-page 3
PICDEM™ CAN-LIN 3 User’s Guide
MICROCHIP ON-LINE SUPPORT
Microchip provides on-line support on the Microchip web site at:
http://www.microchip.com
A file transfer site is also available by using an FTP service connecting to:
ftp://ftp.microchip.com
The web site and file transfer site provide a variety of services. Users may
download files for the latest development tools, data sheets, application notes,
user’s guides, articles and sample programs. A variety of Microchip specific business
information is also available, including listings of Microchip sales offices and
distributors. Other information available on the web site includes:
• Latest Microchip press releases
• Technical support section with FAQs
• Design tips
• Device errata
• Job postings
• Microchip consultant program member listing
• Links to other useful web sites related to Microchip products
• Conferences for products, development systems, technical information and more
• Listing of seminars and events
CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip started the customer notification service to help customers stay current on
Microchip products with the least amount of effort. Once you subscribe, you will receive
email notification whenever we change, update, revise or have errata related to your
specified product family or development tool of interest.
Go to the Microchip web site (www.microchip.com) and click on Customer Change
Notification. Follow the instructions to register.
The Development Systems product group categories are:
• Compilers
• Emulators
• In-Circuit Debuggers
• MPLAB IDE
• Programmers
Here is a description of these categories:
Compilers – The latest information on Microchip C compilers and other language
tools. These include the MPLAB C17, MPLAB C18 and MPLAB C30 C Compilers;
MPASM and MPLAB ASM30 assemblers; MPLINK and MPLAB LINK30 linkers; and
MPLIB and MPLAB LIB30 librarians.
Emulators – The latest information on Microchip in-circuit emulators. This includes the
MPLAB ICE 2000.
In-Circuit Debuggers – The latest information on Microchip in-circuit debuggers.
These include the MPLAB ICD and MPLAB ICD 2.
MPLAB – The latest information on Microchip MPLAB IDE, the Windows Integrated
Development Environment for development systems tools. This list is focused on the
MPLAB IDE, MPLAB SIM simulator, MPLAB IDE Project Manager and general editing
and debugging features.
Programmers – The latest information on Microchip device programmers. These include
the PRO MATE® II device programmer and PICSTART® Plus development programmer.
DS51423A-page 4  2003 Microchip Technology Inc.
Preface
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributors
• Local Sales Office
• Field Application Engineers (FAEs)
• Corporate Applications Engineers (CAEs)
• Systems Information and Upgrade Hot Line
Customers should call their distributor or field application engineer (FAE) for support.
Local sales offices are also available to help customers. See the last page of this
document for a listing of sales offices and locations.
Corporate applications engineers (CAEs) may be contacted at (480) 792-7627.
Systems Information and Upgrade Line
The Systems Information and Upgrade Information Line provides system users with 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 the most
current upgrade kits. The Information Line numbers are:
1-800-755-2345 for U.S. and most of Canada.
1-480-792-7302 for the rest of the world.
 2003 Microchip Technology Inc. DS51423A-page 5
PICDEM™ CAN-LIN 3 User’s Guide
NOTES:
DS51423A-page 6  2003 Microchip Technology Inc.
PICDEM™ CAN-LIN 3
USER’S GUIDE
Chapter 1. Introduction to the PICDEM CAN-LIN 3 Board
1.1 INTRODUCTION
The PICDEM™ CAN-LIN 3 Development Kit has been developed for the evaluation or
development of CAN network nodes, utilizing Microchip’s family of 64 and 80-pin CAN
microcontrollers. This tool is ideal for beginning CAN designers, as well as those new
to the PIC18F6585/6680/8585/8680 family of enhanced CAN devices.
The Demonstration Board provides three nodes (two CAN and one LIN bus) that can
be configured in numerous ways through jumpers and component selection. The CAN
nodes implement basic input and output functionality and can send and receive CAN
bus messages. The Host Software, included with the kit, allows fine manipulation of the
CAN devices down to the bit level, as well as high-level control of the microcontroller.
It also provides predefined templates for demonstration, evaluation and development
uses. Finally, the Demonstration Board provides new options for added
communications and motor control functionality.
1.2 HIGHLIGHTS
This chapter discusses:
• PICDEM CAN-LIN 3 Development Kit Contents
• Overview of the PICDEM CAN-LIN 3 Board
• PICDEM CAN-LIN 3 Board Features
• CANKing Host Software
1.3 PICDEM CAN-LIN 3 DEVELOPMENT KIT CONTENTS
Your PICDEM CAN-LIN 3 Development Kit contains the following items:
1. PICDEM CAN-LIN 3 Development Board, complete with three Microchip
controllers (PIC18F6680, PIC18F8680 and PIC18F1320) preprogrammed with
demo firmware.
2. A universal power supply (110-230 VAC input, 12 VDC output) and power cable
for the Development Board.
3. A male-to-female DB9 serial cable for use in communicating with the board.
4. The PICDEM CAN-LIN 3 CD-ROM with CANKing host software, User’s Guide
and other supporting documents.
5. A warranty registration card.
1.4 OVERVIEW OF THE PICDEM CAN-LIN 3 BOARD
Most demonstration or evaluation systems use a single microcontroller and are
designed to show off that controller’s features. While this makes sense in most situa-
tions, it also means that users must set up several boards to evaluate even a simple
network of a few nodes. The drawbacks to this arrangement should be obvious.
 2003 Microchip Technology Inc. DS51423A-page 7
PICDEM™ CAN-LIN 3 User’s Guide
In contrast, PICDEM CAN-LIN 3 provides three network nodes on one circuit board. By
using a common power supply and allowing the nodes to be configured in multiple
ways, the process of evaluating and developing network nodes can be significantly
streamlined.
The three nodes on the PICDEM CAN-LIN 3 board are:
• Node0, a CAN node implemented with a 64-pin PIC18F6680 microcontroller. This
node interfaces to the external host computer through a standard serial (RS-232)
interface and is directly controlled by the host software. It monitors both the
on-board and external CAN busses and can be used for basic PIC18F6X8X/8X8X
evaluation/development.
• Node1, a CAN node implemented with an 80-pin PIC18F8680 microcontroller.
This node communicates with Node0 over the on-board CAN bus. It also imple-
ments the CAN-to-LIN bus gateway to Node2 (below) and acts as the LIN bus
master node. Like Node0, Node1 can also be used for basic PIC18F6X8X/8X8X
evaluation/development.
• Node2, a LIN bus slave node, is implemented with the 20-pin PIC18F1320
microcontroller. It communicates to Node1 via the LIN bus.
Both the CAN and LIN busses are routed off-board through connectors, which allows
the board to be connected to an external bus.
1.4.1 Benefits of Using the PICDEM CAN-LIN 3 Board
Putting three nodes on one board gives the developer some definite benefits:
MULTIPLE HARDWARE CONFIGURATIONS WITH ONE BOARD: Of course, the
PICDEM CAN-LIN 3 board accommodates a large selection of CAN and LIN node
combinations. In addition, users can implement any one of three oscillator
configurations for the CAN nodes, or easily add other hardware to the board using the
prototyping area and headers.
Many of these configuration changes are performed with jumpers, while others require
component additions or removals. The board configurations and jumper locations are
discussed in detail in Chapter 5 “Reconfiguring the PICDEM CAN-LIN 3 Hardware”
and Chapter 6 “Troubleshooting”.
EASIER CAN NODE EVALUATION: The CANKing host software included with the
PICDEM CAN-LIN 3 Development Kit allows for fast evaluation of CAN node operation,
as well as the CAN protocol. Using one of the included template sets, users can eval-
uate everything from bit-level status of registers to node operation and bus status. The
host software and the templates are discussed in detail in Chapter 3 “Getting Started
with the CANKing Software” and Chapter 4 “Using the CANKing Templates”.
ENHANCED CAN NODE DEVELOPMENT: Including two CAN nodes on the PICDEM
CAN-LIN 3 board provides an additional tool for developing PIC18F6X8X/8X8X-based
CAN nodes, either by themselves or together. For example, a user might use the con-
troller in Node1 to prototype a CAN node, while using Node0 as a simple bus monitor
(using the basic template). Node0 could also be used as a tool to set or verify bit
timings, masks or filters.
The possibilities are not limited to what can be developed with just the nodes on the
board either. For example, Node0 can be included as part of a more complex develop-
mental network of many CAN nodes and serve as the “tap point” for monitoring the
entire network.
DS51423A-page 8  2003 Microchip Technology Inc.
Introduction to the PICDEM CAN-LIN 3 Board
1.5 PICDEM CAN-LIN 3 BOARD FEATURES
As mentioned, the PICDEM CAN-LIN 3 board consists of two CAN nodes (PIC18F8680
and PIC18F8680) and one LIN node (PIC18F1320). Node0, implemented by the
PIC18F6680 controller, acts as the main node. It interfaces with the host software
through a serial connection (RS-232) and either executes commands from the host
system or passes them to Node1. Node0 also interfaces with the on-board LCD
header. If an LCD is connected, Node0 can display text messages under host software
control.
Node1, implemented by the PIC18F8680, also acts as a CAN node and demonstrates
a CAN-to-LIN bridge. This node is controlled via Node0, which relays commands for
Node1 from the host system. Node1 receives these messages and performs the appro-
priate actions. This node also acts as a LIN Master mode and provides CAN-to-LIN
bridge functionality to Node2. As a LIN master, it receives messages from Node0 and
relays them to the LIN slave node.
Node2 is a LIN slave node implemented by the PIC18F1320. It communicates with
Node1 through its own external LIN bus transceiver, waiting for commands from
Node1and performing the appropriate actions.
As configured from the box, the behavior of the CAN nodes is determined by their
hardware configuration. While Node0 and Node1 both execute the exact same code,
the function of the node is decided by its hardware configuration. When either node is
reset, its firmware attempts to communicate with the external EEPROM. If the
EEPROM is found, the code assumes the role of Node0 and uses the USART to com-
municate with the host system. If the EEPROM is not found, it assumes the role of
Node1 and uses the USART for LIN bus communication. Since the EEPROM is
hard-wired to the Node0 (PIC18F6680) controller, this essentially ensures that this
controller will always be Node0.
Node0 and Node1 are connected via the on-board CAN bus, which is also available to
an external CAN bus through a D-shell connector. Node1 and Node2 are connected via
the on-board LIN bus. Node1 uses a separate LIN transceiver, while Node2 uses an
integrated LIN transceiver. The board routes the on-board LIN bus to the 3-pin header


Use: 0.3514