GD32F10x User Manual
682
System time correction method
The 64-bit PTP system time update by the PTP input reference clock. The PTP system time
is used as the source to record
transmission/reception frame’s timestamp. The system time
initialization and calibration support two methods: coarse method and fine method. The
purpose of calibration is to correct the frequency offset.
If the coarse correction method is selected, application can configure PTP timestamp update
register (ENET_PTP_TSUH and ENET_PTP_TSUL) for system time initialization or
correction. If TMSSTI bit is set, PTP timestamp update register is used for initialization and if
TMSSTU bit is set, PTP timestamp update register is used for adjust system time by adding
or subtracting.
If fine correction method is selected, operation is different. The fine correction method corrects
system time not in a single clock cycle. The fine correction frequency can be configured by
application to make slave clock frequency smoothly adapt master clock without
unpredictability large jitter.
This method is referred to the value of ENET_PTP_TSADDEND added to the accumulator in
each HCLK cycle. PTP module will produce a pulse to increase the value of ENET_PTP_TSL
register when the accumulator overflowed. The increased value when this pulse occurs is in
ENET_PTP_SSINC register.
Figure 22-7. System time update using the fine correction method
correction algorithm process:
Figure 22-7. System time update using the fine correction method
Addend
Register
+
+
Constant
Value
Accumulator
Register
Subsecond
Register
Second
Register
Addend
update
Increment
Subsecond
Register
Increment
Second
Register
The following concrete example is used to descript the fine correction method how to
update the system time:
Assuming the accuracy of the system time update circuit required to achieve 20ns, which
means the frequency of update is 50MHz. If the reference clock of HCLK is 75MHz, the
frequency ratio is calculated as 75/50, result is 1.5. Hence, the addend (TMSA bit in
ENET_PTP_TSADDEND register) value to be set is 2
32
/1.5, which is equal to 0xAAAA AAAA.
If the reference clock frequency drifts lower, for example, down to 65MHz, the frequency ratio
Содержание GD32F10 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F10x Arm Cortex M3 32 bit MCU User Manual Revision 2 6 Jun 2022 ...
Страница 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Страница 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Страница 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Страница 427: ...GD32F10x User Manual 427 value ...
Страница 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...