1

I am trying to set up a CAN-bus with its two nodes on the same Arduino. By Using an Arduino DUE without any transceivers. As my first experiment, I want to send a message from one CAN unit to the other. But so far I have not been successful to see any signal on the bus. (I am using an Oscilloscope)

Here is the detail of my effort:

I have used this(1) library, and I want to run the CAN_EchoTest example(2). As for the physical layer, I have created a circuit, according to a Method that is suggested here(3), here(4), and here(5). I set the transmission rate to 5Kbps, (lowest possible value provided by the library), to make sure that noise and propagation effects are minimal.

I implemented this mentioned Method to the Arduino board, using the Board's Schematics(6). In other words, I assumed that:

CANTX1 in the schematics, refers to PIN with the label '53' on the board.
CANRX1 in the schematics, refers to PIN with the label 'DAC0' on the board.
CANRX0 in the schematics, refers to PIN with the label 'CANRX' on the board.
CANTX0 in the schematics, refers to PIN with the label 'CANTX' on the board.

And I assumed the library that I am using configures the mutual PINS (DAC0 and 53), in a way that CAN controllers will be using them exclusively. I am not sure about the pair of diodes that I used: Vishay SS34A.

what is missing/wrong? Please be patient regarding any rookie mistakes. I can Provide further information if requested.

Thank you in advance

(1) github.com/collin80/due_can

(2) github.com/collin80/due_can/tree/master/examples/CAN_EchoTest

(3) www.mikrocontroller.net/attachment/28831/siemens_AP2921.pdf

(4) electronics.stackexchange.com/questions/30564/is-a-can-enabled-microcontroller-sufficient-to-drive-a-can-bus

(5) www.keil.com/download/files/canprimer_v2.pdf

(6) www.arduino.cc/en/uploads/Main/arduino-Due-schematic.pdf

6
  • You might wanna look at this question. electronics.stackexchange.com/questions/30564/…. And you should check weather an atmega328p-pu has support for it.
    – Handoko
    Commented Jun 26, 2015 at 20:18
  • Thank you man, That was supposed to be link number 4, I have made a mistake of copying the same link for number 4 and 5.
    – Makan
    Commented Jun 26, 2015 at 20:21
  • 1
    I see... I'm not that familiar with CAN so I won't be able to help you out a lot. I've only repaired and modified an existing CAN system with transceiver. Though, I've edited your question by making them actual links. It needs to be approved now.
    – Handoko
    Commented Jun 26, 2015 at 21:00
  • Ensure diode polarities are correct. Method should work ok. Using voltmeter measure RX pin voltage when no "traffic" - should be "high". Measure when sending - should drop. SS34 diodes are OK. Resistor can probably be say 10k but 3k3 should be OK. Commented Jun 27, 2015 at 9:02
  • SS34 datasheet here Ensure line side goes to TX pins. Use meter diode-test or Ohm test. Commented Jun 27, 2015 at 9:06

1 Answer 1

2

You will have to play some games to make it work. CAN is a bus with dominate and recessive states. This is how it arbitrates. When a unit starts sending a message and another starts concurrently they will both keep transmitting until one is sending a dominate signal and the other is recessive. At that point the unit placing the recessive signal on the bus backs off and waits until the bus is idle before re-trying.

You can simulate this with a few transistors (not real CAN but will work). Monitor the bus with the receive side and drive it with the transistor with a pull up resistor. When the transistor is on that is the dominate state when the transistor is off that is the recessive state. This automatically places a priority order to each unit. Also you cannot operate with 1 CAN device, each message has to be acknowledged by another. It is imperative that you receive what you send. Transceivers are very cheep on eBay and they have the Maxim chip which is very good. Good Luck, Gil

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.