29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RM0008<br />

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

3. The master then sends the slave a Follow_up message, which contains the t 1<br />

information for later use.<br />

4. The slave sends the master a Delay_Req message, noting the exact time, t 3 , at which<br />

this frame leaves the MII.<br />

5. The master receives this message <strong>and</strong> captures the exact time, t 4 , at which it enters its<br />

system.<br />

6. The master sends the t 4 information to the slave in the Delay_Resp message.<br />

7. The slave uses the four values of t 1 , t 2 , t 3 , <strong>and</strong> t 4 to synchronize its local timing<br />

reference to the master’s timing reference.<br />

Most of the protocol implementation occurs in the software, above the UDP layer. As<br />

described above, however, hardware support is required to capture the exact time when<br />

specific PTP packets enter or leave the Ethernet port at the MII. This timing information has<br />

to be captured <strong>and</strong> returned to the software for a proper, high-accuracy implementation of<br />

PTP.<br />

Reference timing source<br />

To get a snapshot of the time, the core requires a reference time in 64-bit format (split into<br />

two 32-bit channels, with the upper 32 bits providing time in seconds, <strong>and</strong> the lower 32 bits<br />

indicating time in nanoseconds) as defined in the IEEE 1588 specification.<br />

The PTP reference clock input is used to internally generate the reference time (also called<br />

the System Time) <strong>and</strong> to capture time stamps. The frequency of this reference clock must<br />

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

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

The generation, update <strong>and</strong> 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) <strong>and</strong> the frequency of the synchronization procedure.<br />

Due to the synchronization from the Tx <strong>and</strong> 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 (as described in<br />

Figure 314: Transmit descriptor field format with IEEE1588 time stamp enabled on<br />

page 891). Captured time stamps are returned to the application in the same way as the<br />

status is provided for frames. The time stamp is sent back along with the Transmit status of<br />

the frame, inside the corresponding transmit descriptor, thus connecting the time stamp<br />

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

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

as described in Tx DMA descriptor format with IEEE1588 time stamp on page 891.<br />

Doc ID 13902 Rev 9 873/995

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

Saved successfully!

Ooh no, something went wrong!