Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

CAN protocol for pic18f2680

Status
Not open for further replies.

Wilko

New Member
I'm currently trying to figure out how to setup CAN in C using MPLAB and the student C18 compiler. I would greatly appreciate some help..well..lots of help I guess.

After reading about the protocol I'm still baffled about what to do with filters and masks for receiving data. I'm trying to learn about the protocol by cracking how to write a software code which uses it. I'm not bothered with specifics about what's sent or received or even specific bus speeds but I do need to use the loop-back mode. I'm using the PIC18f2680 with the MCP2551 chip.

I've found a program called Maestro which can generate code for you once you give it the requirements but I would prefer to use a library that didn't generate code for me but instead explained what each function did so I could correctly incorporate them between the rest of my software.

I've been using a book to learn about CAN but it uses the mikroC CAN functions. Is there something similar yet doesn't use Maestro? I thought the AN930 was the solution but once again it requires Maestro.

Is Maestro the best option for me?
What could I set the frames and masks to be in configuration?
How would I use frames/masks for receiving data?

Thank you for your time,

Wilko
 
I would recommend using some PIC with CAN on-chip (ie. 18F248), this will help with some problems in communication with SPI controller.

There is a lot of examples on Microchip website. I would recommend reading CAN specification from Bosch and datasheet, mask and ID reception registers are explained in both documents.
 
The transceiver IS needed. Always.

Please do not confuse the CAN engine with the transceiver.

This last is basically in charge of generating the signals with levels appropriate to the (CAN) bus.

In my case I used a Microchip micro 18F4585 and a Texas Instruments transceiver 65HV0251.

Worked in Assembler.
 
Last edited:
CAN Book

I'm currently trying to figure out how to setup CAN in C using MPLAB and the student C18 compiler. I would greatly appreciate some help..well..lots of help I guess.

After reading about the protocol I'm still baffled about what to do with filters and masks for receiving data. I'm trying to learn about the protocol by cracking how to write a software code which uses it. I'm not bothered with specifics about what's sent or received or even specific bus speeds but I do need to use the loop-back mode. I'm using the PIC18f2680 with the MCP2551 chip.

I've found a program called Maestro which can generate code for you once you give it the requirements but I would prefer to use a library that didn't generate code for me but instead explained what each function did so I could correctly incorporate them between the rest of my software.

I've been using a book to learn about CAN but it uses the mikroC CAN functions. Is there something similar yet doesn't use Maestro? I thought the AN930 was the solution but once again it requires Maestro.

Is Maestro the best option for me?
What could I set the frames and masks to be in configuration?
How would I use frames/masks for receiving data?

Thank you for your time,

Wilko

Hi all I'm a newbie to this forum and also to CAN I need your help to have a thorough knowledge on CAN.Can any one post me a good book for a novice CAN.
Thanks in Advance,
Uday
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top