Go Down

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

ofir060

Are you using transceivers  or diodes ?  Are you using the programming port or the native USB port ?
What is exactly your wiring ?


I am connected to the due via the programming micro USB,
The wiring I've stated above are direct.. just cables. (CANTX0 to CANRX1 , CANTX1 to CANRX0)

ard_newbie

#586
Sep 28, 2017, 03:32 pm Last Edit: Sep 28, 2017, 03:58 pm by ard_newbie
For a correct wiring, use CAN Transceivers and two 120 Ohms resistors at each end of the bus or, as an alternative solution, diodes and a 2K2 resistor connected to 3.3V as explained in this Application Note from Siemens:
https://www.mikrocontroller.net/attachment/28831/siemens_AP2921.pdf

Diodes are a perfect choice for testing, as long as your bus is no longer than a few meters (I tested with a 1.5 meter but others have been successful with this solution up to 4 meters) although this solution may not be sufficient in case there are lots of EMI.

Use a signal diode similar to 1N914 or 1N4148 and a 2K2 (or higher) resistor connected to 3.3 V ( Not 5V as mentionned in AN AP2921). The current should not go above 1.6 ma.

Since you are using the programming port, don't forget to comment line 22 in your sketch:

#define Serial SerialUSB

ofir060

#587
Sep 28, 2017, 04:35 pm Last Edit: Sep 28, 2017, 05:21 pm by ofir060
For a correct wiring, use CAN Transceivers and two 120 Ohms resistors at each end of the bus or, as an alternative solution, diodes and a 2K2 resistor connected to 3.3V as explained in this Application Note from Siemens:
https://www.mikrocontroller.net/attachment/28831/siemens_AP2921.pdf

Diodes are a perfect choice for testing, as long as your bus is no longer than a few meters (I tested with a 1.5 meter but others have been successful with this solution up to 4 meters) although this solution may not be sufficient in case there are lots of EMI.

Use a signal diode similar to 1N914 or 1N4148 and a 2K2 (or higher) resistor connected to 3.3 V ( Not 5V as mentionned in AN AP2921). The current should not go above 1.6 ma.

Since you are using the programming port, don't forget to comment line 22 in your sketch:

#define Serial SerialUSB

Why do I need to use a transceiver and diodes if I only want to test read/write capabilities of the library?
I don't want to create my own can bus high/low, just check the tx/rx for software.
The signals will be the same because the conversion the transceiver does will yield the same results to the tx/rx pins (am i right?)

tom32500

Hello
I come to you because I buy a due and I try to make the can work. I do not get there

I realize two shields with SN65HVD234 and I connect them water and nothing happens and I even try to set to plug can1 and can2 directly I got inconsistent values

jrickard


amin_mdn

#590
Oct 24, 2017, 05:35 pm Last Edit: Oct 26, 2017, 09:33 pm by amin_mdn
Hello!
I tested a pair of program that transmit and receive the digital data of a photocell or in the other word send a byte through the CAN to the receiver part. It's by SN65HVD230Q transceiver but my program is failed. I guess the transmission part is valid and the receive part is wrong. I tested the Tx pin of transmission part in the oscilloscope and saw the pulses with about 500ns width. I can't get any answer in receiver part at all :( . I had used MCP2551 for many times, has my CAN controller been failed because of this? :(((

tbit

Dan - www.togglebit.net - Arduino DUE proto shields - Arduino DUE CAN shields

alexogeo03

Hi!
I want to Express my gratitude to the author of the theme. I was able to do the CAN gateway on the Arduino Due. The time of forwarding messages is very small. After the initial offset of 15-25 milliseconds, then the displacements are almost there (less than 1 millisecond). It fully complies with the requirements for test tool safety CAN interfaces in complex systems. Besides, I understand how you can still identify the hardware and software bookmarks, of which I warned on its website (in Russian) www.external.pro.

Alex

amin_mdn

Hello!
I need to learn about "filter( , , , )" command. Can you explain s'th or upload a pdf about that?

tbit

amin_mdn - this is a masking filter for ID's that will be "seen" and received by the CAN controller hardware...see page 1189 of the SAM3X / SAM3A Series datasheet, the masking is not simply explained. You can work out in either collin's due_can.cpp and/or CAN_Acquisition.cpp and work out how the masking is set. I have had inquires about opening the filters completely which is possible however you may run into overflow or overrun situations in doing so.
Dan - www.togglebit.net - Arduino DUE proto shields - Arduino DUE CAN shields

amin_mdn


Go Up