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

RFC: prescaler phase offset & pulse triggering #21

Closed krmpotic closed 4 years ago

krmpotic commented 4 years ago

Tested on mtca EVR.

I am not sure about using fixed register offsets in drvemPrescaler.cpp, because MRMPreScaler class maybe avoids it to be hardware generic.

Another way would be to use MRMPreScaler like this: MRMPreScaler(name.str(), this,i); instead of like this: MRMPreScaler(name.str(), this,base+U32_Scaler(i));

So register #defines would be used only within the class.

mdavidsaver commented 4 years ago

The ScalerPhasOffs register isn't included in the latest documentation I have. Which firmware version introduces it? If it works the way the name suggests to me, to shift the phase of one prescaler relative to another with the same divider, then my only request is for more user friendly units (degrees)

The manual I have says of the ScalerPulsTrig register:

Each bit in the Prescaler Pulse Trigger Register corresponds to one pulse generator trigger. If for instance bit 0 is set, pulse generator 0 gets trigger on each 0 to 1 transition of the corresponding prescaler.

This seems analogous to the mapping ram with precaler# in place of event code. This makes me think this control should be part of the pulse generator which would be triggered. Maybe as another action alongside Trig, Set, and Reset? VAL would hold a prescalar# instead of an event code.

https://github.com/epics-modules/mrfioc2/blob/76820e4373faad921334c2cea340bc6bca8ed645/evrApp/Db/evrpulsermap.db#L3-L9

krmpotic commented 4 years ago

I have tested prescaler phase offshifts also for prescalers with different dividers. I understand it as offshift after a PS reset event, but yes I agree regarding the units, we should use degrees.

krmpotic commented 4 years ago

The ScalerPhasOffs register isn't included in the latest documentation I have. Which firmware version introduces it?

0D0207 (20. May 2019) affected HW: mTCA-EVR-300