CAN bus


Closed Thread
Results 1 to 5 of 5

Thread: CAN bus

  1. #1
    Desterline's Avatar
    Desterline Guest

    Default CAN bus

    Hey guys and gals,

    I'm looking at needing a multidrop network in a noisy enviroment and from what I read I think CAN (controller area network) would probably be a good fit.

    I've found a ton of information about it -to much realy- but I haven't found many example projects. And searching the archives here is complicated by the 4 character min search requirement.

    I was hoping for a "here's a schematic, heres some code" example that I could start working with.

    Thanks,
    -Denny

  2. #2
    Desterline's Avatar
    Desterline Guest


    Did you find this post helpful? Yes | No

    Default

    Hmmm... Several days, no responses... Let's broaden the question.

    Has anyone done any work with PBP and CAN?

    Any feedback would be helpful.

    Thanks,
    -Denny

  3. #3
    shawn665's Avatar
    shawn665 Guest


    Did you find this post helpful? Yes | No

    Default

    I have used the MCP2515 can controller with the 16F877. I have a master LCD display head in a prototype aircraft that is fed signals from about four different PIC based sensor units throughout the aircraft. I used assembly interrupts to handle message reception for the most imortant messages, and poll for the rest. The assembly routine puts the data from the most important messages into a memory bank directly, and the polled data is placed into a buffer.

    Being assembly, it's not the easiest to follow, but it certainly works well enough. Still interested?

  4. #4
    Desterline's Avatar
    Desterline Guest


    Did you find this post helpful? Yes | No

    Default

    Hmm.... Starting to get pretty far from my hardware (18f248 w/internal can controller) so I'm not sure the code would be directly useful to me (besides, my assembly isn't exactly the best :-) But maybe a couple questions?

    If I understand the CAN concept correctly, I put the data to be sent in the transmit buffers, set a couple flags (priority, message length) and the transfer is actualy a background proccess - no more cpu cycles. The recieving end is similar, reception actualy takes no cpu time, the data is placed into the recieve buffers (depending on the reception filters) then a buffer full interrupt is set.

    Is that about right?

    I'm sure I'll have more questions as I get into this, but it's a low priority at the moment.

    Thanks,
    -Denny

  5. #5
    shawn665's Avatar
    shawn665 Guest


    Did you find this post helpful? Yes | No

    Thumbs up

    You've got it! Just set the right bits, and the message goes out.

    I think the MCP 2515 is pretty much the same as what's in your PIC, only there is no SPI interface to deal with. I haven't written any code for the 18 series yet, though.


    Shawn

Similar Threads

  1. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 14:35
  2. Communicating between two PICs over DC bus
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th May 2009, 13:57
  3. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 01:22
  4. Compass module and I2C bus
    By vladimir059@hot in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th December 2006, 21:29
  5. PBP External Memory Bus Support
    By ALFRED in forum mel PIC BASIC
    Replies: 4
    Last Post: - 25th December 2006, 09:42

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts