Since the TM4C129 does not have 64 Bit Timers I am forced to use the IEEE-1588 TimeStamp to measure digital event timing which has a 40 nanosecond accuracy. I am using COARSE MODE.
EMACTimestampConfigSet(EMAC0_BASE, (EMAC_TS_PTP_VERSION_2 | EMAC_TS_DIGITAL_ROLLOVER | EMAC_TS_UPDATE_COARSE), 40);
During a digital interrupt routine I read the Seconds and Subseconds using the following statements (I am aware of the Subsecond Rollover and know how to test for it):
subseconds = HWREG(EMAC0_BASE + EMAC_O_TIMNANO);
seconds = HWREG(EMAC0_BASE + EMAC_O_TIMSEC);
The time difference from interrupt to interrupt normally is 0, which is what I expect since I am using a digital signal with a precision frequency.
However, every 5 to 7 reads I see a +120 nanosecond and then a -120 nanosecond which means something in the background is delaying my interrupt response for 3 updates of the IEEE-1588 clock which is 3 x 40 nanoseconds or about 14 - 15 Processor Clock Cycles.
Here is the pattern between successive reads (the left side is the time measurement of 51.199440 milliseconds and the right side is the difference between successive reads);
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199560 | 120 |
51199440 | -120 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199560 | 120 |
51199440 | -120 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199560 | 120 |
51199440 | -120 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199440 | 0 |
51199560 | 120 |
51199440 | -120 |
The Digital Interrupt is the ONLY interrupt I have programmed.
I have set the interrupt priority for the EMAC Interrupt below the Digital Signal Interrupt.
//Lower EMAC Interrupt Priority
IntPrioritySet(INT_EMAC0, 0x10);
//Enable Interrupt on Port E
IntPrioritySet(INT_GPIOE, 0);
Does anyone know what the problem might be or has anyone tested the IEEE-1588 TimeStamp for real world accuracy?