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 t he lik e is provided only for your convenience
and may be su perseded by upda t es . It is y our 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
devices in life supp ort and/or safety ap plications is entir ely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless M icrochip from any and all dama ges, claims,
suits, or expenses re sulting from such use. No licens es are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
K
logo, rfPIC and UNI/O are registered trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL 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, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial
Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified
logo, MPLIB, MPLINK, mTouch, Omniscient Code
Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,
PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance,
TSHARC, UniWinDriver, WiperLock and ZENA 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.
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC
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.
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 p age 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.
For the most up-to-date information on development tools, see the MPLAB
Select the Help menu, and then Topics to open a list of available online help files.
®
IDE on-line help.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
CAN/LIN/J2602 PICtail
include:
• Document Layout
• Conventions Used in this Guide
• Warranty Registration
• Recommended Reading
• The Microchip Web Site
• Development Systems Customer Change Notification Service
• Customer Support
• Document Revision History
DOCUMENT LAYOUT
This document describes how to use the CAN/LIN/J2602 PICtail™ (Plus) Daughter
Board as a development tool to emulate and debug firmware on a target board. The
manual layout is as follows:
• Chapter 1. Introduction – This chapter introduces the CAN/LIN/J2602 PICtail
(Plus) Daughter Board and provides an overview of its features.
• Chapter 2. Hardwar e – This chapter provides a functional overview of the
CAN/LIN/J2602 PICtail (Plus) Daughter Board and identifies the major hardware
components.
• Appendix A. Drawings and Schematics – This appendix provides detailed
technical drawings and schematic diagrams of the CAN/LIN/J2602 PICtail (Plus)
Daughter Board.
™
(Plus) Daughter Board. Items discussed in this chapter
Choice of mut ually exclus ive
arguments; an OR selection
Represents code supplied by
user
“Save project before build”
4‘b0010, 2‘hF1
any valid filename
[options]
errorlevel {0|1}
var_name...]
void main (void)
{ ...
}
®
IDE User’s Guide
DS70319B-page 6 2011 Microchip Technology Inc.
WARRANTY REGISTRATION
Please complete the enclosed Warranty Registration Card and mail it promptly.
Sending in the Warranty Registration Card entitles users 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 CAN/LIN/J2602 PICtail (Plus) Daughter Board.
Other useful documents are listed below. Microchip documents are available and
recommended as supplemental r eference resources.
Device Data Sh eets
Refer to the data sheet for the specific dsPIC33F or PIC24 device you are using.
Specifically , refer to the sections in these data sheets that provide detailed information
on the device UART and ECAN modules.
Readme Files
For the latest information on using other tools, read the tool-specific Readme files in
the Readmes subdirectory of the MPLAB
contain update information and known issues that may not be included in this user’s
guide.
Preface
®
IDE installation directory. The Readme files
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
DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip’s customer notification service helps keep customers current on Microchip
products. Subscribers will receive e-mail notification whenever there are changes,
updates, revisions or errata related to a specified product family or development tool of
interest.
To register, access the Microchip web site at www.microchip.com, click on Customer
Change Notification and follow the registration instructions.
The Development Systems product group categories are:
• Compilers – The latest information on Microchip C compilers and other language
tools. These include the MPLAB C18 and MPLAB C30 C compilers; MPASM™
and MPLAB ASM30 assemblers; MPLINK™ and MPLAB LINK30 object linkers;
and MPLIB™ and MPLAB LIB30 object librarians.
• Emulators – The latest information on Microchip in-circuit emulators.This
includes the MPLAB ICE 2000 and MPLAB ICE 4000.
• In-Circuit Debuggers – The latest information on the Microchip in-circuit
debugger, MPLAB ICD 2.
• MPLAB
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 programmers. These include
the MPLAB PM3 and PRO MATE
Plus and PICkit™ 1 development programmers.
®
IDE – The latest information on Microchip MPLAB IDE, the Windows®
®
II device programmers and the PICSTART®
DS70319B-page 8 2011 Microchip Technology Inc.
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
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
• Added support for PIC18 Explorer Development Board.
DS70319B-page 10 2011 Microchip Technology Inc.
Thank you for purchasing Microchip Technology’s CAN/LIN/J2602 PICtail™ (Plus)
Daughter Board. This board is compatible with both the Explorer 16 Development
Board and the PIC18 Explorer Board to facilitate rapid implementation and evaluation
of applications that use Controller Area Network (CAN) and Local Interconnect Network
(LIN) interfaces and are implemented on dsPIC33F Digital Signal Controllers, PIC24
16-bit microcontrollers and PIC18 8-bit microcontrollers.
This chapter introduces the CAN/LIN/J2602 PICtail™ (Plus) Daughter Board and
provides an overview of its features. Topics covered include:
• Overview
• Functional Overview
1.1OVERVIEW
The CAN/LIN/J2602 PICtail™ (Plus) Daughter Board augments development of
dsPIC33F and PIC24 based applications on the Explorer 16 Development Board and
augments development of PIC18 based applications on the PIC18 Explorer Development Board. It offers two interfaces: one for a CAN bus and one for a LIN bus. Although
CAN and LIN protocols are used most extensively in automotive applications, the
CAN/LIN/J2602 PICtail™ (Plus) Daughter Board can be used in any application that
requires interfacing to a CAN and LIN bus.
Both interfaces can be used simultaneously. Appropriate bus transceivers on the
CAN/LIN/J2602 PICtail™ (Plus) Daughter Board complete the physical layer requirements of the CAN and LIN bus protocols. In both cases, communication is driven by
the dsPIC33F, PIC24 or PIC18 device on its respective development board.
Figure 1-1 shows the CAN/LIN/J2602 PICtail™ (Plus) Daughter Board plugged into the
PICtail Plus slot on the Explorer 16 Development Board, and Figure 1-2 shows the
CAN/LIN/J2602 PICtail™ (Plus) Daughter Board plugged into the PICtail slot on the
PIC18 Explorer Development Board. The CAN/LIN/J2602 PICtail™ (Plus) Daughter
Board draws 9V, 5V and 3.3V DC power from the connected development board. The
external power supply and MPLAB ICD 3 are plugged into the development board.
The block diagram shown in Figure 1-3 illustrates the mainstream operation of the
CAN/LIN/J2602 PICtail™ (Plus) Daughter Board. The board contains two LIN signal
conditioning circuits and two CAN signal conditioning circuits. The board also enables
power to be provided by the development board it is connected to, or by an external
12V DC source.
Introduction
FIGURE 1-3:CAN/LIN/J2602 PICtail
™
(Plus) DAUGHTER BOARD BLOCK DIAGRAM
1.2.1LIN Operation
2011 Microchip Technology Inc.DS70319B-page 13
The CAN/LIN/J2602 PICtail™ (Plus) Daughter Board connects two LIN transceivers
with integrated voltage regulators to UART modules on a dsPIC33F, PIC24 or PIC18
control device on the Explorer 16 or PIC18 Explorer Board. The LIN transceiver monitors the LIN bus, conditions the incoming signal and passes it to the UART module on
the control device. The LIN transceiver responds to a “Transmit Enable” from the control device by conditioning an output signal and placing it on the LIN bus.
A Power-down mode turns the transmitter and voltage regulator off, leaving only the
receiver and wake-up circuits in operation. Each LIN circuit includes a Master/Slave
jumper to accommodate a Master node on the LIN bus.
In order to use the transmit enable for the LIN2 transceiver with the PIC18 Explorer
Board and a PIC18 device, the LIN2TXE pin must be connected to 5V, or a pin on the
PIC18 device, to control it. This can be done by connecting a jumper wire on the J18
header between LIN2TXE and either the 5V supply also on the J18 header, or an available pin on either the J17 or J18 header. For more information on the J17 and J18
headers see Section 2.3 “Auxiliary Header Pinouts”.
For PIC18 devices, the pinout for the LIN1 and LIN2 modules can be different. The
jumpers J4, J8, J13 and J14 are for choosing between these pinouts. For the specific
pinout that is necessary for the PIC18 that is used, refer to that device’s data sheet. For
PIC24 and dsPIC33 devices, make sure to leave the J4, J8, J13 and J14 jumpers
disconnected. Otherwise, these connections can disrupt LIN communications.
For detailed information on the MCP2021-500 LIN Transceiver, refer to Microchip Data
Sheet MCP202X “LIN Transceiver with Voltage Regulator” (DS22018).
1.2.2CAN Operation
The CAN/LIN/J2602 PICtail™ (Plus) Daughter Board connects two high-speed CAN
transceivers to ECAN modules on the control device on the development board. The
CAN transceivers convert the differential signal on the CAN bus to a digital signal for
the ECAN module. It also converts the ECAN output digital signal to a differential signal
for the CAN bus.
All PIC18 devices have one CAN module, which is connected to the CAN1 transceiver
(U3). For some PIC18s, there is an optional alternate pinout for the CAN module that
is chosen by an internal MUX. This alternate pinout is connected to the CAN2 transceiver (U4). Depending on the number of pins the device has, this alternate pinout has
two options. These two options are chosen by the two jumpers (J15 and J16). For
detailed information on the CAN pinout options for the PIC18, refer to that device’s data
sheet. Also, the alternate CAN pinout for some PIC18s is the same as the LIN1 pinout.
If this is the case, LIN1 and CAN communications cannot be used simultaneously. For
PIC24 and dsPIC33 devices, make sure to leave J15 and J16 disconnected.
Otherwise, these connections can disrupt CAN communications.
In Sleep mode, the CAN transmitter is turned off, and the receiver operates at a lower
current level. The control device monitors CAN activity and switches the transceiver
back to normal operation when needed.
For detailed information on the MCP2551 High-Speed CAN Transceiver, refer to
Microchip Data Sheet MCP2551 “High-Speed CAN Transceiver” (DS21667).
DS70319B-page 14 2011 Microchip Technology Inc.
This chapter provides a functional overview of the CAN/LIN/J2602 PICtail (Plus)
CAN Bus
PICtail™ Plus Signal Connector
LIN Bus
Terminals
2x15
Headers
Power Source
Jumper
Connectors
PICtail™ Plus Signal
Connector
Daughter Board and identifies the major hardware components. Topics covered
include:
• Board Setup
• Hardware Components
2.1BOARD SETUP
Figure 2-1 is a photograph of the CAN/LIN/J2602 PICtail (Plus) Daughter Board. Callouts indicate the CAN bus, LIN bus and signal connections on the daughter board. Also
shown are two 2x15 headers that provide signals from the development board. These
headers can be probed for development, testing or monitoring of the application. For
their specific pinouts, see Section 2.3 “Auxiliary Header Pinouts”.
CAN/LIN/J2602 PICtail™ (Plus)
DAUGHTER BOARD USER’S GUIDE
Chapter 2. Hardware
FIGURE 2-1:CAN/LIN/J2602 PICtail
™
(Plus) DAUGHTER BOARD
The daughter board obtains 9V DC input power from either the Explorer 16 Development Board through the 120-pin signal connector (J7) or the PIC18 Development
Board through the 4-pin connector (J6) that is part of the PICtail™ daughter board connector on the underside of the board. The power supply to the LIN bus transceivers is
switchable between the 9V available from the development board or an external +12V
supply. This external power supply must be connected to J1. Jumper J2 must be set to
use the required power supply.
1Explorer 16 Board PICtail™ Plus Connector (J7)11CAN1 Transceiver (U3)
2Auxiliary Headers (J17, J18)12CAN1 Bus Termination Jumper (JP4)
3LIN2 Master/Slave Jumper (JP13)13CAN1 Bus Connector (P2)
4LIN2 Transceiver (U2)14CAN2 Transceiver (U4)
5LIN2 Bus Connector (J12)15CAN2 Bus Connector (P2)
6LIN Power Select Jumper (J2)16CAN2 Bus Termination Jumper (JP5)
7LIN1 Master/Slave Jumper (JP12)17
Alternate LIN 2 Module Pinout Jumpers (J4, J8, J13, J14)
8LIN1 Transceiver (U1)18
Alternate CAN 1 Module Alternate Pinout Jumpers
(J15, J16)
9LIN1 Bus Connector (J10)19
PIC18 Explorer Board PI Ctail™ Connector (J3, J5, J 6,
J9, J11)
10LIN External +12V DC Terminal Block (J1)
J18
J17
J2
J1
J12
J10
C10
C8
C5
U3
P1
JP4
U1
C4
R5
D7R2
D8
JP12
U2
R4
D4
C11
C9
D1
D5
C7
C1
C2
D6
JP13
D3
J4 J8 J13
J4
J8J13
RG0
RG3
RE6
LIN1RX LIN1TX LIN2RX
J14 J15 J16
RC7RC6RD7
J14J15J16
RE7RE5RE4
LIN2TX
CAN2TX
CAN2RX
RD6
RC6RC7
P2
C6
R6
U4
R7
R8
JP5
9
5
10
13
11
19
2
19
364
7
8
16
P2
14
12
18
72
1
2.2HARDWARE COMPONENTS
Figure 2-2 identifies the key hardware components on the CAN/LIN/J2602 PICtail
(Plus) Daughter Board.
FIGURE 2-2:CAN/LIN/J2602 PICtail
™
(Plus) DAUGHTER BOARD
DS70319B-page 16 2011 Microchip Technology Inc.
Hardware
2.2.1Explorer 16 Board PICtail™ Connector (J7)
Explorer 16 Board PICtail connector J7 (see Reference 1), a 120-pin signal connector
that carries signals from the I/O pins of the dsPIC33F or PIC24 device on the Explorer
16 Board to the CAN/LIN/J2602 PICtail (Plus) Daughter Board. This connector handles
the following signals:
• 9V, 5V and 3.3V DC input to the CAN/LIN/J2602 PICtail (Plus) Daughter Board
• Signals from the ECAN modules on the dsPIC33F or PIC24 device to the CAN
transceivers on the CAN/LIN/J2602 PICtail (Plus) Daughter Board
• Signals from the UART modules on the dsPIC33F or PIC24 device to the LIN
transceivers on the CAN/LIN/J2602 PICtail (Plus) Daughter Board
• LIN Bus Fault Communication
2.2.2Auxiliary Headers (J17, J18)
Auxiliary Headers J17 and J18 (see Reference 2) make a various set of signals available from the development board. These headers can be used for monitoring, testing
and development purposes. Refer to Section 2.3 “Auxiliary Header Pinouts”as we ll
as the board schematic for more details on these headers.
2.2.3LIN Bus Master/Slave Select Jumpers (JP12, JP13)
The LIN1 and LIN2 Bus Master/Slave Select Jumpers (see Reference 3 or
Reference 7) are used to indicate the presence of a master device on the LIN bus.
Placing jumper JP13 or JP12 pulls the LIN bus high via a 1K pull-up resistor. This can
be detected by nodes on the LIN bus as an indication that a Master node is present.
There can be only one Master node on a LIN bus.
2.2.4LIN Tr ansceivers (U1, U2)
A set of MCP2021 LIN transceivers (see Reference 8 and Reference 4) provide the
interface between the UART modules on the dsPIC33F, PIC24 or PIC18 device and the
LIN bus. The transceiver converts the signals from the UART modules on the control
device to a 5V regulated signal for the LIN bus. The power supply to the LIN transceivers is selectable between +12V or +9V with jumper J2 (see Reference 6). While the
+9V is available from the development board, the +12V supply must be connected
externally to J1 (see Reference 10). For PIC18 devices, the LIN 1 and LIN 2 modules
can be used on two sets of pins chosen by the J4, J8, J13 and J14 jumpers. Choose
the correct pinout corresponding to which PIC18 device is used.
2.2.5LIN Bus Connectors (J10, J12)
The LIN1 and LIN2 bus connectors are 3-pin terminal blocks that connect the
CAN/LIN/J2602 PICtail (Plus) Daughter Board to a LIN bus. LIN1 connector J10 (see
Reference 9) connects UART1 module on the dsPIC33F, PIC24 or PIC18 control
device to the LIN bus via the LIN1 transceiver. LIN2 connector J12 (see Reference 5)
connects UART 2 module on the dsPIC33F, PIC24 or PIC18 control device to the LIN
bus via the LIN2 transceiver.
2.2.6LIN Transceiver Power Supply Select Jumper (J2)
This 3-pin jumper (see Reference 6) selects the power supply to LIN transceivers U1
and U2. Either +9V DC is supplied from the development board or +12V DC is supplied
from an external power supply connected to J1 (see Reference 10).
2.2.7External +12V DC LIN Power Supply Terminal Block (J9)
External +12V DC power for the LIN transceivers must be connected to J1 (see
Reference 10).
A pair of MCP2551 CAN transceivers (see Reference 11 and Reference 14) provide
the interface between the ECAN modules on the dsPIC33F, PIC24 or PIC18 control
device and the CAN bus. The transceiver converts the signals from the ECAN modules
on the dsPIC33F, PIC24 or PIC18 device to a pair of differential CAN bus signals.
2.2.9CAN Bus Termination Jumpers (JP4, JP5)
Termination Jumpers (JP4, JP5) are provided to terminate the CAN bus. Jumper JP4
(see Reference 12) places a 120 ohm termination resistor across the CAN bus connected to CAN1. Jumper JP5 (see Reference 16) places a 120 ohm termination
resistor across the CAN bus connected to CAN2.
2.2.10CAN Bus Connectors (P1, P2)
Nine-pin D-type connectors connect the CAN/LIN/J2602 PICtail (Plus) Daughter Board
to a CAN bus. CAN1 connector P1 (see Reference 13) connects ECAN 1 module on
the dsPIC33F , PIC24 or PIC18 control device to the CAN bus via the CAN transceiver.
CAN2 connector P2 (see Reference 15) connects ECAN 2 module on the dsPIC33F or
PIC24 device and the ECAN1 module’s alternate pinout on the PIC18 device to the CAN
bus via the CAN transceiver.
For PIC18 devices, the alternate pinout of the ECAN1 module can be used on two sets
of pins chosen by the J15 and J16 jumpers. Choose the correct pinout corresponding
to the PIC18 device used. The CAN bus provides high and low differential signals.
For PIC18 devices, depending on which device is used and how many pins it has, the
LIN1 and LIN2 module will be available on two different sets of pins. The J4, J8, J13
and J14 jumpers are used to select between these two options (see Reference 17).
For PIC18 devices, depending on which device is used and how many pins it has, the
CAN 1 module’s alternate pinout chosen by its internal multiplex will be available on
two different sets of pins. The J15 and J16 jumpers are used to select between these
two options (see Reference 18).
2.2.13PIC18 Explorer Board PICtail™ Connector (J3, J5, J6, J9, J11)
PIC18 Explorer Board PICtail connector (see Reference 19) is made up of five connectors that carry signals from the I/O pins of the PIC18 device on the PIC18 Explorer
Board to the CAN/LIN/J2602 PICtail (Plus) Daughter Board. This connector handles
the following signals:
• 9V, 5V and 3.3V DC input to the CAN/LIN/J2602 PICtail (Plus) Daughter Board
• Signals from the ECAN module on the PIC18 device to the CAN transceivers on
the CAN/LIN/J2602 PICtail (Plus) Daughter Board
• Signals from the UART modules on the PIC18 device to the LIN transceivers on
the CAN/LIN/J2602 PICtail (Plus) Daughter Board
• LIN Bus Fault Communication
DS70319B-page 18 2011 Microchip Technology Inc.
2.3AUXILIARY HEADER PINOUTS
The two auxiliary headers, J17 and J18, allow for monitoring and debugging other pins
from the microcontroller as well as the CAN and LIN pins. Depending on which development board is being used, the auxiliary headers have different pinouts. Table 2-1
maps out microcontroller pins to header pins for both development boards, the PIC18
Explorer Board and the Explorer 16 Board. Refer to Figure A-4 for the schematic of the
headers.
T able 2-1:PINOUT MAP FOR MICROCONTROLL ERS T O DEB UG HE ADERS
T able 2-1:PINOUT MAP FOR MICROCONTR OLLERS T O DEBUG HE ADERS (C ontin ued)
Header
J188DEBUG38RF6RB7
J189DEBUG39NCRB5
J1810DEBUG40NCRB10
J1811DEBUG41NCRB11
J1812DEBUG42NCRB12
J1813DEBUG43NCRB13
J1814DEBUG44NCRB14
J1815CAN1TXRB2RF1
J1816CAN1RXRB3RF2
J1817CAN2TXRC6 or RE5 (see J15)RG1
J1818CAN2RXRC7 or RE4 (see J16)RG0
J1819LIN1TXRC6 or RG3 (se e J8)RF3
J1820LIN1RXRC7 or RG0 (see J4)RF2
J1821LIN1CSRB1RE8
J1822LIN1TXERC2RD15
J1823LIN2TXRD6 or RD7 (see J14)RF5
J1824LIN2RXRD7 or RE6 (see J13)RF4
J1825LIN2CSRB4RA14
J1826LIN2TXEMust be connected to
Pin # on
Header
Name of Pin on
Header
PIC18 Explorer PinExplorer 16 Pin
RF13
either 5V or unused
PIC18 pin on the J18
header
This chapter provides a brief description of the code that can be used with the
CAN/LIN/J2602 PICtail (Plus) Daughter Board. When connected to the PIC18 Explorer
Board, the code included with the board can be used. When the daughter board is connected to the Explorer 16 Board, some examples available on Microchip’s web site
(www.microchip.com) can be used. Topics covered include:
• PIC18 Tutorial Overview
• dsPIC33F and PIC24H Tutorial Overview
3.1PIC18 TUTORIAL OVERVIEW
The PIC18 tutorial in this chapter demonstrates the CAN module features of the
PIC18FXXK80 family in mode 1. When either the PIC18F46K80 PIM or PIC18F66K80
PIM is connected to the PIC18 Explorer Board, and is interfaced with the
CAN/LIN/J2602 PICtail (Plus) Daughter Board, the tutorial demonstrates how to transmit and receive with the CAN module.
The PIC18 tutorial project, ECAN_Daughterboard.mcp, is written in C for MPLAB
C18. Make sure that the correct PIC18FXXK80 device is chosen for the project. This
tutorial program transmits data over the CAN bus when the RB0 push button is
pressed, and has three filters with three buffers to receive data sent over the CAN bus.
The project contains three files, main.c, CAN.c, and CAN.h. The CAN.c and CAN.h
files contain the functions used for CAN communication. These files can be easily
ported to other projects if needed. The main.c file contains the code that handles the
CAN communication for this specific tutorial.
Specifically for this example, while running in mode 1, when a CAN message is
received that fits one of the three filters, 0x11 1, 0x444, and 0x0A0, the LEDs on PORTD
increment by one. When the push button on RB0 is pressed, a CAN message is transmitted. To show that the device is working properly, the LED on RD7 is toggled continuously at a constant rate.
T o effectively demonstrate this tutorial, a device is needed to transmit and receive messages to and from the PIC18FXXK80. Any device capable of CAN communication can
be used, but a CAN bus analyzer is the simplest to use. Microchip has a CAN bus analyzer available for purchase on the web called the CAN bus Analyzer Tool
(APGDT002). This analyzer tool can query the CAN bus for all messages transmitted
and received. It can be connected to the DB9 connectors on the CAN/LIN/J2602 PICtail
(Plus) Daughter Board.
Several code examples are available to demonstrate the usage and functionality of the
ECAN module on the dsPIC33F and PIC24H device families. These code examples
include:
• dsPIC33F code examples:
- CE127: Crosswire Communication between ECAN1 and ECAN2 modules
- CE128: ECAN FIFO Receive Example
- CE129: Processing of Remote Transmission Requests using ECAN
• PIC24H code examples:
- CE227: Crosswire Communication between ECAN1 and ECAN2 modules
- CE228: ECAN FIFO Receive Example
- CE229: Processing of Remote Transmission Requests using ECAN
All dsPIC33F and PIC24H code examples are available as freely-downloadable source
code on the web site: www.microchip.com/codeexamples.
In addition, the dsPIC33F/PIC24H Peripheral Library, included with the MPLAB C30
compiler, contains several driver functions for the ECAN module.
3.2.2LIN Software
LIN Master and Slave driver functions and application examples supporting the
dsPIC33F, PIC24H and PIC24F device families are under development.
This software will be available for free download from the Microchip web site
(www.microchip.com), along with an Application Note describing the usage and
functionality of the LIN drivers.
DS70319B-page 22 2011 Microchip Technology Inc.
CAN/LIN/J2602 PICtail™ (Plus)
J18
J17
J2
J1
J12
J10
C10
C8
C5
U3
P1
JP4
U1
C4
R5
D7R2
D8
JP12
U2
R4
D4
C11
C9
D1
D5
C7
C1
C2
D6
JP13
D3
J4 J8 J13
J4
J8J13
RG0
RG3
RE6
LIN1RX LIN1TX LIN2RX
J14 J15 J16
RC7RC6RD7
J14J15J16
RE7RE5RE4
LIN2TX
CAN2TX
CAN2RX
RD6
RC6RC7
P2
C6
R6
U4
R7
R8
JP5
DAUGHTER BOARD USER’S GUIDE
Appendix A. Drawings and Schematics
This appendix provides drawings a nd schemati c di agrams of th e CAN/LIN/J 2602
PICtail (Plus) Daughter Board for both Revision 1 and Revis ion 2 .
Figure A-1 is a drawing of the CAN/LIN/J2602 PICtail (Plus) Daughter Board
(AC164130-2) layout. Figure A-2 is a drawing of the CAN/LIN/J2602 PICtail (Plus)
Daughter Board (AC164130) layout.
FIGURE A-1:CAN/LIN/J2602 PICTAIL™ (Plu s) DAUG HTER B OARD ( AC164130 -2) LAYOUT
FIGURE A-2:CAN/LIN/J2602 PICtail™ (Plus) DAUGHTER BOARD (AC164130 ) LAYOU T
(REVISION 2)
A.2SCHEMATIC DIAGRAMS
This appendix shows the schematic diagrams for both Revision 1 and Revision 2. The
following schematic diagrams are included in this appendix for AC164130-2 revision of
the CAN/LIN/J2602 PICtail (Plus) Daughter Board:
• Figure A-3: LIN and CAN Circuit Schematics
• Figure A-4: Connector and Header Pinout Schematics
The following schematic diagrams are included in this appendix for Revision 1 of the
CAN/LIN/J2602 PICtail (Plus) Daughter Board:
• Figure A-5: LIN Circuit Schematics
• Figure A-6: CAN Circuit Schematics
• Figure A-7: Connector and Header Pinout Schematics
• Figure A-8: (AC164130) of the CAN/LIN/J2602 PICtail (Plus) Daughter Board.