SensL © 2011
66
USER MANUAL
HRM-TDC
SensL © 2011
66
> Appendix > Resolving Free Running Fifo Time-tag Values
RESOLVING FREE RUNNING FIFO TIME-TAG VALUES
Free Running Algorithm Explained
When the module operates in
Free Running
FIFO Time-Tagging mode, resolving the time-tag values can be quite
complicated. A FIFO time-tag consists of two 32-bit unsigned values. The first word reports the MICRO time and
channel number. The second word, called the MACRO time, is a 32 bit free running counter value with an LSB of
5ns.
The MICRO counter is a 23 bit counter with an LSB value of 26.9851ps. This counter rolls over at a value of 0x50FFFF.
The time for a complete rollover of the MACRO counter is ~21.5 seconds. So, assuming that the intervals between
consecutive time-tags is not greater than ~21.5 seconds each time-tag interval can be calculated as follows:
1.
Calculate MACRO change dMACRO
If previous MACRO value is less than current MACRO value then
dMACRO = cMACRO – pMACRO
If previous value (pMACRO) is greater than current (cMACRO) then counter has rolled over so
dMACRO = 0x100000000 – cMACRO
2.
Calculate complete MICRO rollover time rMICRO
Complete rollover time for MICRO:
rMICRO = 0x510000 * 26.9851ps = 143248136.6016ps
3.
Calculate number of complete MICRO rollovers nMICRO
nMICRO = (dMACRO x 5000) / rMICRO
(x 5000 to convert dMACRO into ps)
4.
Calculate change in MICRO counter dMICRO
If previous value (pMICRO) is less than current value (cMICRO) then
dMICRO = cMICRO – pMICRO
If previous value (pMICRO) is greater than current (cMACRO) then counter has rolled over so
dMICRO = 0x510000 – cMICRO
5.
Calculate total time between time-tags dTIME
dTIME = (nMICRO x rMICRO) + (dMICRO x 26.9851) ps