UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2012. All rights reserved.
User manual
Rev. 1.3 — 6 July 2012
726 of 1269
NXP Semiconductors
UM10503
Chapter 26: LPC43xx Ethernet
Initially, the slave clock is set with FreqCompensationValue0 in the Addend register. This
value is as follows:
FreqCompensationValue0 = 232 / FreqDivisionRatio
If MasterToSlaveDelay is initially assumed to be the same for consecutive Sync
messages, the algorithm described below must be applied. After a few Sync cycles,
frequency lock occurs. The slave clock can then determine a precise MasterToSlaveDelay
value and re-synchronize with the master using the new value.
The algorithm is as follows:
•
At time MasterSyncTime
n
the master sends the slave clock a Sync message. The
slave receives this message when its local clock is SlaveClockTime
n
and computes
MasterClockTime
n
as:
MasterClockTime
n
= MasterSyncTime
n
+ MasterToSlaveDelay
n
•
The master clock count for current Sync cycle, MasterClockCount
n
is given by:
MasterClockCount
n
= MasterClockTime
n
. MasterClockTime
n-1
(assuming that
MasterToSlaveDelay is the same for Sync cycles n and n - 1)
•
The slave clock count for current Sync cycle, SlaveClockCount
n
is given by:
SlaveClockCount
n
= SlaveClockTimen
n
- SlaveClockTime
n-1
•
The difference between master and slave clock counts for current Sync cycle,
ClockDiffCount
n
is given by:
ClockDiffCount
n
= MasterClockCount
n
- SlaveClockCount
n
•
The frequency-scaling factor for slave clock, FreqScaleFactor
n
is given by:
FreqScaleFactor
n
= (MasterClockCount
n
+ ClockDiffCount
n
) / SlaveClockCount
n
•
The frequency compensation value for Addend register, FreqCompensationValue
n
is
given by:
FreqCompensationValue
n
= FreqScaleFactor
n
* FreqCompensationValue
n-1
In theory, this algorithm achieves lock in one Sync cycle; however, it may take several
cycles, because of changing network propagation delays and operating conditions.
This algorithm is self-correcting: if for any reason the slave clock is initially set to a value
from the master that is incorrect, the algorithm corrects it at the cost of more Sync cycles.
26.7.3.3 Transmit path functions
The MAC captures a timestamp when the Start Frame Delimiter (SFD) of a frame is sent
on MII. The frames for which you want to capture timestamps are controllable on a
per-frame basis. In other words, each transmit frame can be marked to indicate whether a
timestamp should be captured for that frame.
The MAC does not process the transmitted frames to identify the PTP frames. You need
to specify the frames for which you want to capture timestamps.
Use the control bits in the transmit descriptor (see
). The MAC returns
the timestamp to the software inside the corresponding transmit descriptor, thus
connecting the timestamp automatically to the specific PTP frame. The 64-bit timestamp
information is written to the TDES6 and TDES7 fields. The TDES7 field holds the 32 least
significant bits of the timestamp.