169
ATmega16M1/32M1/64M1 [DATASHEET]
8209E–AVR–11/2012
CANHPMOB register gives the MOb having the highest priority in CANSIT registers. It is formatted to provide a
direct entry for CANPAGE register. Because CANHPMOB codes CANSIT registers, it will be only updated if the
19.6.5
CAN data buffers
To preserve register allocation, the CAN data buffer is seen such as a FIFO (with address pointer accessible) into
a MOb selection.This also allows to reduce the risks of un-controlled accesses.
There is one FIFO per MOb. This FIFO is accessed into a MOb page thanks to the CAN message register.
The data index (INDX) is the address pointer to the required data byte. The data byte can be read or write. The
data index is automatically incremented after every access if the AINC* bit is reset. A roll-over is implemented, after
data index=7 it is data index=0.
The first byte of a CAN frame is stored at the data index=0, the second one at the data index=1, ...
19.7
CAN timer
A programmable 16-bit timer is used for message stamping and time trigger communication (TTC).
Figure 19-11. CAN timer block diagram.
19.7.1
Prescaler
An 8-bit prescaler is initialized by CANTCON register. It receives the clk
IO frequency divided by 8. It provides clk-
CANTIM frequency to the CAN Timer if the CAN controller is enabled.
Tclk
CANTIM = TclkIO x 8 x (CANTCON [7:0] + 1)
19.7.2
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).
19.7.3
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.
clk
IO
clk CANTIM
CANTIM
CANTTC
CANSTM[i]
CANTCON
TTC
SYNCTTC
"EOF "
"SOF "
OVRTIM
TXOK[i]
RXOK[i]
overrun
ENFG
8