EMACTIMADD
Accumulator Register
Constant Value
EMACTIMNANO
EMACTIMSEC
+
+
EMACTIMSTCTRL.
ADDREGUP
Increment the
Seconds Register
Increment the
Subseconds Register
Functional Description
917
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Ethernet Controller
15.3.6.1 System Time Module
The System Time module maintains a 64-bit time and is updated using the MOSC clock source as the
PTP clock reference. This time is the source for taking snapshots (timestamps) of the Ethernet frames
being transmitted or received. Two methods of updating the system time counter are implemented. The
counter can be initialized or corrected using the coarse correction method. In this method, the initial value
or the offset value is written to the MAC System Time - Seconds Update (EMACTIMSECU) register along
with the MAC System Time - Nanoseconds Update (EMACTIMNANOU) register. For initialization the
system time counter is written with the value in these registers, while for system time correction, the offset
value is added to or subtracted from the system time.
In the fine correction method, the slave clock frequency drift with respect to the master clock is corrected
over a period of time instead of in one clock, as in coarse correction. This helps maintain linear time and
does not introduce drastic changes (or a large jitter) in the reference time between PTP Sync message
intervals. In this method, an accumulator sums up the contents of the EMACTIMADD register (see
). The arithmetic carry that the accumulator generates is used as a pulse to increment the
system time counter. The accumulator and the addend are 32-bit registers. Here, the accumulator acts as
a high-precision frequency multiplier or divider.
Figure 15-11. System Time Update Using Fine Correction Method
NOTE:
If the Ethernet Controller is configured to use the MII/RMII interface to an external PHY, then
the MOSC clock that feeds the PTP reference clock to the System Time Module has a
minimum frequency requirement of 5 MHz and a maximum frequency of 25 MHz. For course
correction methods, the value of MOSC can be anywhere within this range, but for the fine
correction method, a 25-MHz MOSC crystal should be used for the best accuracy. If the
Ethernet Controller is configured to use the MII interface connected to the integrated PHY,
then the MOSC clock that feeds the PTP reference clock to the System Time Module must
be 25 MHz, because it also clocks the integrated PHY module.
Initially, the Ethernet slave clock (from the MOSC) is adjusted with a compensation value (as described in
the previous paragraph) which is written to the Timestamp Addend Register (TSAR) field in the
EMACTIMADD register. This value is calculated as:
FreqCompensationValue
0
= TSAR = 2
32
/ FreqDivisionRatio
(50)