TC1796
Peripheral Units (Vol. 2 of 2)
Controller Area Network (MultiCAN) Controller
User’s Manual
22-115
V2.0, 2007-07
MultiCAN, V2.0
Note: Register LTUR is used for the internal automatic calculation of the new TURADJ
value. It is not visible for the user.
In TTCAN level 1, the LT counter is incremented once per CAN bit time. The fractional
part LTFR of the local time and the TUR are not taken into account.
In TTCAN level 2, the LT is extended by its fractional part LTFR. The TUR value is added
to the LTFR value with the update period
t
upd
in order to generate a new LT value. If an
overflow occurs (carry active) after an addition of LTFR and TUR, the value of LT is
incremented by 1. As a result, the value of LT can change only in steps of 1, whereas
the value of LTFR changes in steps of TUR.
In order to cover a wide range of CAN baud rates with the same counting range of the
local timer, the counting can take place every CAN time quantum
t
q
(
t
upd
=
t
q
). If another
resolution of the NTU is desired, the local time generation can also be based on the clock
f
CAN
, divided by a programmable factor that is independent from the CAN bit timing.
After the update period
t
upd
has elapsed N times, the difference in local time d
t
has
elapsed to: d
t
= TURR.TUR/1024
×
N
×
t
upd
.
22.5.2
Automatic TUR Adjust
It is possible to automatically calculate the new value written to TURADJ for adjusting
the correct value for the local time on TTCAN level 2. Each time a new reference
message is correctly received, the difference is calculated between the time values in
the reference message (GMR) and the previous reference message (LGMR). This
difference, divided by the amount of own NTUs for a complete basic cycle multiplied by
LTUR, provides the TURADJ value (including fractional parts).
TURADJ = LTUR
×
(GM - LGM) / (REFM - LREFM)
The automatic TUR adjust is not made when a discontinuity has been signaled between
the reference messages. The automatic calculation of the new value for TURADJ takes
place during the basic cycle.
The value of TUR is updated at the beginning of each basic cycle. The new value that is
written to TUR to adjust the timing is stored in the bit field TURADJ.
22.5.3
Cycle Time
The cycle time is always positive and represents the time elapsed in the current basic
cycle, starting from 0.
22.5.3.1 Local Time and Synchronization Marks
The cycle time is the difference between the local time (stored in bit field LT) and its last
reference mark (stored in bit field REFM). The result is available in the bit field CYCTM.
The value of the local time LT is captured at the start of each message as a
synchronization mark SYNM. If the correctly received message has been a reference