
421
7682C–AUTO–04/08
AT90CAN32/64/128
4.
CAN acknowledge error in 3-sample mode with prescaler =1
Some acknowledge errors can occur when the clock prescaler = 1 (BRP[5..0] = 0 in
CANBTR1 register) and the SMP bit is set (CANBTR3[0] = 1 in CANBTR3 register). That
can result in a reduction of the maximum length of the CAN bus.
Problem fix / workaround
If BRP[5..0]=0 use SMP=0.
3.
CAN transmission after 3-bit intermission
If a Transmit Message Object (MOb) is enabled while the CAN bus is busy with an on going
message, the transmitter will wait for the 3-bit intermission before starting its transmission.
This is in full agreement with the CAN recommendation.
If the transmitter lost arbitration against another node, two conditions can occur:
- At least one receive MOb of the chip are programmed to accept the incoming message. In
this case, the transmitter will wait for the next 3-bit intermission to retry its transmission.
- No receive MOb of the chip are programmed to accept the incoming message. In this case
the transmitter will wait for a 4-bit intermission to retry its transmission. In this case, any
other CAN nodes ready to transmit after a 3-bit intermission will start transmit before the
chip transmitter, even if their messages have lower priority IDs.
Problem fix / workaround
Always have a receive MOb enabled ready to accept any incoming messages. Thanks to
the implementation of the CAN interface, a receive MOb must be enable at latest, before the
1st bit of the DLC field. The receive MOb status register is written (RXOK if message OK)
immediately after the 6th bit of the End of Frame field. This will leave in CAN2.0A mode a
minimum 19-bit time delay to respond to the end of message interrupt (RXOK) and re-
enable the receive MOb before the start of the DLC field of the next incoming message. This
minimum delay will be 39-bit time in CAN2.0B. See CAN2.0A CAN2.0B frame timings
below.
Workaround implementation
The workaround is to have the last MOb (MOb14) as "spy" enabled all the time; it is the MOb
of lowest priority. If a MOb other than MOb14 is programmed in receive mode and its accep-
tance filter matches with the incoming message ID, this MOb will take the message. MOb14
will only take messages than no other MObs will have accepted. MOb14 will need to be re-
enabled fast enough to manage back to back frames. The deadline to do this is the begin-
ning of DLC slot of incoming frames as explained above.
Minimum code to insert in CAN interrupt routine:
CAN 2.0A
Arbitration
Field
Control
Field
End of Frame
CRC
Field
ACK
Field
Inter-
mission
19-bit time minimum
T1
(RXOK)
T2
11-bit identifier
ID10..0
CRC
del.
ACK
del.
15-bit CRC
SOF
RTR IDE
r0
ACK
7 bits
4-bit DLC
DLC4..0
3 bits
CAN 2.0B
39-bit time minimum
T1
(RXOK)
T2
End of Frame
CRC
Field
ACK
Field
Inter-
mission
Arbitration
Field
Control
Field
CRC
del.
ACK
del.
15-bit CRC
SOF
ACK
7 bits
3 bits
11-bit base identifier
IDT28..18
18-bit identifier extension
ID17..0
4-bit DLC
DLC4..0
SRR IDE
r0
RTR
r1