1 |
1 |
'''[wiki:GraspSwControllerCmd clvset]''' |
2 |
2 |
[[TracNav(GraspContents)]] |
3 |
3 |
||Command:||'''clvset'''|| |
4 |
4 |
||Contexts:||Network socket, serial console, stage2 only|| |
5 |
5 |
||Function:||Set up clocking parameters and ADC configuration for next readout|| |
6 |
6 |
||Required Parameters:||none.|| |
7 |
7 |
||Optional Parameters:|| || |
8 |
8 |
||'''dev='''||[current] Select dev '''0''' '''1''' or '''all'''|| |
9 |
9 |
||'''pg3='''||8 sets of four hex digits to configure serial (row/horizontal) clocking|| |
10 |
10 |
||'''pg4='''||8 sets of four hex digits to configure serial RESET, SUMMING WELL, (CCDs), VCLAMP, and ADCTRIG|| |
11 |
11 |
||'''ppg4='''||8 sets of four hex digits to configure parallel (vertical) clocking|| |
12 |
12 |
||'''adc='''||1 set of four hex digits plus an optional nibble to configure ADC operation|| |
13 |
15 |
||'''trig='''||Number of NOPs (10 nsec delay steps) to insert after each crosstrigger sync|| |
14 |
16 |
||'''pipeline='''||Number of pipeline pixels resulting from clocking pattern (usually 1)|| |
15 |
17 |
||'''prescan='''||Number of device serial prescan pixels to skip (clocked, but not sampled)|| |
16 |
18 |
||'''prebias='''||Extra overscan pixels to be read '''after''' xtrig (usually 0)|| |
17 |
19 |
=== Example === |
18 |
20 |
The following is a complete command to configure a typical "4+1" CCD clocking pattern on both clocking engines. It takes 4 samples of the pedestal level, plus 1 skipped for pipeline purposes, and then 4 samples of the video level, plus 1 skipped for pipeline purposes. |
19 |
21 |
{{{ |
20 |
22 |
clvset dev=all ppg4=ecbb:cbb2:bb2e:65d8:5d97:38ba:6622:3154 \ |
21 |
23 |
pg3=340e:40e0:1c03:c070:06c1:0417:649b:0136 \ |
22 |
24 |
pg4=1038:8010:0104:00b0:07c2:0000:3732:08a2 \ |
23 |
25 |
}}} |
24 |
26 |
The command must be sent all on one line. |
25 |
27 |
=== Parameter adc= === |
26 |
28 |
The first, four-digit hex part of the adc= parameter is formed by or-ing several values together: |
27 |
29 |
{{{ |
28 |
30 |
I | (C << 8) | (N << 10) |
29 |
31 |
}}} |
30 |
32 |
Where I (the lower 8 bits) specifies extra inter-sample delay time (usually left at 00), C is the number of channels (1 2 or 3) and N is the number of multiple samples to read each time ADCTRIG changes (goes high or low.) |
31 |
33 |
The default behavior of the adc= parameter in single-sampled mode is to read only the "Red" ADC channel. All digits in the adc= parameter are in hex. The option last nibble after the colon allows one to select other ADC channels. It is a bit mask. |
32 |
34 |
||adc=1500||4+1 RED|| |
33 |
35 |
||adc=1500:1||4+1 RED|| |
34 |
36 |
||adc=1500:2||4+1 GREEN|| |
35 |
37 |
||adc=1500:4||4+1 BLUE|| |
36 |
38 |
For two-channel mode, the following combinations are valid: |
37 |
39 |
||adc=1600||4+1 RED,GREEN|| |
38 |
40 |
||adc=1600:3||4+1 RED,GREEN|| |
39 |
41 |
||adc=1600:5||4+1 RED,BLUE|| |
40 |
42 |
||adc=1600:6||4+1 GREEN,BLUE|| |
41 |
43 |
For three-channel mode, the mask is ignored and all three (RED, GREEN, BLUE) channels are active. |
42 |
44 |
||adc=1700||4+1 RED,GREEN,BLUE|| |
|
45 |
|
|
46 |
=== Parameter math= === |
|
47 |
|
|
48 |
This is a string parameter, where each character of the string corresponds to one of the following operation codes: |
|
49 |
|
|
50 |
||'''0'''||(zero)Skip sample|| |
|
51 |
||'''1'''||Add sample to accumulator 1|| |
|
52 |
||'''2'''||Add sample to accumulator 2|| |
|
53 |
||'''3'''||Subtract sample from accumulator 1|| |
|
54 |
||'''4'''||Subtract sample from accumulator 2|| |
|
55 |
||'''A'''||Move accumulator 1 '''result''' to OCM and clear|| |
|
56 |
||'''B'''||Move accumulator 2 '''result''' to OCM and clear|| |
|
57 |
||'''C'''||Move sample directly to OCM (same memory as ACC1, typ. red channels)|| |
|
58 |
||'''D'''||Move sample directly to OCM (same memory as ACC2, typ. green channels)|| |
|
59 |
|
|
60 |
The '''result''' of the accumulator that is moved into OCM is a 16 bit value obtained from the sum in the accumulator, plus an '''offset''' and divided by a '''divisor'''. The offset and divisor are automatically determined by the controller and cannot currently be set by the user. The '''divisor''' will be the number of '''Add''' operations in the specified math= pattern (i.e., a count of the '''1''' characters in the string). |
|
61 |
|
|
62 |
The length of the string must match the number of samples requested in ADC= (per ADCTRIG), times TWO because there are two ADCTRIG events per pixel, times 1,2,or 3 depending on whether a single channel (e.g. "Red") or a set of channels (e.g. "Red+Green") is selected. The start of the pattern should match the "cestlavie" tool display. The controller rotates the pattern to the left by 3 positions to compensate for ADC pipeline delays that are intrinsic in the A/D part. Do not rotate the pattern string supplied to the controller. |
|
63 |
|
|
64 |
Example for typical red-channel only, "4+1" sampling: |
|
65 |
|
|
66 |
{{{ |
|
67 |
clvset adc=1500:1 math=333301111A mathcal=1111A1111A |
|
68 |
}}} |
|
69 |
|
|
70 |
=== Parameter mathcal= === |
|
71 |
|
|
72 |
If '''math=''' produces a result in OCM that includes both a 16-bit pedestal and a 16-bit video sample, then '''mathcal=''' is not needed. In cases where it only produces a single 16-bit value in OCM (i.e., the math sequence performs pedestal subtraction) then the pattern is not suitable for '''readcal'''. A separate pattern that is suitable can be provided with mathcal= which will only be used for the [wiki:GraspSwControllerCmdReadcal readcal] command. |