Interfacing CAN with PIC18F4580
On board Controller Area Network (CAN) transceiver connection is a prominent feature of the rhydoLABZ make PIC18F4580 Mini Development Board. For controlling the CAN, it has on board CAN Controller MCP 2551, and the connection pinout is provided via RMC connector K14 (CANH,CANL). This wiki section is all about PIC18F4580 Development Board-Mini’s CAN transceiver interfacing. Interfacing the CAN module requires connecting the jumpers J6 and J7(CANTX,CANRX). And also make sure to remove jumpers J10,J2( if used as LED pins or for other purpose).
Schematic
Sample code (click here to download) for both transmitter and receiver end are programmed in same way. Only difference is that, the J1939 Address of the destination end should be given at source code and vice versa. Once the code is loaded, there is an LCD display to identify transmitter and receiver end. Upon pressing the switch SW1, communication takes place between transmitter end and receiver end with buzzer indication.
Care must be taken for the following steps to interface CAN :
In MPLAB, while creating the project Select Microchip C18 Toolsuite as shown below. When selecting Active Toolsuite, select location for the corresponding Toolsuite contents as shown below
- MPASM Assembler
- MPLINK Object Linker v5.00
- MPLAB C18 C Compiler v3.47
- MPLIB Librarian
Then click ‘Next’ and carryout the further steps.
Topics related to PIC18F4580 Mini Development Board
- PIC18F4580 Mini Development Board – Overview
- PIC18F4580 Mini Development Board – Interfacing LED
- PIC18F4580 Mini Development Board – Interfacing LCD
- PIC18F4580 Mini Development Board – Serial communication(USART)
- PIC18F4580 Mini Development Board – Interfacing Switch
- PIC18F4580 Mini Development Board – Interfacing Buzzer
- PIC 18F4580 Mini Development Board – Interfacing POT(ADC)
- PIC18F4580 Mini Development Board – Interfacing Temperature sensor
- PIC18F4580 Mini Development Board – Interfacing Servo Motor
- PIC18F4580 Mini Development Board – Interfacing μRFID
- PIC18F4580 Mini Development Board – Interfacing CAN
Resources
- Datasheets
How to buy?
- Click here to buy rhydoLABZ PIC 16F877A Mini Development Board
- Click here to buy rhydoLABZ PIC 18F4520 Mini Development Board
- Click here to buy rhydoLABZ PIC 18F4550 Mini Development Board
- Click here to buy rhydoLABZ PIC 18F4580 Mini Development Board
Support
Please share your ideas with us, visit our forum for discussion
Leave a Reply
You must be logged in to post a comment.