epics-modules / mrfioc2

EPICS driver for Micro Research Finland event timing system devices
http://epics-modules.github.io/mrfioc2/
Other
8 stars 30 forks source link

Adding more options of time stamp generator #159

Closed hongran closed 3 months ago

hongran commented 4 months ago

This update adds more options of generating timestamps from an EVM module, while keeping the existing configuration as the default so established systems do not need to modify any configuration files or EPICS database.

How does the existing code work

Both EVM and EVR are considered time stamp provider (source) and they use the shared code in mrmShared/src, like mrmtimesrc.cpp. For an EVM module, the 1pps input is selected as the external interrupt source. When the interrupt happens, the interrupt service function calls the callback function, and the callback function calls the shared tickSecond() function. In the tickSecond() function, the second counter is encoded as a sequence of 0x70 and 0x71 events, generated as soft events. The TS reset event 0x7d must be configured manually as an triggered event in the EVM.

Timestamp generator provided by the EVM board

The MRF firmware also provided a few ways to generate timestamps.

Summary of changes

gabrielfedel commented 3 months ago

I tested the changes on the mTCA-EVM-300 and it seems fine. I could also use the Software option and it seems to work fine. I'm going to merge it.