Sending messages to Arduino
Sending messages to Arduino
Hello All,
I have an Arduino Uno and CAN shield (equipped with a MCP2515 chip) that I am using to listen to messages sent over a CAN network via PEAK PCAN interface. Messages are sent at 50 kbytes/s and ids range form 0x0-0x7ff. Messages are confirmed received by printing them over Arduino's serial interface.
I confirmed that CAN messages transmitted via Arduino /CAN shield are received via Arduino, but am unable to receive messages when transmitting only through PCAN. Therefore the issue appears to originate either from the PCAN-View software or the PCAN USB-to-CAN controller itself.
Where may lie the issue or how should I troubleshoot? Side note I did not bridge the 120 ohm resistor, however I didn't do this for the CAN shield and it still works fine. Thanks!
I have an Arduino Uno and CAN shield (equipped with a MCP2515 chip) that I am using to listen to messages sent over a CAN network via PEAK PCAN interface. Messages are sent at 50 kbytes/s and ids range form 0x0-0x7ff. Messages are confirmed received by printing them over Arduino's serial interface.
I confirmed that CAN messages transmitted via Arduino /CAN shield are received via Arduino, but am unable to receive messages when transmitting only through PCAN. Therefore the issue appears to originate either from the PCAN-View software or the PCAN USB-to-CAN controller itself.
Where may lie the issue or how should I troubleshoot? Side note I did not bridge the 120 ohm resistor, however I didn't do this for the CAN shield and it still works fine. Thanks!
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Sending messages to Arduino
If we understand your request correct, you could communicate between 2 Arduino, but not with one Arduino and PCAN-USB connected at a Windows PC.
Why not add the PCAN-USB for test as a third CAN node in the Arduino CAN Network and run PCAN-View with the exact Timing (50K ist not 50K - check sample point!) and also - A CAN BUS need to be terminated at each end of the CAN Bus with 120 Ohm this is a must !
Why not add the PCAN-USB for test as a third CAN node in the Arduino CAN Network and run PCAN-View with the exact Timing (50K ist not 50K - check sample point!) and also - A CAN BUS need to be terminated at each end of the CAN Bus with 120 Ohm this is a must !
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Sending messages to Arduino
Sorry for the late reply. I have now terminated both H and L lines (although my labmate had told me he was able to transmit messages reliably without it).
Regarding the suggestion to connect all 3 nodes in parallel along the H and L lines, I am unsure of what outcome was expected? Why suggest this over the previous configuration?
Also thanks for the noticing the difference in 50 kBits in PCAN-View and Arduino code!
Regarding the suggestion to connect all 3 nodes in parallel along the H and L lines, I am unsure of what outcome was expected? Why suggest this over the previous configuration?
Also thanks for the noticing the difference in 50 kBits in PCAN-View and Arduino code!
Re: Sending messages to Arduino
One other note I am confused on is the BUS-HEAVY status. Can I still send messages with this status? What effects should I observe with this status?
According to this forum topic (https://www.peak-system.com/forum/viewt ... f=120&t=39), BUS-HEAVY indicates >127 error points. The explanation seems to imply that sending more messages results in a higher probability for BUS-HEAVY error, however I receive this status after sending only 1 message in "manual" mode.
According to this forum topic (https://www.peak-system.com/forum/viewt ... f=120&t=39), BUS-HEAVY indicates >127 error points. The explanation seems to imply that sending more messages results in a higher probability for BUS-HEAVY error, however I receive this status after sending only 1 message in "manual" mode.
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Sending messages to Arduino
1. Termination is in CAN a must - if you think you do not need it OK - it is up to you .
2. a third unit could solve the problem if one of your own build application does not set the CAN Core into ACK mode..but it was only a proposual - if you think you do it right - it is up to you.
3. BUSHeavy is a reaching a Error Level of the CAN Core - see point 1 and 2 - both could be the Problem.
If a CAN node send ONE message and have no ACK (see point 2) it will resend the frame - so sending one Message to CAN Core could end up in sending hundreds on CAN Bus - please study CAN Doku try to understand the protocol.
2. a third unit could solve the problem if one of your own build application does not set the CAN Core into ACK mode..but it was only a proposual - if you think you do it right - it is up to you.
3. BUSHeavy is a reaching a Error Level of the CAN Core - see point 1 and 2 - both could be the Problem.
If a CAN node send ONE message and have no ACK (see point 2) it will resend the frame - so sending one Message to CAN Core could end up in sending hundreds on CAN Bus - please study CAN Doku try to understand the protocol.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Sending messages to Arduino
Thanks for the help.
So I believe I have a good receiver (the Arduino is able to sniff messages from a CAN bus line successfully) however I am still unable to successfully transmit messages from PCAN. The device continues to read BUS-HEAVY. I am confident that my connections are good. Unless there is something wrong with the message I send (and I am reading ALL messages with my Arduino receiver) then I am not sure where I am going wrong.
So I believe I have a good receiver (the Arduino is able to sniff messages from a CAN bus line successfully) however I am still unable to successfully transmit messages from PCAN. The device continues to read BUS-HEAVY. I am confident that my connections are good. Unless there is something wrong with the message I send (and I am reading ALL messages with my Arduino receiver) then I am not sure where I am going wrong.
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Sending messages to Arduino
As we wrote...check physical connection and Bitrate. Also check CAN Transceiver Voltage to be sure all CAN Transceivers are OK. A Guide how to do could be found in the Forum.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Sending messages to Arduino
I must say, I have tried and confirmed at least twice everything you have mentioned but still to no avail. I know that previous colleagues of mine have got it working; perhaps I am making a silly mistake or have a setting that has failed? I have also read the user manual and confirmed everything in working order.
~Seth
~Seth
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Sending messages to Arduino
Have you check your Transceiver Voltages
https://www.peak-system.com/forum/viewt ... er+Voltage
https://www.peak-system.com/forum/viewt ... er+Voltage
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
-
- Posts: 1
- Joined: Thu 3. Dec 2020, 05:01
Re: Sending messages to Arduino
Hi you must use right library support peak can in arduino.
this link is https://github.com/coryjfowler/MCP_CAN_lib.

this link is https://github.com/coryjfowler/MCP_CAN_lib.

