Texas Instruments Development Kit for TM4C129x,Tiva™ ARM® Cortex™ -M4 Microcontroller DK-TM4C129X DK-TM4C129X 데이터 시트

제품 코드
DK-TM4C129X
다운로드
페이지 2182
calculate the drift in frequency based on the Sync messages and update the EMACTIMADD register,
at offset 0x718, accordingly.
If the master to slave delay is initially assumed to be the same for consecutive Sync messages,
then the following steps can be used to calculate a new TSAR value. The following algorithm
calculates the precise mater to slave delay value to allow for re-synchronization with the master
using the new value:
1.
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
2.
The master clock count, MasterClockCount
n
, for the current Sync cycle is given by:
MasterClockCount
n
= MasterClockTime
n
- MasterClockTime
n-1
This assumes that the MasterToSlaveDelay is the same for Sync cycles n and n-1.
3.
The slave clock count for current Sync cycle, SlaveClockCount
n
is given by:
SlaveClockCount
n
= SlaveClockTime
n
– SlaveClockTime
n – 1
4.
The difference between the master and slave clock counts for the current Sync cycle,
ClockDiffCount
n
, is given by:
ClockDiffCount
n
= MasterClockCount
n
– SlaveClockCount
n
5.
The frequency-scaling factor for the slave clock, FreqScaleFactor
n
is given by:
FreqScaleFactor
n
= (MasterClockCount
n
+ ClockDiffCount
n
) / SlaveClockCount
n
6.
The frequency compensation value, FreqCompensationValue, to be written in the TSAR field
of the EMACTIMADD register is:
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.
24.3.7.2
Transmit Timestamping
The MAC captures a timestamp when the Start Frame Delimiter (SFD) of a frame is sent. The
transmit frames are marked to indicate whether a timestamp should be captured for that frame and
written to the extended transmit descriptors that support timestamping. The MAC returns the
timestamp automatically to the corresponding transmit descriptor, thus connecting the timestamp
with the specific PTP frame. The 64-bit timestamp information is written to the TDES2 and TDES3
fields.
Note:
When the enhanced descriptor size is selected by setting the
ATDS
bit in the
EMACDMABUSMOD register, a larger descriptor is used and the MAC writes the 64-bit
timestamp information to TDES6 and TDES7, respectively.
December 13, 2013
1634
Texas Instruments-Advance Information
Ethernet Controller