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.

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

RM0008<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 received frames are not processed to identify<br />

PTP frames. The MAC provides the time stamp as soon as the frame reception is complete.<br />

Captured time stamps are returned to the application in the same way as the frame status is<br />

provided. The time stamp is sent back along with the Receive status of the frame, inside the<br />

corresponding receive descriptor. The 64-bit time stamp information is written back to the<br />

RDES2 <strong>and</strong> RDES3 fields, with RDES2 holding the time stamp’s 32 least significant bits as<br />

described in Rx DMA descriptors format with IEEE1588 time stamp on page 903.<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 27.8.3: IEEE 1588 time stamp registers on<br />

page 927). 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 <strong>and</strong> 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 307. The arithmetic carry<br />

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

The accumulator <strong>and</strong> the addend are 32-bit registers. Here, the accumulator acts as a highprecision<br />

frequency multiplier or divider. Figure 307 shows this algorithm.<br />

874/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!