Can examples!


Closed Thread
Results 1 to 9 of 9

Thread: Can examples!

  1. #1
    Join Date
    Apr 2007
    Posts
    10

    Default Can examples!

    Hi,
    I have just started a project with a 18F6585 and a 6680.
    I now want to use CAN to communicate with our vehicles to control different funktion and to read out data as speed etc.
    Is ther any ready functions in PBP or something that will make the programming easier.
    I undersatand that CAN is a little hard to get going.
    Can anyone help me with some example code or anything.
    I just want to send and recive messages on a CAN network.
    /JKBPower

  2. #2
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jkbpower View Post
    Hi,
    I have just started a project with a 18F6585 and a 6680.
    I now want to use CAN to communicate with our vehicles to control different funktion and to read out data as speed etc.
    Is ther any ready functions in PBP or something that will make the programming easier.
    I undersatand that CAN is a little hard to get going.
    Can anyone help me with some example code or anything.
    I just want to send and recive messages on a CAN network.
    /JKBPower
    Good luck with that. I think you'd probably find that most manufactures use different protocols. In other words - if managed to master the ECU of say a Nissan 300ZX, this doesn't necessarily mean that you could dive straight in and work on say a 3000GT. Too diverse by any means. This being the main reason why a language like PBP wouldn't directly provide support for it.
    Last edited by T.Jackson; - 25th April 2007 at 08:39.

  3. #3
    Join Date
    Apr 2007
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Yes I know its difficult to manage the ECU but thats not what I want.

    We built security vehicles and use PLC systems today.
    I communicate with canbus to controll central lockings,windows etc.
    This is not hard to control but now I want to do this with my own PIC based controller.

  4. #4
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by jkbpower View Post
    Yes I know its difficult to manage the ECU but thats not what I want.

    We built security vehicles and use PLC systems today.
    I communicate with canbus to controll central lockings,windows etc.
    This is not hard to control but now I want to do this with my own PIC based controller.
    You're not interested in the ECU? Then how will you manage to read speed and other data as your first initial post stipulates.
    Everything in the CAN except the ECU is node. If you can't understand the ECU then how can you talk to the nodes? I'm puzzled.
    Last edited by T.Jackson; - 25th April 2007 at 10:44.

  5. #5
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Actually communicating with one vehicle is the same as the next, because they all use the OBDII protocol. The SAE have the OBDII standard for purchase. While some of the more advanced functions like reprogramming are manufacturer specific the diagnostic items like speed and RPM are the same on every vehicle and outlined in their document(s).

    I had the oppritunity to read through the OBDII standard while working on another project, needless to say its tedious to communicate on the buss. I ended up integrating an OBDII to serial IC into my design to simplify things, ELM electronics sells it (ELM327).

    The following will give you a taste of the protocol and how it works. This document is geared to VPW but the concepts remain the same.

    http://www.lightner.net/lightner/bruce/Lightner-183.pdf

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    That ELM327 chip rocks!
    I'm about to order a 2nd load of PCBs anydays now. Almost can't keep enough on hand.

  7. #7
    Join Date
    Aug 2005
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    You said anything.Attached are code files that appear to be PBP.I downloaded them from somewhere about 6 years,but never used them.I do know they were for use with a can bus interface chip MCP2510 controlled thru the MSSP port of a 16F877 using SPI.
    Attached Files Attached Files

  8. #8
    Join Date
    Apr 2007
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Thanks!
    Maybe I can use some of that code.
    The 18F6585 have an own ECAN modul so I think its a lot different than using the stand alone chip.
    But I´m going to look at this.
    Oboy!!! I have a lot to learn about CAN :-)
    /JKBPower

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    CAN is nice, but not as easy as USART, SPI, I2C or some part of USB.

    At least once you understand the concept, it's easy.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Examples for EasyPIC
    By savnik in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 13th July 2013, 14:56
  2. i2c non-eeprom examples?
    By justDIY in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 22nd January 2010, 18:07
  3. Definitive MPLAB Config Examples
    By Brian J Walsh in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd July 2008, 11:33
  4. PICPROTO 18 Prototyping Board Examples
    By rick hardy in forum General
    Replies: 9
    Last Post: - 21st April 2008, 05:19
  5. Code Examples
    By Archangel in forum Forum Requests
    Replies: 33
    Last Post: - 30th June 2007, 09:34

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