09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>RM0090</strong> Ethernet (ETH): media access control (MAC) with DMA controller<br />

be greater than or equal to the resolution of time stamp counter. The synchronization<br />

accuracy target between the master node and the slaves is around 100 ns.<br />

The generation, update and modification of the System Time are described in the Section :<br />

System Time correction methods.<br />

The accuracy depends on the PTP reference clock input period, the characteristics of the<br />

oscillator (drift) and the frequency of the synchronization procedure.<br />

Due to the synchronization from the Tx and Rx clock input domain to the PTP reference<br />

clock domain, the uncertainty on the time stamp latched value is 1 reference clock period. If<br />

we add the uncertainty due to resolution, we will add half the period for time stamping.<br />

Transmission of frames with the PTP feature<br />

When a frame’s SFD is output on the MII, a time stamp is captured. Frames for which time<br />

stamp capture is required are controllable on a per-frame basis. In other words, each<br />

transmitted frame can be marked to indicate whether a time stamp must be captured or not<br />

for that frame. The transmitted frames are not processed to identify PTP frames. Frame<br />

control is exercised through the control bits in the transmit descriptor. Captured time stamps<br />

are returned to the application in the same way as the status is provided for frames. The<br />

time stamp is sent back along with the Transmit status of the frame, inside the<br />

corresponding transmit descriptor, thus connecting the time stamp automatically to the<br />

specific PTP frame. The 64-bit time stamp information is written back to the TDES2 and<br />

TDES3 fields, with TDES2 holding the time stamp’s 32 least significant bits.<br />

Reception of frames with the PTP feature<br />

When the IEEE 1588 time stamping feature is enabled, the Ethernet MAC captures the time<br />

stamp of all frames received on the MII. The MAC provides the time stamp as soon as the<br />

frame reception is complete. Captured time stamps are returned to the application in the<br />

same way as the frame status is provided. The time stamp is sent back along with the<br />

Receive status of the frame, inside the corresponding receive descriptor. The 64-bit time<br />

stamp information is written back to the RDES2 and RDES3 fields, with RDES2 holding the<br />

time stamp’s 32 least significant bits.<br />

System Time correction methods<br />

The 64-bit PTP time is updated using the PTP input reference clock, HCLK. This PTP time is<br />

used as a source to take snapshots (time stamps) of the Ethernet frames being transmitted<br />

or received at the MII. The System Time counter can be initialized or corrected using either<br />

the Coarse or the Fine correction method.<br />

In the Coarse correction method, the initial value or the offset value is written to the Time<br />

stamp update register (refer to Section 29.8.3: IEEE 1588 time stamp registers on<br />

page 992). For initialization, the System Time counter is written with the value in the Time<br />

stamp update registers, whereas for system time correction, the offset value (Time stamp<br />

update register) is added to or subtracted from the system time.<br />

In the Fine correction method, the slave clock (reference clock) frequency drift with respect<br />

to the master clock (as defined in IEEE 1588) is corrected over a period of time, unlike in the<br />

Coarse correction method where it is corrected in a single clock cycle. The longer correction<br />

time helps maintain linear time and does not introduce drastic changes (or a large jitter) in<br />

the reference time between PTP Sync message intervals. In this method, an accumulator<br />

sums up the contents of the Addend register as shown in Figure 343. The arithmetic carry<br />

that the accumulator generates is used as a pulse to increment the system time counter.<br />

Doc ID 018909 Rev 3 936/1416

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!