CAN messages lost after 16 received

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN messages lost after 16 received

Jump to solution
1,766 Views
dastek
Contributor III

Hi,

I am using 9s12XEQ384.

I have a CAN master which issues instructions to 24 slaves.  The CAN bus length is 400mm and there are 120 Ohm termination resistors on each end of the bus.  All slaves run the same firmware.  The individual card IDs are setup with a DIP switch.

They are connected at 500 KBaud.  The communication is fine.  The messages get through and return data is sent.  But .....

At power up the master sends a message which all slaves must respond to to detect what CAN IDs are connected.  All CAN messages are received under interrupt on both the master and slaves.

I can only get a maximum of 16 responses.  If I unplug some of the lower ID address cards, then the higher value IDs are present.  So I can confirm that all 24 are responding, but only a maximum of 16 cards.

My CAN acceptance registers  are set for Don't Care  (0xffff)  I am using standard length IDs.

I send my request to respond on CAN ID = 0x0A

I get many responses on CAN ID = 0x0B, but as I said only a maximum of 16 are received.

Am I missing something in the CAN standard?  Is this response possible?

Is there a bus overload and I need to assign each a delay before it sends each cards response?

 

Or am I doing something wrong?

 

Regards,

 

Wade Whitehorn

0 Kudos
Reply
1 Solution
1,722 Views
dastek
Contributor III

Hi Edward,

This is how I define RXF  :  #define RXF (unsigned char) 0x01

So that is not my problem.

There is no traffic on the bus before my master talks to the other nodes and there is no traffic after.

I have gone with a work around where I send a CAN message and then wait for it to be sent.

This works now so I will stay with it.

Thanks for the assistance.

View solution in original post

0 Kudos
Reply
3 Replies
1,732 Views
kef2
Senior Contributor V

Hi,

 

do you send messages with the same ID from different nodes simultaneously? If data payload is the same (or no payload), then transmission from two or more nodes may match in time and others will see single message instead of two or more. Sending with same ID but different payload synchronously may trigger transmission errors

Is there a bus overload and I need to assign each a delay before it sends each cards response?

No, just read messages in time, not allowing OVRIF =1 to happen.

 

 

 CAN1RFLG = RXF; 

How RXF is defined? OK if it equals 1.

 

Edward

0 Kudos
Reply
1,723 Views
dastek
Contributor III

Hi Edward,

This is how I define RXF  :  #define RXF (unsigned char) 0x01

So that is not my problem.

There is no traffic on the bus before my master talks to the other nodes and there is no traffic after.

I have gone with a work around where I send a CAN message and then wait for it to be sent.

This works now so I will stay with it.

Thanks for the assistance.

0 Kudos
Reply
1,754 Views
dastek
Contributor III

Hi,

Is it possible that when I acknowledge the CAN RX interrupt that I clear some other message flags?

This is how I clear the RX flag

                          CAN1RFLG = RXF; 

0 Kudos
Reply