+ Reply to Thread
Results 1 to 5 of 5

Thread: CAN protocol for pic18f2680

  1. #1
    Wilko Newbie
    Join Date
    Nov 2007
    Posts
    11

    Default CAN protocol for pic18f2680

    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


  2. #2
    jonK Newbie
    Join Date
    Sep 2008
    Posts
    5

    Default

    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.

  3. #3
    qratman Okay
    Join Date
    Oct 2005
    Location
    Estonia
    Posts
    34

    Default

    Hi,

    PIC18F2680 has already ECAN module bulilt in. So no need for external transceiver.

    As for examples, look at microchip website, like previous poster said.
    Some appnotes there: http://www.microchip.com/wwwproducts...cName=en010285
    "The only thing worse than getting an error message is not getting an error message." - Allen Downey

  4. #4
    atferrari Good atferrari Good atferrari Good
    Join Date
    Oct 2003
    Location
    Buenos Aires - Argentina
    Posts
    573

    Default

    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 by atferrari; 21st September 2008 at 06:20 PM.
    Agustín Tomás
    In theory, there is no difference between theory and practice. In practice, however, there is.

  5. #5
    udayakumar Newbie
    Join Date
    Sep 2008
    Posts
    1

    Talking CAN Book

    Quote Originally Posted by Wilko View Post
    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

+ Reply to Thread

Similar Threads

  1. (Up/Down) Protocol?
    By BaCaRdi in forum General Electronics Chat
    Replies: 2
    Latest: 20th June 2008, 07:24 AM
  2. USB Protocol
    By Iceman_Chris in forum General Electronics Chat
    Replies: 1
    Latest: 27th November 2005, 09:05 AM
  3. DMX protocol
    By computer in forum General Electronics Chat
    Replies: 3
    Latest: 5th November 2004, 07:35 PM
  4. Protocol X10
    By BlackBlade in forum Electronic Projects Design/Ideas/Reviews
    Replies: 0
    Latest: 16th June 2004, 03:09 PM
  5. I2c bus & protocol & PIC mic
    By tom_electronic in forum Micro Controllers
    Replies: 2
    Latest: 30th April 2004, 09:39 AM

Tags for this Thread