![GigaDevice Semiconductor GD32F20 Series Скачать руководство пользователя страница 807](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32f20-series/gd32f20-series_user-manual_2225801807.webp)
GD32F20x User Manual
807
time after this bit is set from reset, application must initialize the timestamp counter at first.
Initialization steps as follow:
1. Setting bit 9 in the ENET_MAC_INTMSK register to mask the timestamp trigger
interrupt
2. Setting bit 0 in the ENET_PTP_TSCTL register to enable timestamp function
3. Configure the subsecond increment register according to the PTP clock frequency
precision
4. If application hopes to use fine correction method, configure the timestamp addend
register and set bit 5 in the ENET_PTP_TSCTL register to 1. If application hopes to use
coarse correction method, please jump directly to step 7 and step 4-6 can be ignored.
5. Poll the bit 5 in the ENET_PTP_TSCTL register until it is cleared
6. Set bit 1 in the ENET_PTP_TSCTL register to 1 to choose fine correction method
7. Configure the timestamp update high and low register with the value of system time
application wants to initialize
8. Send initialization command by setting bit 2 in the ENET_PTP_TSCTL register
9. The timestamp counter starts counting as soon as the initialization process complete
System time update steps under coarse correction method
1.
Program the offset (may be negative) value in the timestamp update high and low
registers
2.
Set bit 3 (TMSSTU) in the ENET_PTP_TSCTL register to update the timestamp
register
3.
Poll TMSSTU bit until it is cleared.
System time update steps under fine correction method
1.
Calculate the value of the desired system clock rate corresponding to the addend
register (calculation formula has explained before)
2.
Program the addend register, and set the bits 5 in ENET_PTP_TSCTL register
3.
Program the target high and low register and reset the bit 9 of the
ENET_MAC_INTMSK register to allow time stamp interrupt
4.
Set bit 4 (TMSITEN) in ENET_PTP_TSCTL register
5.
When an interrupt is generated by this event, read out the value of ENET_MAC_INTF
register and clear the corresponding interrupt flag
6.
Rewrite the old value of addend register to timestamp addend register and set bit 5 in
ENET_PTP_TSCTL register
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...