16.6 CAN Timer
A programmable 16-bit timer is used for message stamping and time trigger communication
(TTC).
Figure 16-11. CAN Timer Block Diagram
clk
CANTCON
ENFG
8
IO
clk
CANTIM
TTC SYNCTTC
overrun
OVRTIM
CANTIM
TXOK[i]
RXOK[i]
"EOF "
"SOF "
CANSTM[i]
CANTTC
16.6.1
Prescaler
An 8-bit prescaler is initialized by CANTCON register. It receives the clkIO frequency divided by
8. It provides clkCANTIM frequency to the CAN Timer if the CAN controller is enabled.
TclkCANTIM = TclkIO x 8 x (CANTCON [7:0] + 1)
16.6.2
16.6.3
16-bit Timer
This timer starts counting from 0x0000 when the CAN controller is enabled (ENFG bit). When
the timer rolls over from 0xFFFF to 0x0000, an interrupt is generated (OVRTIM).
Time Triggering
Two synchronization modes are implemented for TTC (TTC bit):
– synchronization on Start of Frame (SYNCTTC=0),
– synchronization on End of Frame (SYNCTTC=1).
In TTC mode, a frame is sent once, even if an error occurs.
16.6.4
Stamping Message
The capture of the timer value is done in the MOb which receives or sends the frame. All man-
aged MOb are stamped, the stamping of a received (sent) frame occurs on RxOk (TXOK).
182
ATmega16/32/64/M1/C1
7647F–AVR–04/09