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 !
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