FEZ Panda - CAN response not received CAN network

Greetings and thanks in advance.

I have set up my project, using CAN bus with 5 nodes, 2 x FEz Panda, 1x ChipKit and 1 x Arduino Uno. and i am using a PEAK CAN usb module to communicate to my PC. I know each node is set up correctly, and when a message is sent to a specific node, the correct reply is generated and received from that node, i have verified this using the PEAK can bus monitor.

The problem i am having is that i want to send out a general message, where i need all the nodes to respond, (a general ping to see how many nodes exist and asking the nodes for their unique address), i only receive responses from the ChipKit and the Uno, but not the Fez Panda’s.

I suspect that it could be something to do with clashing of messages, but i am not sure.

Here is the set up code for the Fez Can bus, (as per the Beginners Guide to .NET Micro Framework)

  int T1, T2, BRP;

        BRP = 6;
        T1 = 15;
        T2 = 8;
        // 500Kbps 

        // Use channel 1
        CAN can = new CAN(CAN.Channel.Channel_1, (uint)(((T2 - 1) << 20) | ((T1 - 1) << 16) | ((BRP - 1) << 0)));

        //can events
        can.DataReceivedEvent += new CANDataReceivedEventHandler(can_DataReceivedEvent);
        can.ErrorReceivedEvent += new CANErrorReceivedEventHandler(can_ErrorReceivedEvent);


Any ideas on what i could be doing wrong?

Thanks in advance.
AQ

No 2 bodes in CAN bus can transmit the same arb ID, by specifications.

Thanks, All the nodes have different ID’s.

the fez ID’s are

//board 1
static int BoardID = 0x05;
//board 2
static int BoardID = 0x03;

the other ID’s are
0x03
and 0x02
the PC being 0x00
and 0x01 reserved for a general call.

So when i do a general call the board checks the ID, if it is 0x01 then its a general call so i need it to reply with certain data.

I know it is all set up correctly, because if i physically disocnnect one Fez node, then i get 3 responses ( 1x FEz Panda, 1x ChipKit and 1 x Arduino Uno). similarly if i disconnect the other Fez node i get 3 replies aswell. The problem is that when both Fez nodes are connected, i dont get any replies from the Fez Panda’s, but i do get replies from the ChipKit and Arduino Uno.

By CAN standards, all nodes must ACK all messages. So what you are describing is impossible by the CAN rules. I am not sure why.

You cant use same CAN ID on two devices, id 0x03 is already used.

The lowest CAN id has the highest prio on the bus, you need to make sure the nodes doesn’t send the responce at the same time otherwise it could happen that the message is lost because of the CAN bus arbitration when having the same ID.

Apologies, the other ID’s are

0x04
and 0x02. So they are all different.

I believe my assumption that MSG’s getting lost was correct as added in a dummy delay (of a few micro seconds) on one of the FEZ boards


            for (int i = 0; i < 50; i++)
            { }

After this addition in the CAN data received event, all the nodes respond to the general command.