Aaron Gage - 2016-02-16

This depends entirely on the spectrometer and the version of the FPGA firmware.

All of what follows is from memory, so I may amend this once I can confirm a few things.

In older devices (including the HR4000 and older versions of the USB2000+/USB4000 firmware) the continuous strobe clock was derived from a 48MHz master clock and divided down by two cascading 16-bit registers. The registers were implemented such that a value of N would divide by (N+1) which had the beneficial side effect of preventing division by zero.

This approach had some serious limitations. For example, many clock rates could be reached with several different combinations of these two registers, and conversely, there were many clock rates that could not be reached at all. It was not an efficient use of the available 32 bits. In general, they would be used by setting one register as a prescaler, effectively changing the resolution of the divided clock into units of e.g. 1ms or some other useful interval, and then using the other register to create multiples of that.

When the USB2000+ and USB4000 FPGA firmware version 3.x was created, the continuous strobe registers were changed from two cascading 16-bit registers to a single contiguous 32-bit register. This provides far better control over the actual behavior of the clock.

Unfortunately, that generation of spectrometers required the driver to have intimate knowledge of its inner workings to be able to get details like this right, and it is likely that SeaBreeze hasn't captured all of this nuance yet.

The proper solution is not to change ContinuousStrobeFeature_FPGA from one conversion to another, because all this will do is break one set of devices in favor of another. The proper solution is to create two parallel implementations, one for 16-bit cascading registers and another for 32-bit contiguous counters. For many devices, the correct ContinuousStrobeFeature implementation can be assigned statically. For others, it will be necessary to query the FPGA version in the Device::initialize() method and assign the correct implementation at runtime.