Hi everyone,
I'm using an F28035. My microcontroller is on a CAN network with a dozen nodes and an average load about 40%.
If I my programs enables the eCAN module and the CANRX/CANTX pins as soon as possible it generates error frames on the bus. I assume the reason for this is that my microcontroller starts receiving while some other node is transmitting a frame, so it only sees a partial frame and emits an error frame.
Hence my question on the RM bit in the CANES register. The datasheet states :
Receive mode. The CAN module is in receive mode. This bit reflects what the CAN module is
actually doing regardless of mailbox configuration.
1 The CAN module is receiving a message.
0 The CAN module is not receiving a message.
I tried something like this:
union CANES_REG esShadow;
do {
esShadow.all = ECanaRegs.CANES.all;
} while (esShadow.bit.RM == 1);
But it doesn't change anything. Therefore I would like to know precisely how this flag works:
- When exactly is it set?
- What does it take for the eCAN module to consider itself "receiving a message" ?
How can I get my microcontroller to gracefully start communicating on the CAN bus? Any help would be much appreciated!
Regards,
Pierre