Control area network (CAN)

Discussion in 'The Projects Forum' started by M Haris Khan, Jul 20, 2011.

  1. M Haris Khan

    Thread Starter New Member

    Jul 20, 2011
    4
    0
    Hello everyone

    I am using sja1000 CAN controller and tja 1040 CAN transceiver. The system is successfully transmitting messages on the bus but when some other node sends some message CAN controller recieves multiple messages and its RAM overflow as indicated by SJA1000's Status reg.

    I have analysed the bus there i actually found multiple messages in oscilloscope. But it doesnot creat any problem for other node i.e it reads message. But here in my node SJA1000's data over-run occurs.

    I have also tried the Self reception mode i.e CAN controoler recieves what it transmits. In this case message is received correctly.

    CAN anyone help me over this plssss..
     
  2. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Do you mean, there are multiple messages being sent simultaneously?
    AFAIK the lesser priority message sending node should stop sending when there was a collision...

    What happens if you change message IDs? (more or less priority)
     
  3. M Haris Khan

    Thread Starter New Member

    Jul 20, 2011
    4
    0
    Thanks for showing your interest.

    I m using 3 nodes one is NI-PCI-CAN card say N1, other is custom developed board (ARM controller based) say N2 and third node is what i m working on say N3. when i send a message, i write 0x3 to Command reg i.e. setting TR bit (Transmission request bit) and AT bit (Abort transmission bit) simultaneously which causes SJA1000 to send message only once. This message is read by both N1 and N2 and if i also set Self reception mode ON message is also read by SJA1000 successfully.

    But when some other node, say N2, sends message, N1 receives it correctly but N3 or sja1000 receives it as multiple messages and data over run occurs in sja1000's RAM . Content of SJA1000 Status reg SR changes from 0x0C to 0x0F i.e two LSBs bit1='Data overrun' and bit 0='msg Received bit' both are set indicating so many messages have been received that data overrun occurred.

    At a time only one node is sending so there is no collision. I have tried different IDs but not any change observed.

    Thing confusing for me is why there are so many msgs (about 8 to 12) on bus if msg is either sent by N1 or N2? n if there are so many messages on bus then why are they not causing problem either for N1 or N2 they take it as single message only?

    If some one has some standard CAN hardware n software analyzer then plz check bus on physical level that there are multiple messages or not (on single msg transmit event)?
     
    Last edited: Jul 22, 2011
  4. praondevou

    AAC Fanatic!

    Jul 9, 2011
    2,936
    488
    Well, I'm not a programmer, so I can't be of much help. But how you explained it, I understand that there are really sent out multiple messages from e.g. N2, and N1 either accepts only the first one and ignores others, because they are the same (and N3 doesn't) . Or N1 is able to free up the receiving buffer fast enough, and N3 doesn't.

    Sorry, I can't be of more help.
     
  5. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Are you sure you have the bus properly connected, shielded and terminated? You could have some reflections which could cause such glitches.
     
  6. M Haris Khan

    Thread Starter New Member

    Jul 20, 2011
    4
    0
    I think Bus is OK. the nodes at the physical ends of the bus are terminated with 120 ohms. while central node is not. resistance b/w CANH n CANL measured was 60 ohms approx. voltage levels of CANH n CANL are in the range specified in standard. Problem only occur during reception due to multiple messages. I m confused if dataover run occur in my node then why other hardwares read it as a single message.
    Actually i lack some standard CAN hardware plus software. I want to ask how a standard hardware do in multiples messages either it receives mulitple same messages as single message ignoring other messages or read all multiple messages. I cant program controller in a way that as soon as it gets some message it sleeps for some time i.e. ignore other messages in that time as there is v v short time b/w two consecutive messages.
     
Loading...