avr_can
avr_can copied to clipboard
no can communication with 2 ATmega64M1
I setup 2 CAN64 IO (Atmega64M1) boards using Arduino IDE 1.8.1. Both interconnected with CAN High and Can Low (120Ohm bus terminator active on both sides). One is configured with "CAN_SendingTest" and the other one with "CAN_TrafficSnooper". Both compiled with 16Mhz and PSC OFF.
I can see no data coming in on the receiver side and a "FAILED" on transmit side after the 8th message.
Any idea what could be wrong?
Oh, also make sure the STBY pin on the transceiver is set correctly. Else nothing will go in/out….
Just some ideas…
Hello. Sorry you are having troubles. Do you have an O’Scope? Can you see if indeed a board is trying to send out messages and/or if the responder is showing traffic on the lines?
fail after 8 is reasonable, as the local Tx queue would have filled. Means that the messages are not getting out for some reason. Could be that they receiving station is not ANKing them… Hence, the O’Scope might help.
-al-
I tried a logic analyzer. Everything quiet. After reading the datasheet of the TJA1040, I measured the STBY pin - set to high. So the transceiver was in standby mode.
Some port manipulation - tadaaaaaaa. It works.
So for everyone with a "CAN64 IO Board canbus Atmega64m1" from Gerald Just use these two lines when you plan to use Can Bus:
DDRD = (1<<PD6); // enable output
PORTD = (0<<PD6); // set to HIGH
Thanks Thomas, for your time.
Hey, glad you got it solved!
-al-