Hi Keith,
-
Do you utilize the
prescale
mcs functionality with your boxes?
Yes, we do.
Typically that is used for dividing stepper motor pulses by N for on-the-fly scanning.
-
If so, is ch0 the
prescale counter if it’s the only available counter output?
No, we use CH7 output for the prescale. I misspoke earlier, we do bring out CH7 Out to the BNCs on our box. That is the only counter output we bring out. The CH0 output is hardwired
to CH1-7 Gates inside the box. For MCS prescaling CH7 Out is connected to clock in (CLKI).
-
I noticed that the counter output waveform differs in that with
the measComp driver the counter output waveform is a square pulse of a defined count time whereas with spec, there is usually a 150us initialization pulse that precedes the counter output timing pulse.
I looked at CH7 Out on a scope when I counted for 1 second using the normal CH0 clock. I observe something interesting.
- If there are no pulses going to CH7 In then I observe a 200 ns negative pulse output when counting is started, but the signal is otherwise high.
- If there are pulses going to CH7 In then I observe a positive pulse on CH7 Out when counting starts, and the signal is otherwise low. The width of that positive pulse is not completely reproducible, and
is a function of the pulse rate on CH7 In.
Ch7 In rate |
Ch7 Out pulse width |
100 Hz |
20-30 ms |
500 Hz |
4-6 ms |
1000 Hz |
2-3 ms |
2000 Hz |
1-1.5 ms |
It looks like the CH7 Out pulse width is 2-3 times the period of the CH7 In signal. I never see it be high for the entire 1 second time that the scaler is counting. This behavior is the same if I made CH7 a preset and have it stop the scaler sooner than CH0
does.
We are not yet using the USB-CTR08 for real data collection. But we will be when the APS-U comes up next year. I have removed all of the SIS3801 and SIS3820 VME scalers we previously used. I just noticed a problem we will need to address. We have used the
LNE pulse output of the SIS3820 to trigger detectors like the Point Grey, Eiger, Pilatus, etc when doing on-the-fly scanning. In principle the clock output (CLK0) of the USB-CTR08 is a similar signal. However, CLK0 is always a 20 ns wide negative pulse,
while the LNE on the SIS3820 had programmable width and polarity. We used this to match the triggering requirements of detectors. We will need another solution for that with the USB-CTR08.
Mark
From: Keith Surrena <ks2339 at cornell.edu>
Sent: Thursday, August 24, 2023 12:37 PM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov
Subject: RE: USBCTR08 ch0 scaler counts missing
Ha it may be a bit of a niche scenario that I don’t think we even have in use at any of the beamlines. I guess it would be if a user wanted to count to monitor on one of said channels and synchronize some piece of hardware that accepted an external
enable, on/off style without a set time parameter. My easiest method would be to tie in off whichever counter output channel was the monitor. I have all of my counter outputs going through a multi bit OR gate to simplify cabling.
Do you utilize the prescale mcs functionality with your boxes? If so, is ch0 the prescale counter if it’s the only available counter output?
Hi Keith,
-
Could you confirm another behavior for me? If I’m using the preset counters on ch 1-7 with the idle state low, the counter output waveform goes high and then stays high even when the count completes.
I will try to confirm that. It may take a while, because the enclosures we have built for the USB-CTR08 do not provide connectors for the counter outputs on channels 1-7. I am curious what you will be using those signals for?
Mark
Thanks, Mark. I overlooked that my patch panel has all of the gates connected at a singular BNC node. Removing CG0 makes it function as expected now. I suspect you’re right that SPEC configures the
USBCTR08 differently and allows for a different schematic. I noticed that the counter output waveform differs in that with the measComp driver the counter output waveform is a square pulse of a defined count time whereas with spec, there is usually a 150us
initialization pulse that precedes the counter output timing pulse.
Could you confirm another behavior for me? If I’m using the preset counters on ch 1-7 with the idle state low, the counter output waveform goes high and then stays high even when the count completes.
If I initiate another count sequence, it will dip low at the start, go high for the duration of the count, and then stay high until I once again doing another count. Is this typical or perhaps another incompatibility of my patch panel?
Keith Surrena
CHESS
Hi Keith,
-
I have TMR0 set at 1 MHz connected to my counter 0 input and my counter 0 output connected to the gate.
When you say “connected to the gate” what do you mean? The EPICS driver assumes that the counter 0 output is connected to the gate of all channels except channel 0, i.e. channels 1-7. That is documented here:
https://epics-modules.github.io/measComp/measCompUSBCTRDoc.html#scaler-record-support
-
I can complete a count sequence by using the preset counters on counters 1-7 connected to TMR0 but not c0.
When you do preset counts on counters 1-7 that is done in software, not in hardware. The driver reads a stream of count values from the scalers and stops when any counter exceeds its present. So it will always count a little bit more than
the present counts.
Because counter 0 is used in preset mode, and is connected to the gate of all other counters it will count for exactly the requested number of counts and all other channels will stop at exactly the same time.
I just configured my USBCTR-08 as follows:
-
TMR0 set at 1e6 Hz and connected to CTR0.
-
TMR1 set at 1e5 Hz and connected to CTR1.
-
TMR2 set at 1e4 Hz and connected to CTR2.
-
TMR3 set at 1e3 Hz and connected to CTR3.
I set the scaler.TP field to 1.0 second and the scaler.FREQ field to 1e6 Hz. The scaler.G1 field is 1 so it is a preset. .G2-.G8 are 0 so they are not presets.
When I start the scaler record and let it finish counting I see the screen in the attached file.
Note that channels 1-4 have exactly the expected counts: 1000000, 100000, 10000, 1000.
I am not sure if SPEC and the measComp driver program the UCBCTR-08 in exactly the same way, and if SPEC expects the module to be wired the same way.
Mark
I’m having an issue where counter 0 of my USBCTR08 is not registering counts when I attempt to do a basic scaler count sequence with the MEDM (count time 1s, count preset 1000000). I have TMR0 set at 1 MHz connected to my counter 0 input and
my counter 0 output connected to the gate. I can complete a count sequence by using the preset counters on counters 1-7 connected to TMR0 but not c0. I’ve verified my TMR0 signal with an oscope, the numbers and timing on the other preset counters makes sense,
and this same hardware setup works at our beamlines that use the USBCTR with SPEC, so I’m fairly confident in the hardware and signal patching. Version info: scaler 4.0, measComp R4.1, and epics 7.0.7.
Keith Surrena
CHESS
|