This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TwinCan problem

Hi everyone,

I'm adding the CAN support to a controller using an Infineon XC161 uP. I've used the Dave application from Infineon to set all registers and INT, and I used the generated modules in my application. Now I can send/receive CAN messages but I found a problem:
- to debug the application I created transmission problems and I find that the TEC counter in AECNT register never exceed the 128 limit. This causes that BOFF flag is never set and the EWRN flag is set only if I set the EWRNLVL <= 128 !

Is there someone here that can help me ?

Thank you !

Parents
  • Thanks to your reply I understand that the counter stops when the TwinCan enters in error-passive mode; am I right ?
    Now the question is: how can the counter exceed the 255 limit (and then enter in bus-off state) if it is stopped everytime he reach the value of 128 ?
    I suppose that I miss something but I don't understand what.......

Reply
  • Thanks to your reply I understand that the counter stops when the TwinCan enters in error-passive mode; am I right ?
    Now the question is: how can the counter exceed the 255 limit (and then enter in bus-off state) if it is stopped everytime he reach the value of 128 ?
    I suppose that I miss something but I don't understand what.......

Children
  • am I right? yes

    My understanding is you will never go bus off from an ACK error.

    When the CAN module is in the error-active state it will transmit an error frame (to its own frame in the case I described before) since no other nodes acknowledged your message. Once you reach the TEC limit then you (your CAN node) will stop sending error frames and become error-passive. The message however is being sent on the bus (it will be sent forever or until you cancel it or until someone else acknowledges it).

    Read the CAN spec from Bosch (in particular section 8, Fault Confinement) and setup your test to bring you to a bus-off condition.

    www.semiconductors.bosch.de/.../can2spec.pdf