background image

CAN/LIN/J2602 PICtail

 (Plus)

DAUGHTER BOARD USER’S GUIDE

 2011 Microchip Technology Inc.

DS70319B-page 21

Chapter 3.  CAN/LIN/J2602 PICtail (Plus) Daughter Board 

Tutorial Program

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 con-
nected 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.1

PIC18 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 trans-
mit 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, 0x111, 0x444, and 0x0A0, the LEDs on PORTD 
increment by one. When the push button on RB0 is pressed, a CAN message is trans-
mitted. To show that the device is working properly, the LED on RD7 is toggled contin-
uously at a constant rate.

To effectively demonstrate this tutorial, a device is needed to transmit and receive mes-
sages 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 ana-
lyzer 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.

Содержание CAN/LIN/J2602 PICtail Plus

Страница 1: ...ss mainly focus on the distribution of electronic components Line cards we deal with include Microchip ALPS ROHM Xilinx Pulse ON Everlight and Freescale Main products comprise IC Modules Potentiometer...

Страница 2: ...2011 Microchip Technology Inc DS70319B CAN LIN J2602 PICtail Plus Daughter Board User s Guide...

Страница 3: ...y Incorporated in the U S A All other trademarks mentioned herein are property of their respective companies 2011 Microchip Technology Incorporated Printed in the U S A All Rights Reserved Printed on...

Страница 4: ...apter 2 Hardware 2 1 Board Setup 15 2 2 Hardware Components 16 2 3 Auxiliary Header Pinouts 19 Chapter 3 CAN LIN J2602 PICtail Plus Daughter Board Tutorial Program 3 1 PIC18 Tutorial Overview 21 3 2 d...

Страница 5: ...CAN LIN J2602 PICtail Plus Daughter Board User s Guide DS70319B page 4 2011 Microchip Technology Inc NOTES...

Страница 6: ...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...

Страница 7: ...ave Bold characters A dialog button Click OK A tab Click the Power tab N Rnnnn A number in verilog format where N is the total number of digits R is the radix and n is a digit 4 b0010 2 hF1 Text in an...

Страница 8: ...tool specific Readme files in the Readmes subdirectory of the MPLAB IDE installation directory The Readme files contain update information and known issues that may not be included in this user s gui...

Страница 9: ...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 lib...

Страница 10: ...les 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 availab...

Страница 11: ...ughter Board User s Guide DS70319B page 10 2011 Microchip Technology Inc DOCUMENT REVISION HISTORY Revision A January 2008 Initial Release of this Document Revision B March 2011 Added support for PIC1...

Страница 12: ...opment of PIC18 based applications on the PIC18 Explorer Develop ment 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...

Страница 13: ...BOARD CONNECTED TO EXPLORER 16 DEVELOPMENT BOARD FIGURE 1 2 CAN LIN J2602 PICtail Plus DAUGHTER BOARD CONNECTED TO PIC18 EXPLORER DEVELOPMENT BOARD CAN LIN J2602 PICtail Plus Daughter Board Explorer 1...

Страница 14: ...ning 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 inclu...

Страница 15: ...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 th...

Страница 16: ...testing or monitoring of the application For their specific pinouts see Section 2 3 Auxiliary Header Pinouts FIGURE 2 1 CAN LIN J2602 PICtail Plus DAUGHTER BOARD The daughter board obtains 9V DC inpu...

Страница 17: ...sceiver U4 5 LIN2 Bus Connector J12 15 CAN2 Bus Connector P2 6 LIN Power Select Jumper J2 16 CAN2 Bus Termination Jumper JP5 7 LIN1 Master Slave Jumper JP12 17 Alternate LIN 2 Module Pinout Jumpers J4...

Страница 18: ...re can be only one Master node on a LIN bus 2 2 4 LIN Transceivers U1 U2 A set of MCP2021 LIN transceivers see Reference 8 and Reference 4 provide the interface between the UART modules on the dsPIC33...

Страница 19: ...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 2 2 11 Alternate LIN1 and LIN...

Страница 20: ...16 Pin J17 1 DEBUG1 RE2 RB2 J17 2 DEBUG2 RA5 RF6 J17 3 DEBUG3 RE3 RF7 J17 4 DEBUG4 RA4 RG2 J17 5 DEBUG5 RA7 RF8 J17 6 DEBUG6 RA3 RG3 J17 7 DEBUG7 RA6 RB0 J17 8 DEBUG8 RC5 RB1 J17 9 DEBUG9 RC4 RB3 J17...

Страница 21: ...2TX RC6 or RE5 see J15 RG1 J18 18 CAN2RX RC7 or RE4 see J16 RG0 J18 19 LIN1TX RC6 or RG3 see J8 RF3 J18 20 LIN1RX RC7 or RG0 see J4 RF2 J18 21 LIN1CS RB1 RE8 J18 22 LIN1TXE RC2 RD15 J18 23 LIN2TX RD6...

Страница 22: ...he 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...

Страница 23: ...cation 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 downloa...

Страница 24: ...UT 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 LI...

Страница 25: ...ams 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 Pi...

Страница 26: ...2011 Microchip Technology Inc DS70319B page 25 FIGURE A 3 LIN AND CAN CIRCUIT SCHEMATICS LIN1 LIN2 CAN1 CAN2 LIN Circuits CAN Circuits 6X3 Jumper LIN Power...

Отзывы: