Go Down

Topic: Building a CAN API for Arduino DUE (Read 138 times) previous topic - next topic

LROBBINS

Dear Palliser,

I am extremely, extremely enthusiastic about your building a CAN-bus interface.  I do have two suggestions that you might want to keep in mind while you are doing this:

(1) The most common use of CAN by Arduino-community members has been for reading on-board automotive systems, so the header files for libraries I've seen define those messages.  OBDC is only one use for CAN, and to my mind the least interesting use for those who want to do something new.  I think that it would be very useful for many, and certainly for me, if your interface provided a "friendly" implementation of CANopen.  (My particular interest in this is that recent Roboteq motor controllers are CAN capable and aside from raw CAN and a mini CAN subset, they implement CANopen (though only with 11 bit ids).

(2) The Due has two CAN controllers in its processor, but it still needs external transceivers.  The ATmega Arduinos need both external controllers and transceivers, but aside from the need to use SPI the CAN protocol is the same.  Perhaps your interface could be written so that it would work for both.  For example, I've just started working on a simple Arduino NANO CAN shield that mounts only a MCP 2515 and 2551 to use in several embedded CAN nodes.  Your interface will surely be much, much better than anything I will come up by hardcoding the frames I need into a modified version of an existing library.

Grazie,
Lenni

Palliser

Hello Lenni. Thank you very much for your encouraging words concerning this initiative to complete the newly created avenue to make Arduino Due to get seriously involved with the CAN standard.

In reference to your first suggestion, as too many of us know, CANopen is a higher level CAN bus protocol. Even thou both use the CAN 2.0B standard for the physical and data link layer, that's it. They differ from the other five layers in the OSI model. I am completely agree with you about implementing CANopen but we are in the incipient phase in building this interface, so, one step at a time. I believe the help from people like you will be needed very soon. I have planned to take advantage of what is inside the ATSAM3X8E, two can controllers that provide all the features required to implement the serial communication protocol CAN as referred by ISO/11898A that includes 1.0 Part A and 2.0 Part B.

In reference to your second suggestion, yes, it will be necessary a couple of transceiver like SN65HVD234 to provide the required transmission capabilities between the differential CAN bus and the CAN controller. I am taking notes of your comments and other comments from this community to keep in mind. Thank you again.

Markus_L811


Hello Lenni. Thank you very much for your encouraging words concerning this initiative to complete the newly created avenue to make Arduino Due to get seriously involved with the CAN standard.

In reference to your first suggestion, as too many of us know, CANopen is a higher level CAN bus protocol. Even thou both use the CAN 2.0B standard for the physical and data link layer, that's it. They differ from the other five layers in the OSI model. I am completely agree with you about implementing CANopen but we are in the incipient phase in building this interface, so, one step at a time. I believe the help from people like you will be needed very soon. I have planned to take advantage of what is inside the ATSAM3X8E, two can controllers that provide all the features required to implement the serial communication protocol CAN as referred by ISO/11898A that includes 1.0 Part A and 2.0 Part B.

In reference to your second suggestion, yes, it will be necessary a couple of transceiver like SN65HVD234 to provide the required transmission capabilities between the differential CAN bus and the CAN controller. I am taking notes of your comments and other comments from this community to keep in mind. Thank you again.


I have interrests to, I would prefer the SN65HVD235 with the possibility off using the Autobaudfunktion without making trouble on the bus. The firm I worked for parttime has many CAN-Bus equipment so I can test.

Implementation of LIN and CAN Arduino Style for the Due is on my ToDo list to get "warm" with the Due.

Palliser

Hello Markus,

I feel happier today because more people want to get involve with me in this journey. I just mentioned the SN65HVD234 as a known option, but agree with you about the autobaud loop-back and standby mode capabilities of the 235. I have also worked with SN55HVD251 and SN65HVD251, but at the end, its about a community-consensus with the permission of Arduino. So, I encourage you to move to the top of your ToDo list to find the best CAN transceiver option for the transmission between the Arduino Due processor (ATSAM3X8E) and the outer CAN world. Please, keep us posted about your tests and progress. Thank you.

cyclegadget


I hope this will be helpful, it is a thread at LeafLabs about getting CAN to work with STM chips.

http://forums.leaflabs.com/topic.php?id=802

Go Up