<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#cc66cc" bgcolor="#ffffff">
    great job brian.<br>
    nice pulse train!<br>
    are voltage levels or widths or both adjustable?<br>
    <br>
    <br>
    On 6/16/2011 2:02 PM, Brian Eng wrote:
    <blockquote cite="mid:B5CE0753-5E4E-4EC3-B974-4039D05C88A6@jlab.org"
      type="cite">
      <pre wrap="">Hi All,

After talking with Jim Hoff (one of the FSSR2 designers from FNAL) I've discovered an error in our code (at least the C++ I haven't checked the LabVIEW yet). Specifically with the default command.

Currently the function looks like (hopefully my mail client doesn't mangle it to badly) the following:

void fssr2::register_default(int in_reg) {
        command c;
        c.set(6);
        reg r = register_map[in_reg];
        register_cmd(r, c);
        register_map[in_reg].value = register_map[in_reg].def;

        for (int i = 0; i &lt; prog_interface.size(); i++) {
                WDC_WriteAddr32(handle, PTA_CMC, 0x100, prog_interface[i].to_ulong());
        }

        bitset&lt;16&gt; temp = prog_interface.back();
        temp.set(bit_shift_control, 0);
        WDC_WriteAddr32(handle, PTA_CMC, 0x100, temp.to_ulong());
        temp.set(bit_bco_clock, 1);
        WDC_WriteAddr32(handle, PTA_CMC, 0x100, temp.to_ulong());
        temp.set(bit_bco_clock, 0);
        WDC_WriteAddr32(handle, PTA_CMC, 0x100, temp.to_ulong());
}

What it should look like (similar to set/reset commands) is the following:

void fssr2::register_default(int in_reg) {
        command c;        c.set(6);
        reg r = register_map[in_reg];
        register_cmd(r, c);
        register_map[in_reg].value = register_map[in_reg].def;

        for (int i = 0; i &lt; prog_interface.size(); i++) {
                WDC_WriteAddr32(handle, PTA_CMC, 0x100, prog_interface[i].to_ulong());
        }

        bitset&lt;16&gt; temp = prog_interface.back();
        temp.set(bit_bco_clock, 1);
        WDC_WriteAddr32(handle, PTA_CMC, 0x100, temp.to_ulong());
        temp.set(bit_bco_clock, 0);
        WDC_WriteAddr32(handle, PTA_CMC, 0x100, temp.to_ulong());
        temp.set(bit_shift_control, 0);
        WDC_WriteAddr32(handle, PTA_CMC, 0x100, temp.to_ulong());
}

Basically there should be an extra BCO cycle before shift_control goes low, not after.

We were talking with Jim to figure out how to get the internal pulser to do more than a single pulse, which is what the default command does.

So, for register 2: set = a single pulse out, default = 255 pulses, reset = stop the pulser.

Here's what the pulser line after switching to the corrected default command sent to register 2 looks like.

<a class="moz-txt-link-freetext" href="http://www.jlab.org/~beng/SVT/images/internal_pulser_255.png">http://www.jlab.org/~beng/SVT/images/internal_pulser_255.png</a>

Let me know if you have any questions and feel free to forward this to anyone else that might need to change the code.
_______________________________________________
Hbi-internal mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Hbi-internal@jlab.org">Hbi-internal@jlab.org</a>
<a class="moz-txt-link-freetext" href="https://mailman.jlab.org/mailman/listinfo/hbi-internal">https://mailman.jlab.org/mailman/listinfo/hbi-internal</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>