CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Thread: CANbus

  1. #1
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    CANbus

    Anybody have any experience or resources they want to share regarding the CANbus. Have a potential job with GM and will have to deal with this. Thanks in advance
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  2. #2
    Join Date
    Mar 2001
    Posts
    2,529

    Re: CANbus

    Last edited by ahoodin; October 30th, 2006 at 07:54 AM.
    ahoodin
    To keep the plot moving, that's why.

  3. #3
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: CANbus

    Thanks Ahoodin. I am looking at some third party suppliers like Vector and IMC. I was hoping to get some posts more directly related to peoples actual experience.
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  4. #4
    Join Date
    Mar 2001
    Posts
    2,529

    Re: CANbus

    or resources they want to share regarding the CANbus
    Sorry then, just re to the second half of your question.
    ahoodin
    To keep the plot moving, that's why.

  5. #5
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673

    Re: CANbus

    My last job used to deal with CAN bus but theirs is a proprietary technology.

    Here are some of the points about CAN bus

    --It is a multidrop serial connection, meaning several devices can be connected to the same bus. Before the existant fieldbus , there are alot of wiring to be done to connect 2 points(usually the system you design have more than 2 points definitely). The wiring is a mess!! Fieldbus solves this problem.

    --When several devices is connected to the same bus, no 2 or more devices can 'talk' at the same time.

    --Care must be taken that no device hogs the bus by sending a lot of messages, and starve other devices which are assigned lower priority and may have important messages to send at the same time.

    --A malfunctioned device can take the whole bus down.

    --The system should be able to detect the dead device coming alive.

    --The reason for a differential line is to cancel out the effect of the noise in the system. The cable is usually shielded to prevent electrial noise from affecting the signals.

    Code:
    Signal in the differential line
       __    __
    __|  |__|  |__
    
    __    __    __
      |__|  |__|
      
    
    A spike in the differential line
       /\    __
    __|  |__|  |__
    
    __    __    __
      |/\|  |__|
    --CAN is used in ABS in cars and also used in military tanks.


    NOTE: Use the above information at your own risk!! No warranty expressed or implied!!

  6. #6
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: CANbus

    Thanks Cbasic. Is my understanding correct that the CAN bus is a token ring?
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  7. #7
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673

    Re: CANbus

    Hi Souldog,

    In my last job, I did not write the firmware. My experience with CAN bus is quite limited.

    I do not know what is a token ring. CAN bus cable is terminated with a terminator(similar to the concept of SCSI terminator) so I think it is not a token ring.

    To design a CAN bus, you will need a microcontroller (some PIC microcontroller model) which supports CAN.

  8. #8
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673

    Re: CANbus

    I just checked up the token ring on wkikpedia.

    CAN bus is not a token ring. Because in a token ring network, all computers can send to the next computer at the same time, whereas CAN shares the same bus so only 1 device can talk. Before the device can talk, it must ask permission from the host, then the host will give permission. All these are done by sending messages.

    All devices will receive all the messages being sent.

    All devices on CAN have a receive address and a send address, so the device just responds to message for its receive address and ignore other messages of other addresses. Send address is to let the host know which device send this message. Each device can have more than 1 receive address.

    Code:
    Token ring
    
    --PC--PC--PC--(joins to next PC)
    
    CAN
    
         Dev  Dev  Dev
          |    |    |
    Host--------------Terminator

  9. #9
    Join Date
    Sep 2002
    Location
    Singapore
    Posts
    673

    Re: CANbus

    One minor but important thing you have to know: CAN was created by Bosch. If you do not know this fact, your interviewer may view your CAN knowledge as doubt because you know CAN reasonably well, but you did not know what its origin is.

    "CAN was first established for automobile by Bosch GmbH in mid 1986. It was developed based on the request from Mercedes and BMW when they face difficulty in connecting or sharing data among ECUs (Electronic Control Units). The engineer found it was difficult to connect the ECUs with conventional UART (Universal Asynchronous Receiver/Transmitter) since the UART is only suitable for point-to-point communication, multiple nodes are not allowed in this communication system."

    http://www.cans.com.my/modules.php?n...categories=CAN

  10. #10
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    Re: CANbus

    Quote Originally Posted by souldog
    Thanks Ahoodin. I am looking at some third party suppliers like Vector and IMC. I was hoping to get some posts more directly related to peoples actual experience.
    The few times I've come into contact with projects (Automotive Testing) that required accessing the CANbus (a whole 2 times in the last 7 years) we've used Labview which has a CAN toolbox but then we were using Labview to run the entire test so it kind of fit in. Chances are you won't be working with Labview.
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  11. #11
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: CANbus

    Thanks CBasic and Tom. I always find it useful to toss out some totally ignorant questions and see where it gets me. The main service I provide is servo hydraulic control, the programming is secondary. The labview info is very very good. This means I could hand the project off to someone else. As a side note I use NI stuff stuff extensively and have had nothing but problems with it.
    I don't use labview, I am talking about hardware. Where do you work tom? I am expanding into the automotive testing arena at the speed of light.
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  12. #12
    Join Date
    Feb 2002
    Posts
    3,788

    Re: CANbus

    at my previous job i used to work a lot with CAN. Vector is a company that deals almost exclusively with CAN. they sell hardware with API, tools, maybe it's of use to you. they were really helpful for me. for example they sell a hardware called CANCardX that is able to connect (using the CANBus) a calibration tool to one or more ECU's. This card comes with an API you could use to build your custom programs to monitor the message exchange on the bus.

    EDIT: just to be clear: i'm not advertising Vector here, i only mentioned them as a reference.
    Last edited by Alin; November 2nd, 2006 at 03:25 PM.

  13. #13
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    869

    Re: CANbus

    Quote Originally Posted by souldog
    Where do you work tom? I am expanding into the automotive testing arena at the speed of light.
    I tried to answer this by e-mail. Don't know if you received it.
    Verere testudinem! (Fear the turtle)

    Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy. -Albert Einstein

    Robots are trying to steal my luggage.

  14. #14
    Join Date
    Sep 2002
    Location
    Maryland - Fear The Turtle!
    Posts
    7,537

    Re: CANbus

    CBasicNet
    Because in a token ring network, all computers can send to the next computer at the same time,

    Uh no, it's called a token ring because you have a token Which means you only send when you have it. Unless we are talking about 'can I have the token'


    whereas CAN shares the same bus so only 1 device can talk. Before the device can talk, it must ask permission from the host, then the host will give permission. All these are done by sending messages.
    Why gosh, almost sounds like a token ring Almost

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured