5.2.1.1 Timestamp

The data returned over the timestamp interface is a sequential stream of timestamped packets of data belonging to the interfaces that have timestamping enabled. The first byte in each packet is the interface identifier and will decide how the rest of the packet must be parsed.

The timestamp is relying on a 16-bit timer, which is sampled and embedded into each packet. The timer tick frequency can be read from the timestamp configuration. It is in the area of about half a microsecond. When the timer overflows, a packet will be embedded in the stream to indicate this event. Note that if a data packet is being embedded as the timer overflows, an overflow packet will not be embedded. Instead, it will be indicated in the header of the data packet.

All timestamped packets are generated from module interrupts within the DGI device, which can not be interrupted by the timer overflow interrupt. This means that there is a possibility that the timer has overflowed before the timer was sampled and embedded. To be able to keep the timestamp in sync and accurate for such events the packets are also embedding the timer overflow bit. This bit is sampled after the timer itself, and can potentially be set even if the sampled timer value was in sync.