I have developed two identical PCB's which need to communicate with each other via CAN-protocol.
I was able to let them communicate with each other on a bitrate of 500kbits/s.
After this project I wanted to continue my adventure with CAN. So at home I have a tractor (Fendt 415) which is equipped with a CAN-bus.
the following picture shows the joystick, which is placed in the cabin, with buttons on it. these buttons are read into a controller and are sended on to the CAN-bus.
I want to intercept those messages, so I'm able to power other electric things (electric seeder machine) when pushing the buttons onto the joystick.
I didn't only developed a two PCB's with AVR microcontrollers, but also a carrierboard for a AM335x System On Module.
So first of all I connected my AM335x to the tractor, setted the correct bitrate = 100 kbits/s.
commands: ip link set can0 up type can bitrate 100000 ifconfig can0 up candump can0
So after searching for a while, I found the CAN ID and data for the buttons.
Data button 1 ==> 15 33 1E CA 80 00 00 00
Data button 2 ==> 15 34 1E CA 80 00 00 00
Data button 3 ==> 15 35 1E CA 80 00 00 00
Data button 4 ==> 15 36 1E CA 80 00 00 00
So this was allready a major step in my project.
Now I don't want to use the AM335x into the tractor, this due to financial reasons.
I would like to use the microcontroller PCB's which I have developed before.
This board exists out of an ATMega644P, MCP2515 and MCP2561.
The following step in my project was to bench test the can-bus. So I connected my two PCB's to each other and setted the bittiming to 100kbits/s (for this I used the following calculator https://www.kvaser.com/support/c...), created one sending node and one receiving node.
CNF1 = 0x03
CNF2 = 0xb6
CNF3 = 0x04
When the Sending node sends the following data:
15 33 1E CA 80 00 00 00
And the receiving node receives it, the receiving node will set output PB1 high.
When the sending node sends the following data:
15 34 1E CA 80 00 00 00
And the receiving node receives it, the receiving node will set output PB1 low.
All of this worked, until I connected the receiving node to the tractor. The receiving node doesn't detect any message (debugged it with atmel ice).
Due to this I thought that the problem was the bittiming. So because of this I tested all the CNF settings which are in the link I posted above.
No setting of the bittiming made me able to read data into the microcontroller.
Does anybody know what the problem can be? Is it the bittiming? if so how can I solve this?
(The code is very long, this is why I don't post it. Also I'm sure the code isn't the problem, because it works correctly when bench testing)