avr_can icon indicating copy to clipboard operation
avr_can copied to clipboard

no can communication with 2 ATmega64M1

Open jblazeg opened this issue 6 years ago • 4 comments

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?

jblazeg avatar Feb 17 '19 21:02 jblazeg

Oh, also make sure the STBY pin on the transceiver is set correctly. Else nothing will go in/out….

Just some ideas…

thomasonw avatar Feb 19 '19 01:02 thomasonw

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-

thomasonw avatar Feb 19 '19 01:02 thomasonw

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.

jblazeg avatar Feb 19 '19 19:02 jblazeg

Hey, glad you got it solved!

-al-

thomasonw avatar Feb 19 '19 22:02 thomasonw