DUNE-DAQ / dtpcontrols

DUNE Trigger Primitives Control Software
0 stars 1 forks source link

PedSub Adjustment #35

Closed kmanolop closed 2 years ago

kmanolop commented 2 years ago

pedsub_adj isa signal used by the Pedestal Subtraction block to adjust the median value to that of the incoming ADC values. This operation takes place when the signal is set to '1'. DTP-controls should handle the register corresponding to that signal.

Changes made in the stream_processor.xmld addrtab are:

<node id="stream_processor" description="Stream processor" fwinfo="endpoint">
    <node id="csr" address="0x0">
        <node id="ctrl" address="0x0">
            <node id="drop_empty" mask="0x1"/>
            <node id="cap_ctrs" mask="0x2"/>
        </node>
        <node id="mask" address="0x1">
            <node id="ch-00-31" address="0x0"/>
            <node id="ch-32-63" address="0x1"/>
        </node>
        <node id="hitfinder" address="0x3">
            <node id="threshold" mask="0xffff"/>
        </node>
        <node id="pedsub" address="0x4">
            <node id="pedsub_adj" mask="0x0000"/>
        </node>
        <node id="mon" address="0x8">
            <node id="p0" address="0x0" module="file://dtpc_mon_probe.xml"/>
            <node id="p1" address="0x1" module="file://dtpc_mon_probe.xml"/>
            <node id="p2" address="0x2" module="file://dtpc_mon_probe.xml"/>
            <node id="p3" address="0x3" module="file://dtpc_mon_probe.xml"/>
            <node id="p4" address="0x4" module="file://dtpc_mon_probe.xml"/>
            <node id="p5" address="0x5" module="file://dtpc_mon_probe.xml"/>
        </node>
    </node>
</node>
jimbrooke commented 2 years ago

@kmanolop am I correct in thinking the expected operation is to set the register to 1 and then back to 0 ?

aearle-su commented 2 years ago

Having tested this in the questa project simulation, I am fairly certain that toggling the register won't work for our use case. I think with the current firmware, the register needs to be set to 1 when the ADC packet actually hits the pedsub block for it to use that first sample as the median

jimbrooke commented 2 years ago

thanks @aearle-su. Does this not work if the control register bit is held high until the next packet?

aearle-su commented 2 years ago

It does, so I just set it to write it high and it adjusted the pedestal for each wire when testing with the FixedADC_A pattern as that one has 500 and 900 pedestals I think