Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interface two pic18f26k80 using can

Status
Not open for further replies.

shvi

Junior Member level 3
Joined
Jun 14, 2010
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
rajkot
Activity points
1,474
I HAVE TO INTERFACE 2 PIC18F26K80 USING CAN.
SOFTWARE USING IS MPLAB 8.85
COMPILER IS HITECH PICC

FOR HARDWARE I ATTACH IMAGE:

https://obrazki.elektroda.pl/73_1340859388.jpg

In that from one pic i transmit data, but i do not receive any data on second mcu.
In code i configure CAN and also for transmission, when transmission is completed, TXREQ bit cleared.
but in second pic RXFUL bit is not set.

need your help.
 

Hello,

communication using a CAN bus is not so simple. For example has every CAN message an address! It is a long time ago, that I have used CAN, so at this moment I can only give a small note. In CAN applications you have many participants - many slaves and a master. Every participant have to be configured, which messages should be received. There should be a address mask. Only if the send message has the right address which will be accepted, than the message will be received.

I think it is really necessary to get a feeling for what a CAN is and how it works.

Greetings
 

Hello,

communication using a CAN bus is not so simple. For example has every CAN message an address! It is a long time ago, that I have used CAN, so at this moment I can only give a small note. In CAN applications you have many participants - many slaves and a master. Every participant have to be configured, which messages should be received. There should be a address mask. Only if the send message has the right address which will be accepted, than the message will be received.

I think it is really necessary to get a feeling for what a CAN is and how it works.

Greetings

If every CAN message has an address then how to find that address ?
 

Ok, address is not the right, let us call it "message id". Every data frame (a message) over the CAN bus starts with this message id! The message id is needed for the arbitration on the bus. This is one of the main features of CAN. Than the receiver need the right settings in the filter/ acceptance register and so on. Look at the figure at page 392 to get an idea for the background of the CAN module.

Do you use high level programming for your application or do you program with assembler? Have you take a look at the application notes of the microchip website? There are many examples too. To work with CAN is not easy. There are so many things to know.
 

Ok, address is not the right, let us call it "message id". Every data frame (a message) over the CAN bus starts with this message id! The message id is needed for the arbitration on the bus. This is one of the main features of CAN. Than the receiver need the right settings in the filter/ acceptance register and so on. Look at the figure at page 392 to get an idea for the background of the CAN module.

Do you use high level programming for your application or do you program with assembler? Have you take a look at the application notes of the microchip website? There are many examples too. To work with CAN is not easy. There are so many things to know.

if you have any sample code for CAN in c then tell me.
i don't know why RXFUL bit in seconde mcu is not set.
if you know how CAN is working with pic then plz give complete flow.
 

Hey, in my opinion it's not the right way to get all from other! If you are looking for a person, who make your application, I'm not the right person. Sorry! CAN communication is a very complex theme! I have no problems to give you hints, but I haven't enough time to make all for you.

At first, there is huge content on the microchip homepage! Use the search function, look for appnotes and so on! On the other side for the basics of CAN - there is a really big internet. If you have special questions to the details, THAN you can ask the forum!

But, don't get me wrong!

----------------------------------------

I have look for app notes on microchip. This could be helpful.

AN713 - An introduction to the CAN protocol ...

https://ww1.microchip.com/downloads/en/AppNotes/00713a.pdf


AN738 - PIC18C CAN Routines in 'C'

https://ww1.microchip.com/downloads/en/AppNotes/00738b.pdf
https://ww1.microchip.com/downloads/en/AppNotes/00738.zip


AN878 - PIC18C ECAN 'C' Routines

https://ww1.microchip.com/downloads/en/AppNotes/00878a.pdf
https://ww1.microchip.com/downloads/en/AppNotes/an878.zip
 

i have attached my code. Take a look & tell me where i am wrong so, that i can solve the problem
 

Attachments

  • ECAN.rar
    3.1 KB · Views: 85
  • ECANh.rar
    1.5 KB · Views: 77

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top