Rainbow Electronics AT91CAP9S250A User Manual

Page 707

Advertising
background image

707

6264A–CAP–21-May-07

AT91CAP9S500A/AT91CAP9S250A

39.7.4.2

Time Triggered Mode

In Time Triggered Mode, basic cycles can be split into several time windows. A basic cycle
starts with a reference message. Each time a window is defined from the reference message,
a transmit operation should occur within a pre-defined time window. A mailbox must not win
the arbitration in a previous time window, and it must not be retried if the arbitration is lost in
the time window.

Figure 39-20. Time Triggered Principle

Time Trigger Mode is enabled by setting the TTM field in the CAN_MR register. In Time Trig-
gered Mode, as in Timestamp Mode, the CAN_TIMESTP field captures the values of the
internal counter, but the MTIMESTAMP fields in the CAN_MSRx registers are not active and
are read at 0.

Synchronization by a Reference Message

In Time Triggered Mode, the internal timer counter is automatically reset when a new mes-
sage is received in the last mailbox. This reset occurs after the reception of the End Of Frame
on the rising edge of the MRDY signal in the CAN_MSRx register. This allows synchronization
of the internal timer counter with the reception of a reference message and the start a new
time window.

Transmitting within a Time Window

A time mark is defined for each mailbox. It is defined in the

16

-bit MTIMEMARK field of the

CAN_MMRx register. At each internal timer clock cycle, the value of the CAN_TIM is com-
pared with each mailbox time mark. When the internal timer counter reaches the
MTIMEMARK value, an internal timer event for the mailbox is generated for the mailbox.

In Time Triggered Mode, transmit operations are delayed until the internal timer event for the
mailbox. The application prepares a message to be sent by setting the MTCR in the
CAN_MCRx register. The message is not sent until the CAN_TIM value is less than the
MTIMEMARK value defined in the CAN_MMRx register.

If the transmit operation is failed, i.e., the message loses the bus arbitration and the next trans-
mit attempt is delayed until the next internal time trigger event. This prevents overlapping the
next time window, but the message is still pending and is retried in the next time window when
CAN_TIM value equals the MTIMEMARK value. It is also possible to prevent a retry by setting
the DRPT field in the CAN_MR register.

Freezing the Internal Timer Counter

The internal counter can be frozen by setting TIMFRZ in the CAN_MR register. This prevents
an unexpected roll-over when the counter reaches FFFFh. When this occurs, it automatically
freezes until a new reset is issued, either due to a message received in the last mailbox or any
other reset counter operations. The TOVF bit in the CAN_SR register is set when the counter

Reference

Message

Reference

Message

Global Time

Time Cycle

Time Windows for Messages

Advertising