<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://e-mode.phas.ubc.ca/mcewiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dvw</id>
	<title>MCEWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://e-mode.phas.ubc.ca/mcewiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dvw"/>
	<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php/Special:Contributions/Dvw"/>
	<updated>2026-05-25T02:33:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Vicor_Power_Assembly&amp;diff=11098</id>
		<title>Vicor Power Assembly</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Vicor_Power_Assembly&amp;diff=11098"/>
		<updated>2026-05-22T00:13:58Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|Power}}&lt;br /&gt;
The MCE can be equipped with a 24V DC-in or 48V DC-in switching supply designed for use in balloon-based experiments. This unit contains a set of Vicor DC-DC converters that are trimmed to accommodate losses from cables of up to 2-metres, so they can be located up to 2-m away from the actual MCE [[subrack]].&lt;br /&gt;
== Specification==&lt;br /&gt;
&lt;br /&gt;
;DC input&lt;br /&gt;
: Either:&lt;br /&gt;
:* 24V (18-36V) - Rev. C, Issues 1, 2, 5, 6&lt;br /&gt;
:* 48V (36-60V) - Rev. C, Issues 3, 4, 7&lt;br /&gt;
: 3A at 24V to power one 3-MDM MCE48 crate (6A for two)&lt;br /&gt;
&lt;br /&gt;
;DC output&lt;br /&gt;
:    V&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;+&amp;lt;/sup&amp;gt;: 6.1 to 6.3 V&lt;br /&gt;
:    V&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;&amp;lt;sup&amp;gt;&amp;amp;minus;&amp;lt;/sup&amp;gt;: -6.1 to -6.3 V&lt;br /&gt;
:    V&amp;lt;sub&amp;gt;lvd&amp;lt;/sub&amp;gt;: 4.4 to 4.7 V&lt;br /&gt;
:    V&amp;lt;sub&amp;gt;core&amp;lt;/sub&amp;gt;: 2.9 to 3.2 V&lt;br /&gt;
* ''Note:'' The VPA does not provide the obsolete V&amp;lt;sub&amp;gt;ah&amp;lt;/sub&amp;gt; used by rev.A and B [[Readout card]]s and rev.A through D [[Bias card]]s&lt;br /&gt;
&lt;br /&gt;
; Power:	100W&lt;br /&gt;
&lt;br /&gt;
; Regulated:	Yes&lt;br /&gt;
&lt;br /&gt;
; Efficiency:	75%&lt;br /&gt;
; Dimensions (L x W x H):	&lt;br /&gt;
: 24cm x 20cm x 5cm&lt;br /&gt;
; Weight:	&lt;br /&gt;
: &amp;lt; 2kg and a 1-m power cable is ~1kg&lt;br /&gt;
&lt;br /&gt;
== Connectors ==&lt;br /&gt;
; Input:&lt;br /&gt;
* '''Writing harness''': [http://www.phas.ubc.ca/~scuba2/sc2mce/system/power_supply_of_all_kinds/psu_Vicor/design/protel/vpa-c585-401d/ELE-S585-401C3_Schematics.PDF PDF]&lt;br /&gt;
* '''Connector''': Amphenol PTC-2A-14-5P&lt;br /&gt;
[[File:24-48Vin.png|400px]]&lt;br /&gt;
; Output:&lt;br /&gt;
* '''Wiring harness''': [http://www.phas.ubc.ca/~mce/mcedocs/hardware/schematics/PowerSupplyVicor/ELE-C584-402_RevA_Wiring_Harness.pdf PDF]&lt;br /&gt;
* '''Connector''': Winchester MRA34SG.  '''[[MCE Power#Connector &amp;amp; pinout|Pinout]]'''&lt;br /&gt;
* ''Note:'' The VPA can power one 72-HP subrack, or two 48-HP subracks.  Early revisions of the VPA had two output connectors.  Currently, all VPAs have only one Winchester connector for power output, and a wye cable is used when powering pairs of 48-HP subracks.&lt;br /&gt;
== Schematics == &lt;br /&gt;
* Vicor Power Supply Rev C2, PCB Schematics [https://phas.ubc.ca/~mce/mcedocs/hardware/schematics/PowerSupplyVicor/ELE_C585-401_RevC2_VicorPSU_Schematics.pdf]&lt;br /&gt;
* Vicor Power Supply Rev C3, PCB Schematics [https://phas.ubc.ca/~mce/mcedocs/hardware/schematics/PowerSupplyVicor/ELE_C585-401_RevC3_VicorPSU_Schematics.pdf]&lt;br /&gt;
* Wiring [https://phas.ubc.ca/~mce/mcedocs/hardware/schematics/PowerSupplyVicor/ELE-C584-402_RevA_Wiring_Harness.pdf]&lt;br /&gt;
== Mechanical Drawings ==&lt;br /&gt;
* Assembled Box: [http://www.phas.ubc.ca/~scuba2/sc2mce/system/power_supply_of_all_kinds/psu_Vicor/design/mech/Aluminum_Box/MEC-C585-416D_Enclosure.PDF MEC-C585-416D]&lt;br /&gt;
* Box Lid: [http://www.phas.ubc.ca/~scuba2/sc2mce/system/power_supply_of_all_kinds/psu_Vicor/design/mech/Aluminum_Box/MEC-C585-405D_Enclosure_Lid.PDF MEC-C585-405D]&lt;br /&gt;
* Unfolded Box: [http://www.phas.ubc.ca/~scuba2/sc2mce/system/power_supply_of_all_kinds/psu_Vicor/design/mech/Aluminum_Box/MEC-C585-404D_Enclosure_Box_Unfolded.PDF MEC-C585-404D]&lt;br /&gt;
* Mounting Flange: [http://www.phas.ubc.ca/~scuba2/sc2mce/system/power_supply_of_all_kinds/psu_Vicor/design/mech/Aluminum_Box/MEC-C585-406B_Enclosure_Flange.PDF MEC-C585-406B]&lt;br /&gt;
&lt;br /&gt;
== Cooling ==&lt;br /&gt;
For Spider, the mounting/heat extraction block is bolted to a heat exchanger through which the &amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;He blow-off from the cryostat's vapour-cooled shield is vented.&lt;br /&gt;
&lt;br /&gt;
== Photos ==&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Vicor supply 1.jpg|Vicor supply attached to a subrack&lt;br /&gt;
File:Vicor supply 2.jpg|Vicor supply top face with heat pipes&lt;br /&gt;
File:Vicor supply 3.jpg|Vicor supply attached to a subrack&lt;br /&gt;
File:Vicor in spider flingle 1.jpg|3 vicor supplies in Spider mounting bracket, connector side&lt;br /&gt;
File:Vicor in spider flingle 2.jpg|3 vicor supplies in Spider mounting bracket, mounting/cooling side&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
* [[Testing VPA]]&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
* back to [[MCE_Power]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Accessories]]&lt;br /&gt;
[[Category:Power]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Digital_4-pole_Butterworth_Low-pass_filter&amp;diff=11097</id>
		<title>Digital 4-pole Butterworth Low-pass filter</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Digital_4-pole_Butterworth_Low-pass_filter&amp;diff=11097"/>
		<updated>2026-01-06T06:24:10Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
A digital 4-pole Butterworth low-pass filter is implemented as 2 cascaded biquads (2-pole topology) in the '''[[Readout card firmware]]''' of the MCE. The transfer function of the IIR filter is:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_butterworth.png|900px|alt=H(z) {{=}} \frac {1+2 z^{-1}+z^{-2}}{1+b^*_{11} z^{-1}+b^*_{12} z^{-2}} \cdot 2^{-k_2} \cdot \frac {1+2z^{-1}+z^{-2}}{1+b^*_{21} z^{-1}+b^*_{22} z^{-2}} \cdot {2^{-k_1}}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Filter coefficients [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]], [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]], and truncation factors, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, are hard coded in older firmware (before '''version 5.1.0'''), but with modern firmware, they can be programmed through software:&lt;br /&gt;
&lt;br /&gt;
  wb rca {{param|rc|fltr_coeff}} ''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''b&amp;lt;sub&amp;gt;xy&amp;lt;/sub&amp;gt;'' is a quantized version of [[File:math_bxy_star.png|30px|alt=b^*_{xy}]] computed as: [[File:Math_bxy_eq.png|150px|alt=b_{xy} {{=}} \left\lfloor\left{{bar}}b^*_{xy}\right{{bar}} \times 2^{14}\right\rfloor]], where ⌊•⌋ indicates the floor function. Note that in order to accommodate the quantization effects, you have to follow the recipe prescribed in the [[#Filter Coefficients|Filter Coefficients section]] below when specifying the coefficients and truncation factors.&lt;br /&gt;
&lt;br /&gt;
There are 3 filter-related MCE parameters/commands:&lt;br /&gt;
* {{param|rc|fltr_type}}: to determine whether filter coefficients are hard-coded or configurable&lt;br /&gt;
* {{param|rc|fltr_coeff}}: to specify filter coefficients&lt;br /&gt;
* {{param|rc|fltr_rst}}: to reset the filter pipeline after changing coefficients&lt;br /&gt;
&lt;br /&gt;
== Filter Specification ==&lt;br /&gt;
Filter specification of the 4-pole Butterworth filter is determined by the filter coefficients [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]], [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]], described earlier.&lt;br /&gt;
&lt;br /&gt;
Assume: &lt;br /&gt;
&lt;br /&gt;
* '''''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;''' is the frequency at which the signal after filtering is √2 of its maximum value (nominally the read-out rate Nyquist frequency), and   &lt;br /&gt;
* '''''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt;''' is the sampling frequency, calculated as &amp;lt;code&amp;gt;(50&amp;amp;nbsp;Mhz) / (num_rows &amp;amp;times; row_len)&amp;lt;/code&amp;gt;. For example: &amp;lt;code&amp;gt;50&amp;amp;nbsp;MHz / (33 &amp;amp;times; 100) = 15151.5&amp;amp;nbsp;Hz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''Note that the filter ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; scales if ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; changes.''&lt;br /&gt;
&lt;br /&gt;
; Type 1 (hard-coded coefficients)&lt;br /&gt;
: ''supported in all rc '''except''' 5.0.7''&lt;br /&gt;
: DC amplification = 1217.9148 &lt;br /&gt;
: ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15151&amp;amp;nbsp;Hz&lt;br /&gt;
: Gain @ 200&amp;amp;nbsp;Hz = 0.14189148 (wrt the DC gain) &lt;br /&gt;
&lt;br /&gt;
; Type 2 (hard-coded coefficients)&lt;br /&gt;
: ''supported '''only''' in rc version 5.0.7''&lt;br /&gt;
: DC amplification = 2044&lt;br /&gt;
: ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30000&amp;amp;nbsp;Hz&lt;br /&gt;
: A plot of the transfer function generated by simulating MCE firmware (VHDL) &lt;br /&gt;
[[File:mce_filter_type2_magnitude.png |150px]][[File:mce_filter_type2_phase.png|150px]]&lt;br /&gt;
&lt;br /&gt;
; Type 255 (configurable coefficients)&lt;br /&gt;
: ''supported in rc 5.1.0+''&lt;br /&gt;
: Quantized filter coefficients ''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; and truncation factors, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are parameterized and programmable by software. &lt;br /&gt;
&lt;br /&gt;
The fitler type can be determined by reading back the MCE parameter called {{param|rc|fltr_type}}. (supported in firmware 5.0.a+)&lt;br /&gt;
&lt;br /&gt;
The following plot shows the magnitude and the phase of Type 1 filter.&lt;br /&gt;
&lt;br /&gt;
Here is Elia's original plot [[Media:BW_filter.ps]]. Then we see the same plot with the impulse-response also added (by Joe, Nov 29, 2007): &lt;br /&gt;
[[Image: BW_filter2.png]]&lt;br /&gt;
&lt;br /&gt;
Here is the filter response for Scuba2 setting (''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 9.5&amp;amp;nbsp;kHz, ''f''&amp;lt;sub&amp;gt;readout&amp;lt;/sub&amp;gt; = 200&amp;amp;nbsp;Hz): [[Media: Filter fs10kHz 200Hzdecimated response.ps ]]&lt;br /&gt;
&lt;br /&gt;
== Filter-related Software changes ==&lt;br /&gt;
&lt;br /&gt;
=== Determining the filter type ===&lt;br /&gt;
&lt;br /&gt;
A {{param|rc|fltr_type}} parameter is introduced starting firmware 5.0.a:&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 1''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15151&amp;amp;nbsp;Hz&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 2''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30000&amp;amp;nbsp;Hz&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 255''': configurable coefficient&lt;br /&gt;
&lt;br /&gt;
All earlier firmware revisions are set to filter type 1 by default, except version 5.0.7 which is set to filter type 2.&lt;br /&gt;
&lt;br /&gt;
=== Software requirements ===&lt;br /&gt;
&lt;br /&gt;
* MAS - use mas/trunk r493 or later to get access to the {{param|rc|fltr_coeff}} MCE parameter.&lt;br /&gt;
** In [[mce.cin]], specify &amp;lt;code&amp;gt;$fw_rev[&amp;quot;rc&amp;quot;] = 0x5010000&amp;lt;/code&amp;gt; or greater.&lt;br /&gt;
* mce_script - use mce_script/trunk r764 or later&lt;br /&gt;
* In [[Mce config template system#experiment.cfg | experiment.cfg]]:&lt;br /&gt;
**specify one of:&lt;br /&gt;
  config_filter = 0;  #  do not write filter coefficients to the MCE&lt;br /&gt;
  config_filter = 1;  #  write filter coefficients to the MCE&lt;br /&gt;
and when config_filter = 1, the filter coefficients to be written to the MCE must be specified in the &amp;quot;filter_params&amp;quot; parameter, in the order [''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;],  e.g.:&lt;br /&gt;
  filter_params = [ 32092, 15750, 31238, 14895, 0, 11];  # type 1 filter, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15.151&amp;amp;nbsp;kHz&lt;br /&gt;
  filter_params = [ 32295, 15915, 32568, 16188, 3, 14];  # type 2 filter, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30&amp;amp;nbsp;kHz&lt;br /&gt;
  filter_params = [ 32295, 15915, 32568, 16188, 5, 12];  # type 2 filter with more inter-biquad dynamic range (recommended)&lt;br /&gt;
  filter_params = [ 32297, 15934, 31683, 15320, 0, 11];  # SCUBA-2 filter after 2011-06, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 12.97&amp;amp;nbsp;kHz&lt;br /&gt;
&lt;br /&gt;
== Code for simulations ==&lt;br /&gt;
&lt;br /&gt;
Note that as of mce_script r902, '''mce_data.py''' contains code for handling the MCE Butterworth filters.  This can be used to load filter parameters from a runfile, and to get the complex frequency response of a filter.  See [[mce_data.py#MCEButterworth_class]].&lt;br /&gt;
&lt;br /&gt;
A smaller, quicker python example:&lt;br /&gt;
[[ Media: mce_filt_py.txt ]]&lt;br /&gt;
&lt;br /&gt;
In this little IDL program you can find the functional form as a function of the frequency of the filter. First, Elia's original program, then as modified by Joe on November 29, 2007, then modified by Mandana on Jan. 14, 2009 for Scuba2 numbers:&lt;br /&gt;
* [[ Media: filter_pro.txt ]] &lt;br /&gt;
* [[ Media: filter_pro2.txt ]]&lt;br /&gt;
* [[ Media: low_pass_filter_model_pro.txt ]]&lt;br /&gt;
&lt;br /&gt;
=== Digital, time domain simulation codes ===&lt;br /&gt;
&lt;br /&gt;
Python-based model of a single biquad, in the time domain, for exploring digitization and dynamic range:&lt;br /&gt;
* [[ Media: biquad_time_domain_py.txt ]]&lt;br /&gt;
&lt;br /&gt;
== Filter Coefficients  ==&lt;br /&gt;
=== Butterworth Coefficients ===&lt;br /&gt;
The filter coefficients are generated using ''fdatool'' (Filter-design &amp;amp; Analysis tool, part of DSP Toolbox) in '''MATLAB/Simulink'''. These coefficients are floating numbers and in order to feed them to MCE firmware, they need to be quantized by converting to signed binary fractional (SBF) 1.14 format. You may use [[#Alternative to fdatool|alternate methods]] to generate coefficients. Here, we explain the method using ''fdatool''.&lt;br /&gt;
&lt;br /&gt;
Once you launch the ''fdatool'', choose the following settings:&lt;br /&gt;
&lt;br /&gt;
* Response Type: Low Pass&lt;br /&gt;
* Design Method: Butterworth&lt;br /&gt;
* Filter Order: 4&lt;br /&gt;
&lt;br /&gt;
* Frequency Specifications: &lt;br /&gt;
** For Type 1:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 12,195&amp;amp;nbsp;Hz = 50&amp;amp;nbsp;MHz/ (100 &amp;amp;times; 41)&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; = 100&amp;amp;nbsp;Hz&lt;br /&gt;
** For Type 2:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 30,000&amp;amp;nbsp;Hz ≈ 50&amp;amp;nbsp;MHz / (50 &amp;amp;times; 33)&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz&lt;br /&gt;
** For Type 255:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 50&amp;amp;nbsp;MHz / ({{param|sys|row_len}} &amp;amp;times; {{param|sys|num_rows}})&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;=''f''&amp;lt;sub&amp;gt;readout&amp;lt;/sub&amp;gt; / 2 (= ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; / {{param|cc|data_rate}} / 2, if using internal CC triggering)&lt;br /&gt;
* The attenuation at ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; is fixed at 3&amp;amp;nbsp;dB (half the passband power)&lt;br /&gt;
&lt;br /&gt;
Then click on Design Filter and you will get the following coefficients:&lt;br /&gt;
; Type 1 &lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9587428340882587  0.96134553442399129 &lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.00065067508393319923 (not implemented)&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9066292518523014  0.90916270571237567&lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;= 0.00063336346501859835  (not implemented)&lt;br /&gt;
&lt;br /&gt;
; Type 2 &lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9711486088510415  0.97139181456687917&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9878047097960421  0.98804997058724808 &lt;br /&gt;
:Gain = 1/(''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;amp;times; ''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)= 0.0000000037280516432624239  (not implemented)&lt;br /&gt;
&lt;br /&gt;
; Type 255&lt;br /&gt;
: Plug in your desired ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; and ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; in MATLAB fdatool and you will get a set of coefficients:&lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]]&lt;br /&gt;
:: Gain = 1/''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1 [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]]&lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Coefficient Quantization ===&lt;br /&gt;
The quantization format is signed-binary fractional (SBF) 1.14 and then 2's complement to be able to account for positive and negative values.&lt;br /&gt;
* Compute the quantised coefficients ''b&amp;lt;sub&amp;gt;xy&amp;lt;/sub&amp;gt;'' via: [[File:Math_bxy_eq.png|150px|alt=b_{xy} {{=}} \left\lfloor\left{{bar}}b^*_{xy}\right{{bar}} \times 2^{14}\right\rfloor]] (i.e. take the absolute value, multiply by 2&amp;lt;sup&amp;gt;14&amp;lt;/sup&amp;gt; and then drop the fractional part).&lt;br /&gt;
* [[File:Math_k1_eq.png|170px|alt=k_1 {{=}} \left\lfloor \log_2 g_2 \right\rfloor - 10]], the output-truncation (10 is a historical constant)&lt;br /&gt;
* [[File:Math_k2_eq.png|160px|alt=k_2 = 1 + \left\lfloor \log_2 g_1 \right\rfloor]], the inter-stage truncation&lt;br /&gt;
&lt;br /&gt;
For example, if we use this formula to quantize Type 1 coefficients listed above:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_coeff_calc.png|800px|alt=\begin{align}&lt;br /&gt;
   b_{11} &amp;amp;{{=}} \lfloor 1.9587428340882587 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 32092\\&lt;br /&gt;
   b_{12} &amp;amp;{{=}} \lfloor 0.96134553442399129 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 15750\\&lt;br /&gt;
   b_{21} &amp;amp;{{=}} \lfloor 1.9066292518523014 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 31238\\&lt;br /&gt;
   b_{22} &amp;amp;{{=}} \lfloor 0.90916270571237567 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 14895\\&lt;br /&gt;
   k_1 &amp;amp;{{=}} \left\lfloor \log_2 \left(1 / 0.00065067508393319923 \right)\right\rfloor - 10 &amp;amp;{{=}}&amp;amp;\ 0\\&lt;br /&gt;
   k_2 &amp;amp;{{=}} 1 + \left\lfloor \log_2 \left(1 / 0.00063336346501859835 \right)\right\rfloor &amp;amp;{{=}}&amp;amp;\ 11&lt;br /&gt;
\end{align}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;amp;lt; 16 and ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;lt; 32&lt;br /&gt;
* Now, if 32 &amp;amp;minus; ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;gt; 32, then you have to talk to UBC!&lt;br /&gt;
&lt;br /&gt;
:'''''The following ONLY concerns the MCE firmware developers:'''&lt;br /&gt;
&lt;br /&gt;
:Prior to firmware 5.1.0, the coefficients were hardcoded in  '''fsfb_calc_pack.vhd''' (FILTER_B11_COEF, FILTER_B12_COEF, FILTER_B21_COEFF, FILTER_B22_COEFF, FILTER_GAIN_WIDTH, FILTER_SCALE_LSB).''&lt;br /&gt;
&lt;br /&gt;
=== Calculating the DC Gain (''k'') ===&lt;br /&gt;
Note that in firmware, instead of ''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and ''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, an inter-biquad truncation of ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; (implemented as a binary shift) and ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, number of bits dropped after the second biquad, are implemented.&lt;br /&gt;
&lt;br /&gt;
Hence, the overall gain becomes [[File:Math_gain_eq.png|60px|alt=\frac {g_1 g_2}  {2^{(k_1 + k_2)}}]].&lt;br /&gt;
&lt;br /&gt;
:''(Note for firmware developers: see FILTER_GAIN_WIDTH and FILTER_SCALE_LSB in '''fsfb_calc_pack.vhd'''.) ''&lt;br /&gt;
&lt;br /&gt;
; Type 1&lt;br /&gt;
:''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 11, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0, the filter gain is estimated at 1184, but VHDL simulation results in a gain of 1216. &lt;br /&gt;
; Type 2&lt;br /&gt;
:''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 14, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 3, the filter gain is estimated at 2046, but VHDL simulation results in a gain of 2181. &lt;br /&gt;
&lt;br /&gt;
The gain difference can be attributed to the rounding effects associated with fixed-width arithmetic.&lt;br /&gt;
&lt;br /&gt;
To roughly compute the gain, including the effects from truncating the coefficients, reverse the quantization process to obtain the floating point values associated with your coefficients, and plug into the filter definition.  Here is a rough python program which computes the true gain for our Type 1 filter (''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt; = 32092, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt; = 15750, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt; = 31238, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; = 14895, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 11):&lt;br /&gt;
 from numpy import *&lt;br /&gt;
 # Sum of k1 and k2 shifts:&lt;br /&gt;
 k12 = 11+0&lt;br /&gt;
 # Quantized coefficients b11, b12, b21, b22:&lt;br /&gt;
 n = array([32092, 15750, 31238, 14895]).astype('float')&lt;br /&gt;
 # Re-float&lt;br /&gt;
 f = n/2**14&lt;br /&gt;
 # Compute gain&lt;br /&gt;
 gain = 16. / (2**k12 * (1 - f[0] + f[1]) * (1 - f[2] + f[3]))&lt;br /&gt;
 print gain&lt;br /&gt;
 # Result: 1217.8583043&lt;br /&gt;
&lt;br /&gt;
== Useful Links  ==&lt;br /&gt;
http://www.phas.ubc.ca/~mce/mcedocs/hardware/Firmware_block_spec/reaout_card/fsfb_calculations_rev1.11.pdf&lt;br /&gt;
&lt;br /&gt;
http://www.planetanalog.com/showArticle.jhtml?articleID=12802683&lt;br /&gt;
&lt;br /&gt;
== Alternative to fdatool ==&lt;br /&gt;
If you do not have access to fdatool or do not have DSP toolbox installed, you can use the following MATLAB functions (or equivalent in other packages) to get the coefficients:&lt;br /&gt;
* butter: is a matlab function to generate butterworth coefficients&lt;br /&gt;
* sos2tf: matlab function to break a transfer function to second-order sections&lt;br /&gt;
* bilinear: converts an s-domain (continuous) transfer function to z-domain (discrete) transfer function.&lt;br /&gt;
* Then run the following in matlab (or whatever syntax your tool has):&lt;br /&gt;
   num=[1 2 1]&lt;br /&gt;
   denum=[1 -1.9711486088510415  0.97139181456687917]&lt;br /&gt;
   max(dbode(num, denum, 1/fsamp) but also look at the bode-plot to make sure it is flat, otherwise read the max from the flat portion of the plot instead of the max function.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' When I used coefficients generated by [a,b] = butter(2, 50/20000); [SOS,G]=tf2sos(a,b), the filter was not as robust. not sure why?!&lt;br /&gt;
&lt;br /&gt;
[[Category:Readout Card Firmware]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Digital_4-pole_Butterworth_Low-pass_filter&amp;diff=11096</id>
		<title>Digital 4-pole Butterworth Low-pass filter</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Digital_4-pole_Butterworth_Low-pass_filter&amp;diff=11096"/>
		<updated>2026-01-05T23:26:16Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
A digital 4-pole Butterworth low-pass filter is implemented as 2 cascaded biquads (2-pole topology) in the '''[[Readout card firmware]]''' of the MCE. The transfer function of the IIR filter is:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_butterworth.png|900px|alt=H(z) {{=}} \frac {1+2 z^{-1}+z^{-2}}{1+b^*_{11} z^{-1}+b^*_{12} z^{-2}} \cdot 2^{-k_2} \cdot \frac {1+2z^{-1}+z^{-2}}{1+b^*_{21} z^{-1}+b^*_{22} z^{-2}} \cdot {2^{-k_1}}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Filter coefficients [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]], [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]], and truncation factors, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, are hard coded in older firmware (before '''version 5.1.0'''), but with modern firmware, they can be programmed through software:&lt;br /&gt;
&lt;br /&gt;
  wb rca {{param|rc|fltr_coeff}} ''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''b&amp;lt;sub&amp;gt;xy&amp;lt;/sub&amp;gt;'' is a quantized version of [[File:math_bxy_star.png|30px|alt=b^*_{xy}]] computed as: [[File:Math_bxy_eq.png|150px|alt=b_{xy} {{=}} \left\lfloor\left{{bar}}b^*_{xy}\right{{bar}} \times 2^{14}\right\rfloor]], where ⌊•⌋ indicates the floor function. Note that in order to accommodate the quantization effects, you have to follow the recipe prescribed in the [[#Filter Coefficients|Filter Coefficients section]] below when specifying the coefficients and truncation factors.&lt;br /&gt;
&lt;br /&gt;
There are 3 filter-related MCE parameters/commands:&lt;br /&gt;
* {{param|rc|fltr_type}}: to determine whether filter coefficients are hard-coded or configurable&lt;br /&gt;
* {{param|rc|fltr_coeff}}: to specify filter coefficients&lt;br /&gt;
* {{param|rc|fltr_rst}}: to reset the filter pipeline after changing coefficients&lt;br /&gt;
&lt;br /&gt;
== Filter Specification ==&lt;br /&gt;
Filter specification of the 4-pole Butterworth filter is determined by the filter coefficients [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]], [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]], described earlier.&lt;br /&gt;
&lt;br /&gt;
Assume: &lt;br /&gt;
&lt;br /&gt;
* '''''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;''' is the frequency at which the signal after filtering is √2 of its maximum value (nominally the read-out rate Nyquist frequency), and   &lt;br /&gt;
* '''''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt;''' is the sampling frequency, calculated as &amp;lt;code&amp;gt;(50&amp;amp;nbsp;Mhz) / (num_rows &amp;amp;times; row_len)&amp;lt;/code&amp;gt;. For example: &amp;lt;code&amp;gt;50&amp;amp;nbsp;MHz / (33 &amp;amp;times; 100) = 15151.5&amp;amp;nbsp;Hz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''Note that the filter ''f''&amp;lt;sub&amp;gt;3dB&amp;lt;/sub&amp;gt; scales if ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; changes.''&lt;br /&gt;
&lt;br /&gt;
; Type 1 (hard-coded coefficients)&lt;br /&gt;
: ''supported in all rc '''except''' 5.0.7''&lt;br /&gt;
: DC amplification = 1217.9148 &lt;br /&gt;
: ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15151&amp;amp;nbsp;Hz&lt;br /&gt;
: Gain @ 200&amp;amp;nbsp;Hz = 0.14189148 (wrt the DC gain) &lt;br /&gt;
&lt;br /&gt;
; Type 2 (hard-coded coefficients)&lt;br /&gt;
: ''supported '''only''' in rc version 5.0.7''&lt;br /&gt;
: DC amplification = 2044&lt;br /&gt;
: ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30000&amp;amp;nbsp;Hz&lt;br /&gt;
: A plot of the transfer function generated by simulating MCE firmware (VHDL) &lt;br /&gt;
[[File:mce_filter_type2_magnitude.png |150px]][[File:mce_filter_type2_phase.png|150px]]&lt;br /&gt;
&lt;br /&gt;
; Type 255 (configurable coefficients)&lt;br /&gt;
: ''supported in rc 5.1.0+''&lt;br /&gt;
: Quantized filter coefficients ''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; and truncation factors, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are parameterized and programmable by software. &lt;br /&gt;
&lt;br /&gt;
The fitler type can be determined by reading back the MCE parameter called {{param|rc|fltr_type}}. (supported in firmware 5.0.a+)&lt;br /&gt;
&lt;br /&gt;
The following plot shows the magnitude and the phase of Type 1 filter.&lt;br /&gt;
&lt;br /&gt;
Here is Elia's original plot [[Media:BW_filter.ps]]. Then we see the same plot with the impulse-response also added (by Joe, Nov 29, 2007): &lt;br /&gt;
[[Image: BW_filter2.png]]&lt;br /&gt;
&lt;br /&gt;
Here is the filter response for Scuba2 setting (''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 9.5&amp;amp;nbsp;kHz, ''f''&amp;lt;sub&amp;gt;readout&amp;lt;/sub&amp;gt; = 200&amp;amp;nbsp;Hz): [[Media: Filter fs10kHz 200Hzdecimated response.ps ]]&lt;br /&gt;
&lt;br /&gt;
== Filter-related Software changes ==&lt;br /&gt;
&lt;br /&gt;
=== Determining the filter type ===&lt;br /&gt;
&lt;br /&gt;
A {{param|rc|fltr_type}} parameter is introduced starting firmware 5.0.a:&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 1''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15151&amp;amp;nbsp;Hz&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 2''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30000&amp;amp;nbsp;Hz&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 255''': configurable coefficient&lt;br /&gt;
&lt;br /&gt;
All earlier firmware revisions are set to filter type 1 by default, except version 5.0.7 which is set to filter type 2.&lt;br /&gt;
&lt;br /&gt;
=== Software requirements ===&lt;br /&gt;
&lt;br /&gt;
* MAS - use mas/trunk r493 or later to get access to the {{param|rc|fltr_coeff}} MCE parameter.&lt;br /&gt;
** In [[mce.cin]], specify &amp;lt;code&amp;gt;$fw_rev[&amp;quot;rc&amp;quot;] = 0x5010000&amp;lt;/code&amp;gt; or greater.&lt;br /&gt;
* mce_script - use mce_script/trunk r764 or later&lt;br /&gt;
* In [[Mce config template system#experiment.cfg | experiment.cfg]]:&lt;br /&gt;
**specify one of:&lt;br /&gt;
  config_filter = 0;  #  do not write filter coefficients to the MCE&lt;br /&gt;
  config_filter = 1;  #  write filter coefficients to the MCE&lt;br /&gt;
and when config_filter = 1, the filter coefficients to be written to the MCE must be specified in the &amp;quot;filter_params&amp;quot; parameter, in the order [''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;],  e.g.:&lt;br /&gt;
  filter_params = [ 32092, 15750, 31238, 14895, 0, 11];  # type 1 filter, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15.151&amp;amp;nbsp;kHz&lt;br /&gt;
  filter_params = [ 32295, 15915, 32568, 16188, 3, 14];  # type 2 filter, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30&amp;amp;nbsp;kHz&lt;br /&gt;
  filter_params = [ 32295, 15915, 32568, 16188, 5, 12];  # type 2 filter with more inter-biquad dynamic range (recommended)&lt;br /&gt;
  filter_params = [ 32297, 15934, 31683, 15320, 0, 11];  # SCUBA-2 filter after 2011-06, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 12.97&amp;amp;nbsp;kHz&lt;br /&gt;
&lt;br /&gt;
== Code for simulations ==&lt;br /&gt;
&lt;br /&gt;
Note that as of mce_script r902, '''mce_data.py''' contains code for handling the MCE Butterworth filters.  This can be used to load filter parameters from a runfile, and to get the complex frequency response of a filter.  See [[mce_data.py#MCEButterworth_class]].&lt;br /&gt;
&lt;br /&gt;
A smaller, quicker python example:&lt;br /&gt;
[[ Media: mce_filt_py.txt ]]&lt;br /&gt;
&lt;br /&gt;
In this little IDL program you can find the functional form as a function of the frequency of the filter. First, Elia's original program, then as modified by Joe on November 29, 2007, then modified by Mandana on Jan. 14, 2009 for Scuba2 numbers:&lt;br /&gt;
* [[ Media: filter_pro.txt ]] &lt;br /&gt;
* [[ Media: filter_pro2.txt ]]&lt;br /&gt;
* [[ Media: low_pass_filter_model_pro.txt ]]&lt;br /&gt;
&lt;br /&gt;
=== Digital, time domain simulation codes ===&lt;br /&gt;
&lt;br /&gt;
Python-based model of a single biquad, in the time domain, for exploring digitization and dynamic range:&lt;br /&gt;
* [[ Media: biquad_time_domain_py.txt ]]&lt;br /&gt;
&lt;br /&gt;
== Filter Coefficients  ==&lt;br /&gt;
=== Butterworth Coefficients ===&lt;br /&gt;
The filter coefficients are generated using ''fdatool'' (Filter-design &amp;amp; Analysis tool, part of DSP Toolbox) in '''MATLAB/Simulink'''. These coefficients are floating numbers and in order to feed them to MCE firmware, they need to be quantized by converting to signed binary fractional (SBF) 1.14 format. You may use [[#Alternative to fdatool|alternate methods]] to generate coefficients. Here, we explain the method using ''fdatool''.&lt;br /&gt;
&lt;br /&gt;
Once you launch the ''fdatool'', choose the following settings:&lt;br /&gt;
&lt;br /&gt;
* Response Type: Low Pass&lt;br /&gt;
* Design Method: Butterworth&lt;br /&gt;
* Filter Order: 4&lt;br /&gt;
&lt;br /&gt;
* Frequency Specifications: &lt;br /&gt;
** For Type 1:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 12,195&amp;amp;nbsp;Hz = 50&amp;amp;nbsp;MHz/ (100 &amp;amp;times; 41)&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; = 100&amp;amp;nbsp;Hz&lt;br /&gt;
** For Type 2:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 30,000&amp;amp;nbsp;Hz ≈ 50&amp;amp;nbsp;MHz / (50 &amp;amp;times; 33)&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz&lt;br /&gt;
** For Type 255:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 50&amp;amp;nbsp;MHz / ({{param|sys|row_len}} &amp;amp;times; {{param|sys|num_rows}})&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;=''f''&amp;lt;sub&amp;gt;readout&amp;lt;/sub&amp;gt; / 2 (= ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; / {{param|cc|data_rate}} / 2, if using internal CC triggering)&lt;br /&gt;
* The attenuation at ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; is fixed at 3&amp;amp;nbsp;dB (half the passband power)&lt;br /&gt;
&lt;br /&gt;
Then click on Design Filter and you will get the following coefficients:&lt;br /&gt;
; Type 1 &lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9587428340882587  0.96134553442399129 &lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.00065067508393319923 (not implemented)&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9066292518523014  0.90916270571237567&lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;= 0.00063336346501859835  (not implemented)&lt;br /&gt;
&lt;br /&gt;
; Type 2 &lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9711486088510415  0.97139181456687917&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9878047097960421  0.98804997058724808 &lt;br /&gt;
:Gain = 1/(''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;amp;times; ''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)= 0.0000000037280516432624239  (not implemented)&lt;br /&gt;
&lt;br /&gt;
; Type 255&lt;br /&gt;
: Plug in your desired ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; and ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; in MATLAB fdatool and you will get a set of coefficients:&lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]]&lt;br /&gt;
:: Gain = 1/''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1 [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]]&lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Coefficient Quantization ===&lt;br /&gt;
The quantization format is signed-binary fractional (SBF) 1.14 and then 2's complement to be able to account for positive and negative values.&lt;br /&gt;
* Compute the quantised coefficients ''b&amp;lt;sub&amp;gt;xy&amp;lt;/sub&amp;gt;'' via: [[File:Math_bxy_eq.png|150px|alt=b_{xy} {{=}} \left\lfloor\left{{bar}}b^*_{xy}\right{{bar}} \times 2^{14}\right\rfloor]] (i.e. take the absolute value, multiply by 2&amp;lt;sup&amp;gt;14&amp;lt;/sup&amp;gt; and then drop the fractional part).&lt;br /&gt;
* [[File:Math_k1_eq.png|170px|alt=k_1 {{=}} \left\lfloor \log_2 g_2 \right\rfloor - 10]], the output-truncation (10 is a historical constant)&lt;br /&gt;
* [[File:Math_k2_eq.png|160px|alt=k_2 = 1 + \left\lfloor \log_2 g_1 \right\rfloor]], the inter-stage truncation&lt;br /&gt;
&lt;br /&gt;
For example, if we use this formula to quantize Type 1 coefficients listed above:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_coeff_calc.png|800px|alt=\begin{align}&lt;br /&gt;
   b_{11} &amp;amp;{{=}} \lfloor 1.9587428340882587 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 32092\\&lt;br /&gt;
   b_{12} &amp;amp;{{=}} \lfloor 0.96134553442399129 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 15750\\&lt;br /&gt;
   b_{21} &amp;amp;{{=}} \lfloor 1.9066292518523014 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 31238\\&lt;br /&gt;
   b_{22} &amp;amp;{{=}} \lfloor 0.90916270571237567 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 14895\\&lt;br /&gt;
   k_1 &amp;amp;{{=}} \left\lfloor \log_2 \left(1 / 0.00065067508393319923 \right)\right\rfloor - 10 &amp;amp;{{=}}&amp;amp;\ 0\\&lt;br /&gt;
   k_2 &amp;amp;{{=}} 1 + \left\lfloor \log_2 \left(1 / 0.00063336346501859835 \right)\right\rfloor &amp;amp;{{=}}&amp;amp;\ 11&lt;br /&gt;
\end{align}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;amp;lt; 16 and ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;lt; 32&lt;br /&gt;
* Now, if 32 &amp;amp;minus; ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;gt; 32, then you have to talk to UBC!&lt;br /&gt;
&lt;br /&gt;
:'''''The following ONLY concerns the MCE firmware developers:'''&lt;br /&gt;
&lt;br /&gt;
:Prior to firmware 5.1.0, the coefficients were hardcoded in  '''fsfb_calc_pack.vhd''' (FILTER_B11_COEF, FILTER_B12_COEF, FILTER_B21_COEFF, FILTER_B22_COEFF, FILTER_GAIN_WIDTH, FILTER_SCALE_LSB).''&lt;br /&gt;
&lt;br /&gt;
=== Calculating the DC Gain (''k'') ===&lt;br /&gt;
Note that in firmware, instead of ''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and ''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, an inter-biquad truncation of ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; (implemented as a binary shift) and ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, number of bits dropped after the second biquad, are implemented.&lt;br /&gt;
&lt;br /&gt;
Hence, the overall gain becomes [[File:Math_gain_eq.png|60px|alt=\frac {g_1 g_2}  {2^{(k_1 + k_2)}}]].&lt;br /&gt;
&lt;br /&gt;
:''(Note for firmware developers: see FILTER_GAIN_WIDTH and FILTER_SCALE_LSB in '''fsfb_calc_pack.vhd'''.) ''&lt;br /&gt;
&lt;br /&gt;
; Type 1&lt;br /&gt;
:''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 11, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0, the filter gain is estimated at 1184, but VHDL simulation results in a gain of 1216. &lt;br /&gt;
; Type 2&lt;br /&gt;
:''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 14, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 3, the filter gain is estimated at 2046, but VHDL simulation results in a gain of 2181. &lt;br /&gt;
&lt;br /&gt;
The gain difference can be attributed to the rounding effects associated with fixed-width arithmetic.&lt;br /&gt;
&lt;br /&gt;
To roughly compute the gain, including the effects from truncating the coefficients, reverse the quantization process to obtain the floating point values associated with your coefficients, and plug into the filter definition.  Here is a rough python program which computes the true gain for our Type 1 filter (''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt; = 32092, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt; = 15750, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt; = 31238, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; = 14895, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 11):&lt;br /&gt;
 from numpy import *&lt;br /&gt;
 # Sum of k1 and k2 shifts:&lt;br /&gt;
 k12 = 11+0&lt;br /&gt;
 # Quantized coefficients b11, b12, b21, b22:&lt;br /&gt;
 n = array([32092, 15750, 31238, 14895]).astype('float')&lt;br /&gt;
 # Re-float&lt;br /&gt;
 f = n/2**14&lt;br /&gt;
 # Compute gain&lt;br /&gt;
 gain = 16. / (2**k12 * (1 - f[0] + f[1]) * (1 - f[2] + f[3]))&lt;br /&gt;
 print gain&lt;br /&gt;
 # Result: 1217.8583043&lt;br /&gt;
&lt;br /&gt;
== Useful Links  ==&lt;br /&gt;
http://www.phas.ubc.ca/~mce/mcedocs/hardware/Firmware_block_spec/reaout_card/fsfb_calculations_rev1.11.pdf&lt;br /&gt;
&lt;br /&gt;
http://www.planetanalog.com/showArticle.jhtml?articleID=12802683&lt;br /&gt;
&lt;br /&gt;
== Alternative to fdatool ==&lt;br /&gt;
If you do not have access to fdatool or do not have DSP toolbox installed, you can use the following MATLAB functions (or equivalent in other packages) to get the coefficients:&lt;br /&gt;
* butter: is a matlab function to generate butterworth coefficients&lt;br /&gt;
* sos2tf: matlab function to break a transfer function to second-order sections&lt;br /&gt;
* bilinear: converts an s-domain (continuous) transfer function to z-domain (discrete) transfer function.&lt;br /&gt;
* Then run the following in matlab (or whatever syntax your tool has):&lt;br /&gt;
   num=[1 2 1]&lt;br /&gt;
   denum=[1 -1.9711486088510415  0.97139181456687917]&lt;br /&gt;
   max(dbode(num, denum, 1/fsamp) but also look at the bode-plot to make sure it is flat, otherwise read the max from the flat portion of the plot instead of the max function.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' When I used coefficients generated by [a,b] = butter(2, 50/20000); [SOS,G]=tf2sos(a,b), the filter was not as robust. not sure why?!&lt;br /&gt;
&lt;br /&gt;
[[Category:Readout Card Firmware]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Data_accumulation_rate&amp;diff=11095</id>
		<title>Data accumulation rate</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Data_accumulation_rate&amp;diff=11095"/>
		<updated>2026-01-05T23:20:32Z</updated>

		<summary type="html">&lt;p&gt;Dvw: de-&amp;lt;math&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives some rules for estimating the accumulation rate of data on disk for a running MCE.&lt;br /&gt;
&lt;br /&gt;
== Rate calculations ==&lt;br /&gt;
In general, during a regular acquisition, the data rate (bit rate) of an MCE is:&lt;br /&gt;
&lt;br /&gt;
:''S''&amp;lt;sub&amp;gt;w&amp;lt;/sub&amp;gt; &amp;amp;times; (''S''&amp;lt;sub&amp;gt;head&amp;lt;/sub&amp;gt; + ''N''&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt; &amp;amp;times; ''N''&amp;lt;sub&amp;gt;RC&amp;lt;/sub&amp;gt; &amp;amp;times; ''N''&amp;lt;sub&amp;gt;rro&amp;lt;/sub&amp;gt; + ''S''&amp;lt;sub&amp;gt;chk&amp;lt;/sub&amp;gt;) &amp;amp;times; ''f''&amp;lt;sub&amp;gt;DV&amp;lt;/sub&amp;gt;&lt;br /&gt;
where:&lt;br /&gt;
* ''S''&amp;lt;sub&amp;gt;w&amp;lt;/sub&amp;gt; is the word size (=32 bits)&lt;br /&gt;
* ''S''&amp;lt;sub&amp;gt;head&amp;lt;/sub&amp;gt; is the size (in words) of the [[frame header]] (=43 words)&lt;br /&gt;
* ''N''&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt; is the number of columns per [[readout card]] (=8)&lt;br /&gt;
* ''N''&amp;lt;sub&amp;gt;RC&amp;lt;/sub&amp;gt; is the number of readout cards read out (see {{param|cc|rcs_to_report_data}})&lt;br /&gt;
* ''N''&amp;lt;sub&amp;gt;rro&amp;lt;/sub&amp;gt; is the number of rows read out (i.e. {{param|cc|num_rows_reported}})&lt;br /&gt;
* ''S''&amp;lt;sub&amp;gt;chk&amp;lt;/sub&amp;gt; is the size (in words) of the frame checksum (=1 word)&lt;br /&gt;
* ''f''&amp;lt;sub&amp;gt;DV&amp;lt;/sub&amp;gt; is the read-out data rate.  When in internal-DV mode (i.e. {{param|cc|use_dv}} is zero), this is:&lt;br /&gt;
::''f''&amp;lt;sub&amp;gt;DV&amp;lt;/sub&amp;gt; = 50&amp;amp;nbsp;MHz / (''N''&amp;lt;sub&amp;gt;dr&amp;lt;/sub&amp;gt; &amp;amp;times; ''N''&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; &amp;amp;times; ''N''&amp;lt;sub&amp;gt;rl&amp;lt;/sub&amp;gt;)&lt;br /&gt;
::&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; ≡ ''f''&amp;lt;sub&amp;gt;ARZ&amp;lt;/sub&amp;gt; / ''N''&amp;lt;sub&amp;gt;dr&amp;lt;/sub&amp;gt;&lt;br /&gt;
where:&lt;br /&gt;
* 50&amp;amp;nbsp;MHz is the clock rate&lt;br /&gt;
* ''N''&amp;lt;sub&amp;gt;dr&amp;lt;/sub&amp;gt; is the number of samples co-added into an output frame (i.e. {{param|cc|data_rate}})&lt;br /&gt;
* ''N''&amp;lt;sub&amp;gt;r&amp;lt;/sub&amp;gt; is the number of rows servoed (i.e. {{param|sys|num_rows}})&lt;br /&gt;
* ''N''&amp;lt;sub&amp;gt;rl&amp;lt;/sub&amp;gt; is the row dwell-time in clock periods (i.e. {{param|sys|row_len}}), and&lt;br /&gt;
* ''f''&amp;lt;sub&amp;gt;ARZ&amp;lt;/sub&amp;gt; is the Address-return-to-zero rate, i.e. the frequency at which a single pixel is visited&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A useful approximation is:&lt;br /&gt;
* a single readout card reading 41 rows at 400 Hz is ≈ 0.5 megabytes/second.&lt;br /&gt;
&lt;br /&gt;
== Tables ==&lt;br /&gt;
Here are some tables of accumulation rates for both kinds of subracks for various data rates and numbers of rows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: right&amp;quot;&lt;br /&gt;
|+ MCE data accumulation rate in Megabits per second (Mbps)&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | 48HP&lt;br /&gt;
! rowspan=&amp;quot;5&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | 72HP&lt;br /&gt;
|-&lt;br /&gt;
! 100 Hz&lt;br /&gt;
! 150 Hz&lt;br /&gt;
! 200 Hz&lt;br /&gt;
! 400 Hz&lt;br /&gt;
! 100 Hz&lt;br /&gt;
! 150 Hz&lt;br /&gt;
! 200 Hz&lt;br /&gt;
! 400 Hz&lt;br /&gt;
|-&lt;br /&gt;
! 25 rows&lt;br /&gt;
| 1.28&lt;br /&gt;
| 1.92&lt;br /&gt;
| 2.56&lt;br /&gt;
| 5.12&lt;br /&gt;
| 2.56&lt;br /&gt;
| 3.84&lt;br /&gt;
| 5.12&lt;br /&gt;
| 10.24&lt;br /&gt;
|-&lt;br /&gt;
! 33 rows&lt;br /&gt;
| 1.69&lt;br /&gt;
| 2.53&lt;br /&gt;
| 3.38&lt;br /&gt;
| 6.76&lt;br /&gt;
| 3.38&lt;br /&gt;
| 5.07&lt;br /&gt;
| 6.76&lt;br /&gt;
| 13.52&lt;br /&gt;
|-&lt;br /&gt;
! 41 rows&lt;br /&gt;
| 0.94&lt;br /&gt;
| 1.42&lt;br /&gt;
| 1.89&lt;br /&gt;
| 3.78&lt;br /&gt;
| 1.42&lt;br /&gt;
| 2.83&lt;br /&gt;
| 3.78&lt;br /&gt;
| 7.56&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: right&amp;quot;&lt;br /&gt;
|+ MCE data accumulation rate in Gigabytes (10&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;&amp;amp;nbsp;bytes) per hour&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | 48HP&lt;br /&gt;
! rowspan=&amp;quot;5&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | 72HP&lt;br /&gt;
|-&lt;br /&gt;
! 100 Hz&lt;br /&gt;
! 150 Hz&lt;br /&gt;
! 200 Hz&lt;br /&gt;
! 400 Hz&lt;br /&gt;
! 100 Hz&lt;br /&gt;
! 150 Hz&lt;br /&gt;
! 200 Hz&lt;br /&gt;
! 400 Hz&lt;br /&gt;
|-&lt;br /&gt;
! 25 rows&lt;br /&gt;
| 0.58&lt;br /&gt;
| 0.86&lt;br /&gt;
| 1.15&lt;br /&gt;
| 2.30&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.73&lt;br /&gt;
| 2.30&lt;br /&gt;
| 4.61&lt;br /&gt;
|-&lt;br /&gt;
! 33 rows&lt;br /&gt;
| 0.76&lt;br /&gt;
| 1.14&lt;br /&gt;
| 1.52&lt;br /&gt;
| 3.04&lt;br /&gt;
| 1.52&lt;br /&gt;
| 2.28&lt;br /&gt;
| 3.04&lt;br /&gt;
| 6.08&lt;br /&gt;
|-&lt;br /&gt;
! 41 rows&lt;br /&gt;
| 2.10&lt;br /&gt;
| 3.15&lt;br /&gt;
| 4.20&lt;br /&gt;
| 8.40&lt;br /&gt;
| 4.20&lt;br /&gt;
| 6.30&lt;br /&gt;
| 8.40&lt;br /&gt;
| 16.79&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: right&amp;quot;&lt;br /&gt;
|+ MCE data accumulation rate in Gigabytes (10&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;&amp;amp;nbsp;bytes) per day&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | 48HP&lt;br /&gt;
! rowspan=&amp;quot;5&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | 72HP&lt;br /&gt;
|-&lt;br /&gt;
! 100 Hz&lt;br /&gt;
! 150 Hz&lt;br /&gt;
! 200 Hz&lt;br /&gt;
! 400 Hz&lt;br /&gt;
! 100 Hz&lt;br /&gt;
! 150 Hz&lt;br /&gt;
! 200 Hz&lt;br /&gt;
! 400 Hz&lt;br /&gt;
|-&lt;br /&gt;
! 25 rows&lt;br /&gt;
| 13.8&lt;br /&gt;
| 20.7&lt;br /&gt;
| 27.7&lt;br /&gt;
| 55.3&lt;br /&gt;
| 27.7&lt;br /&gt;
| 41.5&lt;br /&gt;
| 55.3&lt;br /&gt;
| 110.6&lt;br /&gt;
|-&lt;br /&gt;
! 33 rows&lt;br /&gt;
| 18.1&lt;br /&gt;
| 27.4&lt;br /&gt;
| 36.5&lt;br /&gt;
| 73.0&lt;br /&gt;
| 36.5&lt;br /&gt;
| 54.7&lt;br /&gt;
| 73.0&lt;br /&gt;
| 146.0&lt;br /&gt;
|-&lt;br /&gt;
! 41 rows&lt;br /&gt;
| 22.7&lt;br /&gt;
| 34.0&lt;br /&gt;
| 45.3&lt;br /&gt;
| 90.7&lt;br /&gt;
| 45.3&lt;br /&gt;
| 68.0&lt;br /&gt;
| 90.7&lt;br /&gt;
| 181.4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Bias_Card_low_noise_bias_lines_noise_analysis&amp;diff=11094</id>
		<title>Bias Card low noise bias lines noise analysis</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Bias_Card_low_noise_bias_lines_noise_analysis&amp;diff=11094"/>
		<updated>2026-01-05T23:10:18Z</updated>

		<summary type="html">&lt;p&gt;Dvw: math&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:''The following discussion is valid for '''BC Rev. F0, F1, F2, F3, F4''' where LN_BIAS DACs are used in bipolar configuration and U16 and U17 are populated with AD797A.''&lt;br /&gt;
&lt;br /&gt;
The low noise detector bias lines in Rev F [[bias card]]s are driven by a bipolar DAC (MAX5444AEUB+) whose output is buffered by an opamp (AD797) in a non-inverting configuration (gain G=2), and inverted by a second opamp (AD797).  These two signals are then each fed through a series resistance before going to the backplane and MDM connectors.  The noise performance of these bias lines is determined by summing the noise contributions of: &lt;br /&gt;
&lt;br /&gt;
* the input resistance to the op amp: ''R&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;'' = ~6.3kΩ, mostly due to the output resistance of the DAC&lt;br /&gt;
* the matched feedback resistances of the buffer, which are internal to the DAC (RFB and INV pins): not listed in the datasheet, but measured as ''R&amp;lt;sub&amp;gt;f1&amp;lt;/sub&amp;gt;'' = ''R&amp;lt;sub&amp;gt;f2&amp;lt;/sub&amp;gt;'' = ~12kΩ&lt;br /&gt;
* the voltage noise of the AD797: ''e&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;'' = 0.9 nV/√Hz at 1kHz&lt;br /&gt;
* the voltage noise of the DAC 2.5V reference voltage, ADR441: ''e&amp;lt;sub&amp;gt;n,ref&amp;lt;/sub&amp;gt;'' = ~50 nV/√Hz&lt;br /&gt;
* current noise of the AD797: ''i&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;'' = 2.0 pA/√Hz, which multiplies both the input resistance to the non-inverting input (~6.3kΩ) and the parallel combination of the feedback resistors at the inverting input (~12kΩ each)&lt;br /&gt;
&lt;br /&gt;
Using these numbers, the total noise at 1 kHz and ''T'' = 300K can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_vnt_calc.png|1000px|alt=\begin{align}&lt;br /&gt;
v_{nt}(1\;\mathrm{kHz},300\;\mathrm{K}) &amp;amp;{{=}} \sqrt{ \quad 4kTR_i \quad + 4kT \left(R_{f_1}^{-1} + R_{f_2}^{-1}\right)^{-1} + \qquad e_n^2 \qquad +  \quad\; e_{n,ref}^2 \quad\;+ i_n^2 \left[ R_i^2 + \left(R_{f_1}^{-1} + R_{f_2}^{-1}\right)^{-2}\right]}\\&lt;br /&gt;
&amp;amp;\approx \sqrt{\left(10.2\;\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(10.0\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(0.9\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(50\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \qquad \left(17.4\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2}\\&lt;br /&gt;
&amp;amp;\approx 55 \frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}&lt;br /&gt;
\end{align}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This characterizes the flat high frequency noise spectrum of the positive polarity bias line before the series resistance.  The dominant source of noise is the voltage reference (''e&amp;lt;sub&amp;gt;n,ref&amp;lt;/sub&amp;gt;'').  The ~233Ω of series resistance has a thermal noise of about 2 nV/√Hz, which summed in quadrature does not contribute to the overall noise.  The noise of the negative bias line is small compared to the output noise of the first stage buffer in the positive line.  The negative line doubles the total noise by inverting the output noise of the positive line and adding this noise to the output, but offsets this by also doubling the resistance in the bias line.  The total current noise through a detector bias element winds up roughly the same as if it were a single ended bias line.&lt;br /&gt;
&lt;br /&gt;
Also, the detector band of interest is up to only 10 Hz, where 1/''f'' noise is important.  The 1/''f'' characteristics of the op amp and voltage reference are not well documented in the respective datasheets.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bias Card]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_vnt_calc.png&amp;diff=11093</id>
		<title>File:Math vnt calc.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_vnt_calc.png&amp;diff=11093"/>
		<updated>2026-01-05T23:03:40Z</updated>

		<summary type="html">&lt;p&gt;Dvw: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 \begin{align}&lt;br /&gt;
     v_{nt}(1\;\mathrm{kHz},300\;\mathrm{K}) &amp;amp;= \sqrt{ \quad 4kTR_i \quad + 4kT \left(R_{f_1}^{-1} + R_{f_2}^{-1}\right)^{-1} + \qquad e_n^2 \qquad +  \quad\; e_{n,ref}^2 \quad\;+ i_n^2 \left[ R_i^2 + \left(R_{f_1}^{-1} + R_{f_2}^{-1}\right)^{-2}\right]}\\&lt;br /&gt;
     &amp;amp;\approx \sqrt{\left(10.2\;\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(10.0\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(0.9\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(50\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \qquad \left(17.4\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2}\\&lt;br /&gt;
     &amp;amp;\approx 55 \frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}&lt;br /&gt;
 \end{align}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_vnt_calc.png&amp;diff=11092</id>
		<title>File:Math vnt calc.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_vnt_calc.png&amp;diff=11092"/>
		<updated>2026-01-05T23:02:53Z</updated>

		<summary type="html">&lt;p&gt;Dvw: \begin{align}
 v_{nt}(1\;\mathrm{kHz},300\;\mathrm{K}) &amp;amp;= \sqrt{ \quad 4kTR_i \quad + 4kT \left(R_{f_1}^{-1} + R_{f_2}^{-1}\right)^{-1} + \qquad e_n^2 \qquad +  \quad\; e_{n,ref}^2 \quad\;+ i_n^2 \left[ R_i^2 + \left(R_{f_1}^{-1} + R_{f_2}^{-1}\right)^...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 \begin{align}&lt;br /&gt;
 v_{nt}(1\;\mathrm{kHz},300\;\mathrm{K}) &amp;amp;= \sqrt{ \quad 4kTR_i \quad + 4kT \left(R_{f_1}^{-1} + R_{f_2}^{-1}\right)^{-1} + \qquad e_n^2 \qquad +  \quad\; e_{n,ref}^2 \quad\;+ i_n^2 \left[ R_i^2 + \left(R_{f_1}^{-1} + R_{f_2}^{-1}\right)^{-2}\right]}\\&lt;br /&gt;
 &amp;amp;\approx \sqrt{\left(10.2\;\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(10.0\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(0.9\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \left(50\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2 + \qquad \left(17.4\frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}\right)^2}\\&lt;br /&gt;
 &amp;amp;\approx 55 \frac{\mathrm{nV}}{\sqrt{\mathrm{Hz}}}&lt;br /&gt;
 \end{align}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_commands&amp;diff=11091</id>
		<title>MCE commands</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_commands&amp;diff=11091"/>
		<updated>2026-01-05T22:50:38Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|Commanding}}&lt;br /&gt;
This document lists the commands used to communicate with the MCE over the fibre-optic interface. These are low-level commands sent directly to the cards in command packets.  In general, MAS abstracts these commands, providing a higher-level interface to MCE commanding.  In MAS, [[mce_cmd]] is used to issue commands to the MCE, and the MCE commands and their encodings are defined in the hardware description file: [[mce.cfg]].&lt;br /&gt;
&lt;br /&gt;
= Firmware version 6 updates =&lt;br /&gt;
Firmware version 6 increases the maximum number of rows supported from 41 to 64.  Unfortunately, the [[MCE fibre protocol#Command packet|MCE protocol command packet]] has a fixed size, allowing at most 58 parameter elements to be written at once.  To enable parameters with 64 elements in a backwards-compatible way, firmware version six adds ''upper [[Card ID]]s'' which can be used to address the top portion of the parameter array.  Upper card IDs exist for the readout cards, bias cards and address card only.  An upper card IDs are is the original (lower) Card ID with &amp;lt;tt&amp;gt;0x10&amp;lt;/tt&amp;gt; added (so, for RC1, whose lower card ID is &amp;lt;tt&amp;gt;0x03&amp;lt;/tt&amp;gt;, the upper card ID is &amp;lt;tt&amp;gt;0x13&amp;lt;/tt&amp;gt;).  Accessing an upper card ID has the effect of offsetting the parameter element index by 32 (e.g. writing, say, five values to an upper card ID will store them in elements 32 through 36 of the specified parameter).&lt;br /&gt;
&lt;br /&gt;
Parameters which have more than 58 parameter elements, and so require the upper Card ID to write the upper portion of the data, are marked in the table below with an asterisk in the Data column.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' When commanding via [[MAS]], the library handles splitting commands across the lower and upper card IDs.  Users need not worry about which underlying card ID is used (unless using [[mce_cmd#Raw commands|raw commanding]] via bare numeric addresses).&lt;br /&gt;
&lt;br /&gt;
= Command list =&lt;br /&gt;
The following list omits unimplemented commands and commands obsoleted before firmware version 5.  In the lists below, in general, the '''type''' column indicates whether the parameter can be read from ('''rb''') or written to ('''wb''') or both ('''rb,wb''').  A few commands are interacted with in other ways (indicated by '''rs''' or '''go,st'''); for these special commands see the discussion of low-level MCE commands in the [[mce_cmd#Low-level MCE commands|mce_cmd description]].&lt;br /&gt;
&lt;br /&gt;
The command '''ID''' listed here is the name given to the command by MAS in the hardware description file ([[mce.cfg]]).  These IDs are not used in the command packets; only the register address (given in the '''Addr.''' column) is used to identify commands in the command packet.  As a result, these IDs are not part of the low-level MCE command protocol and other MCE documentation may refer to any given command register by a different name.  Because the MCE command protocol deals only with register addresses, changing the name does not affect the purpose or action associated with the register.&lt;br /&gt;
&lt;br /&gt;
The '''Data''' column indicates the data consumed by a write ('''wb''') or returned by a read ('''rb''').  A few commands only permit a single word with a value of 1 for the command data.  These are indicated by a bold-faced '''1'''.  The Version 6 Firmware increases the size of row-sized parameters to 64 from 41.  This is noted in the tables below with an asterisk in this column.&lt;br /&gt;
&lt;br /&gt;
In general, the '''FW Rev.''' provides the range of firmware release supporting the command.  It may omit a few pre-v5 firmware releases.&lt;br /&gt;
&lt;br /&gt;
== General card commands ==&lt;br /&gt;
These commands can be issued to any card in the MCE (cc, rc1 to rc4, bc1, bc2, bc3, ac).&lt;br /&gt;
{{cmdrow header}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=fpga_temp|addr=91|type=rb|params=FPGA temp.|desc=Return the FPGA temperature of a card}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=card_temp|addr=92|type=rb|params=card temp.|desc=Return the card temperature from a IC sensor}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=card_id|addr=93|type=rb|params=card ID|desc=Return card ID from on-board silicon-ID chip}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=card_type|addr=94|type=rb|params=card type&lt;br /&gt;
|desc=Return Card Type and PCB revision:&lt;br /&gt;
*'''Bit 31 to 16''': ''unused''&lt;br /&gt;
*'''Bit 15 to 8''': PCB revision: 1=A, 2=B, 3=C, &amp;amp;c.&lt;br /&gt;
*'''Bit 7 to 3''': ''unused''&lt;br /&gt;
*'''Bit 2 to 0''': Card type: 0=[[AC]], including [[BAC]], 1=[[BC]], 2=[[RC]], 3=[[CC]], 4=[[PSUC]]&lt;br /&gt;
Early firmware and hardware revisions do not report PCB revision.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=slot_id|addr=95|type=rb|params=slot ID|desc=Return slot ID:&lt;br /&gt;
* '''0x09''': [[PSUC]] (obsolete)&lt;br /&gt;
* '''0x08''': [[CC]]&lt;br /&gt;
* '''0x07''': [[RC]]4&lt;br /&gt;
* '''0x05''': [[RC]]2&lt;br /&gt;
* '''0x05''': [[RC]]2&lt;br /&gt;
* '''0x04''': [[RC]]1&lt;br /&gt;
* '''0x03''': [[BC]]3&lt;br /&gt;
* '''0x02''': [[BC]]2 or [[BAC]]&lt;br /&gt;
* '''0x01''': [[BC]]1&lt;br /&gt;
* '''0x00''': [[AC]]}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=fw_rev|addr=96|type=rb|params=revision|desc=&lt;br /&gt;
Return firmware revision, eg 0x0501000D for rev.5.1.d:&lt;br /&gt;
* '''Bit 31 to 24''': major revision number (e.g., for rev.5.1.d: 0x05)&lt;br /&gt;
* '''Bit 23 to 16''': minor revision number (e.g., for rev.5.1.d: 0x01)&lt;br /&gt;
* '''Bit 15 to 0''': build number (e.g., for rev.5.1.d: 0x000D)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=led|addr=99|params=status|desc=Set and return the status of the front-panel LEDs.  When writing to the LEDs, the value supplied is XOR’d with the current value of the LED status to produce the new status (i.e. a 1 bit toggles the corresponding LED).  So, passing 0 will return the value of the LEDs without changing them.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=scratch|addr=9A|params=word[0..7]|desc=These are read/write registers to be used for arbitrary purposes. An example is to use one to detect undesired reset of MCE.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=critical_error_rst|addr=9B|type=wb|params='''1'''|desc=Writing to this register triggers a reconfiguration of the FPGA from it's configuration device and therefore the card is unresponsive for a few seconds.|fwrev=5.2.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|id=fpga_clr|addr=9C|type=wb|params='''1'''|desc=Writing to this register clears all the registers in firmware, but ''not'' the RAM blocks in the FPGA.|fwrev=5.2.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow footer}}&lt;br /&gt;
&lt;br /&gt;
== System Commands ==&lt;br /&gt;
These commands affect the timing of the system – which means that they must be issued to all cards in the MCE at the same time.  They are addressed to every card in the MCE by using the &amp;quot;sys&amp;quot; card address.&lt;br /&gt;
{{cmdrow header}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=sys|id=row_len|addr=30|params=#&amp;amp;nbsp;cycles|desc=number of 50MHz clock cycles that are spent per row during multiplexing. Default = 64. Maximum = 65,535}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=sys|id=num_rows|addr=31|params=# rows|desc=number of rows to be multiplexed. Default = 41. Maximum = 2147483647/{{param|sys|row_len}}, although version 5 firmware cannot servo more than 64 rows (41 in v5 firmware)}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow footer}}&lt;br /&gt;
&lt;br /&gt;
== Clock card commands ==&lt;br /&gt;
{{cmdrow header}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=config_app|addr=52|type=rs|params='''1'''|desc=Configure the FPGA with the image in the application configuration device (EPC16).|fwrev=3.0.1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=config_fac|addr=51|type=rs|params='''1'''|desc=Configure the FPGA with the image in the factory configuration device (EPC16).|fwrev=3.0.1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ret_dat_s|addr=53|params=start, stop|desc=Specify the starting and ending sequence-numbers for data frames that the MCE is to return. Each frame of data will have a sequence number affixed to it. Sequence numbers will be assigned to data frames in increasing order, beginning with the starting sequence number, and finishing with the ending sequence number. Both parameters may range between 0x00000000 and 0xFFFFFFFF. If both starting and ending sequence numbers are the same, then a single frame of data will be returned. If the starting sequence number is larger than the ending sequence number, then frames will be returned until the sequence number has wrapped around and reached the stopping sequence number. Starting and stopping sequence numbers are expected for all modes of data acquisition&amp;amp;mdash;including for DV pulses.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=use_dv|addr=54|params=mode|desc=Set the DV mode. The Clock Card can return data frames at an internal rate specified by {{param|cc|data_rate}}, or in response to Data-Valid pulses from the Sync Box manchester input.&amp;lt;sup&amp;gt;[[#cc_sync_note|&amp;amp;dagger;]]&amp;lt;/sup&amp;gt;  Default = 0.  Allowed values:&lt;br /&gt;
* '''mode=0''': internal DV generated by the MCE&lt;br /&gt;
* '''mode=2''': external DV on the &amp;quot;SYNC IN&amp;quot; input fibre}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=array_id|addr=58|type=rb|params=array ID|desc=Read the ID of the sub-array that a MCE box is connected to, if equipped with an IR array ID reader.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=box_id|addr=59|type=rb|params=box ID|desc=Read the identification of the sub-rack. Each production sub-rack has a unique Silicon ID IC mounted on the Bus Backplane.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=sram_data|addr=5C|params=word[0..n]|desc=Read/write a block of 32-bit data to SRAM at address specified by the {{param|cc|sram_addr}} parameter.|fwrev=4.0.9}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=sram_addr|addr=5E|params=address|desc=Specify the starting address for subsequent read/write operation to the 1024k x 32-bit SRAM. The, physical addresses range between 0x00000000 and 0x000FFFFF|fwrev=4.0.9}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=data_rate|addr=A0|params=# periods|desc=Specify the rate at which data frames are collected by the MCE if DV pulses are not being used (see {{param|cc|use_dv}}). The rate is specified as the time between data packets measured in frame periods, i.e. a value of 11 will return one data packet every 11 frame periods.  A frame period is the amount of time required for the multiplexer to address all the rows on a MUX. Default = 47}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=mce_bclr|addr=AB|type=rs|params='''1'''|desc=Clear the registers on all the cards in the MCE, including the Clock Card|fwrev=3.0.4}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=cc_bclr|addr=AC|type=rs|params='''1'''|desc=Clear the registers on the clock card only|fwrev=3.0.4}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=box_temp|addr=A8|type=rb|params=box temp.|desc=Return the temperature measured by the sensor on the bus backplane.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=crc_err_en|addr=A9|params=mode|desc=Set the reply packet CRC mode:&lt;br /&gt;
* '''mode=0''': Normal CRC calculation performed&lt;br /&gt;
* '''mode=1''': CRC word forced to be 0xFFFFFFFF&lt;br /&gt;
|fwrev=3.0.1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=use_sync|addr=A1|params=mode|desc=Specify the sync mode. The Clock Card can return to address 0 using its internal timing, or in response to sync pulses from the Manchester input.&amp;lt;sup&amp;gt;[[#cc_sync_note|&amp;amp;dagger;]]&amp;lt;/sup&amp;gt;  Default = 0.  Allowed values:&lt;br /&gt;
* '''mode=0''': internal timing generated by the MCE&lt;br /&gt;
* '''mode=2''': external timing on the &amp;quot;SYNC IN&amp;quot; input fibre}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=select_clk|addr=A2|params=source|desc=Select the source of the clock input to the Clock Card's PLL, either the Manchester input clock, or the on-board crystal clock. Both are nominally 25 MHz.&amp;lt;sup&amp;gt;[[#cc_sync_note|&amp;amp;dagger;]]&amp;lt;/sup&amp;gt;  Default = 0.  Allowed values:&lt;br /&gt;
* '''source=0''': internally generated by the MCE&lt;br /&gt;
* '''source=1''': externally input on the &amp;quot;SYNC IN&amp;quot; input fibre&lt;br /&gt;
When source=1, and the external Manchester Clock disappears, the firmware automatically switches back to the internal clock.  After the switch-back, reading back {{param|cc|select_clk}} will return 0. Writing the same value to select_clk as what it is does not cause a clock glitch. Writing a different value causes a realignment of the PLL output clock to the new input, which takes two 25MHz clock cycles, or 80ns. See Altera Application Note 313.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=internal_cmd_mode|addr=B0|params=mode|desc=Enable or disable internal housekeeping/ramping commands. Default = 0.  Allowed values:&lt;br /&gt;
* '''mode=0''': internal commands disabled&lt;br /&gt;
* '''mode=1''': housekeeping commands enabled&lt;br /&gt;
* '''mode=2''': ramp commands enabled&lt;br /&gt;
* '''mode=3''': arbitrary waveform (AWG) commands enabled&lt;br /&gt;
|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ramp_step_period|addr=B1|params=# periods|desc=Specify the number of frame periods between each ramp step.|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ramp_min_val|addr=B2|type=rb,wb|params=value|desc=Specify the minimum value of the ramp that is to be applied. Must be less than {{param|cc|ramp_max_val}}|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ramp_step_size|addr=B3|params=step|desc=Specify the ramp step size. If '''step''' = {{param|cc|ramp_max_val}}&amp;amp;nbsp;–&amp;amp;nbsp;{{param|cc|ramp_min_val}}, then the ramp will be a square wave|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ramp_max_val|addr=B4|type=rb,wb|params=value|desc=Specify the maximum value of the ramp that is to be applied. Must be greater than {{param|cc|ramp_min_val}}|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ramp_param_id|addr=B5|params=address|desc=Specify the parameter ID (register address) of the register to be ramped|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ramp_card_addr|addr=B6|params=address|desc=Specify the card address of the register to be ramped|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ramp_step_data_num|addr=B7|params=count|desc=Specify the number of data that are to be written per ramp command|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=ramp_step_phase|addr=BB|params=offset|desc=Specify the phase offset of the start of the ramp|fwrev=5.0.b}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=awg_sequence_len|addr=B9|params=length|desc=Specify the length of the Arbitrary Waveform Generator (AWG) sequence that is loaded in RAM. This parameter tells the internal commanding FSM how many values to apply before restarting at the beginning|fwrev=5.0.3}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=awg_data|addr=BA|params=datum[0..n]|desc=Load the Arbitrary Waveform Generator (AWG) sequence into RAM on the Clock Card. The RAM has 8192 indices. This may be expanded later if there are enough resources still available on the Clock Card|fwrev=5.0.3}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=awg_addr|addr=BC|params=address|desc=Specify the starting address for reading from or writing to the Arbitrary Waveform Generator (AWG) RAM. This parameter also affects the memory address of the internal commanding FSM|fwrev=5.0.3}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=cards_present|addr=5A|type=rb|params=card list|desc=Report which cards are present in the MCE:&lt;br /&gt;
* '''Bit 9''': Address card&lt;br /&gt;
* '''Bit 8''': Bias card #1&lt;br /&gt;
* '''Bit 7''': Bias card #2&lt;br /&gt;
* '''Bit 6''': Bias card #3&lt;br /&gt;
* '''Bit 5''': Readout card #1&lt;br /&gt;
* '''Bit 4''': Readout card #2&lt;br /&gt;
* '''Bit 3''': Readout card #3&lt;br /&gt;
* '''Bit 2''': Readout card #4&lt;br /&gt;
* '''Bit 1''': Clock card&lt;br /&gt;
* '''Bit 0''': unused&lt;br /&gt;
|fwrev=4.0.8}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=cards_to_report|addr=5B|params=card list|desc=Specify which cards are present in the MCE subrack, and will return data over the bus backplane. This command can be used in situations where certain cards are not present in the subrack, and should not return data in replies. The default value for this register is 1 for every possible card. To stop a card from returning data, set its corresponding bit to '''0'''.  See {{param|cc|cards_present}} for bit assignments|fwrev=4.0.a}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=rcs_to_report_data|addr=5F|params=card list|desc='''This command is ''not'' redundant with {{param|cc|cards_to_report}}.''' It applies only to Readout Cards, and only for data taking ({{param|rc|ret_dat}}) commands. This register sets which Readout Cards return data during a data run. This command allows the selective return of data without affecting which cards respond to all other commands, which is useful if a data run fails.  See {{param|cc|cards_present}} for bit assignments, but note that only RC bits are honoured|fwrev=4.0.a}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=stop_dly|addr=B8|params=delay|desc=Specify the time delay between the return of the next data frame and the return of the reply to a stop command. The time specified is in microseconds. This command is used to test the robustness of the PCI card to replies following immediately on the heels of a data packet.|fwrev=4.0.a}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=num_rows_reported|addr=55|params=# rows|desc=number of rows of data that are reported in a data packet. This parameter is set also available on readout cards; see: {{param|rc|num_rows_reported |rc&amp;amp;nbsp;num_rows_reported}}. See also {{param|cc|num_cols_reported}}. Default = 41|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=run_id|addr=56|params=value|desc=Specify an ID number that will be stored in every data packet header returned to the PC. On ACT, the ID number corresponds to the C time at which data acquisition began. ACT's data files are also named by the same C time, so that the data pipeline can easily track which files the data are from|fwrev=4.0.2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=user_word|addr=57|params=value|desc=Specify a value that will be stored in every data packet header returned to the PC. This register is used by ACT to store a combination of {{param|cc|array_id}} and {{param|rc|data_mode}} information. At Caltech, it is used during IV curves to store the value of the TES bias applied.|fwrev=4.0.2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=upload_fw|addr=50|type=wb|params=count, datum[0..n]|desc=Specify '''count''' (&amp;amp;le;57) doublets of packed JTAG data. The first word of the command specifies the total number of [TMS,TDI] doublets contained in the rest of the data. The rest of the words consist of '''count''' [TMS,TDI] doublets starting from the LSB. The TCK signal is implied. The JTAG FSM automatically runs through a TCK cycle after asserting each new doublet consisting of one TMS and one TDI bit. Command execution:&lt;br /&gt;
# Apply [TMS,TDI] doublet to JTAG interface,&lt;br /&gt;
# Assert TCK (automatic) and wait for {{param|cc|tck_half_period}}. While waiting, store TDO (automatic) after {{param|cc|tdo_sample_dly}} cycles after the assertion of TCK,&lt;br /&gt;
# De-assert TCK (automatic) and wait for {{param|cc|tck_half_period}}|fwrev=5.0.5}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=config_jtag|addr=AA|type=rb|params=datum[0..n]|desc=Read back &amp;amp;le;57 bits of packed JTAG data. Unlike the {{param|cc|upload_fw}} command above, the first word returned does not contain the number of bits read out. It is assumed that following every {{param|cc|upload_fw}} command, this command will be called and will thus return the same number of single bits as there were doublets of [TMS,TDI] data transmitted. Every new {{param|cc|upload_fw}} command overwrites the TDO data from the previous {{param|cc|upload_fw}} command. The [[mce_jam]] player can ignore TDO data that is not important.|fwrev=5.0.5}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=num_cols_reported|addr=AD|type=wb|params=#&amp;amp;nbsp;columns|desc=number of columns of data that are reported in a data packet. This parameter is also available on readout cards; see: {{param|rc|num_cols_reported |rc&amp;amp;nbsp;num_cols_reported}}. See also {{param|cc|num_rows_reported}}. Default = 8|fwrev=5.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=tdo_sample_dly|addr=AE|params=delay|desc=Specify the number of clock cycles after the assertion of TCK that TDO should be sampled. Default = 2. The default value is tuned to the MCE, so leave this as is|fwrev=5.0.5}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=cc|id=tck_half_period|addr=AF|params=½ period|desc=Specify the number of clock cycles that TCK should remain high, and then remain low. Default = 8. The default value is tuned to the MCE, so leave this as is|fwrev=5.0.5}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow footer}}&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: small&amp;quot; id=&amp;quot;cc_sync_note&amp;quot;&amp;gt;&lt;br /&gt;
:'''&amp;amp;dagger;''': If {{param|cc|select_clk}}=0, then the user must set {{param|cc|use_sync}}=0 and {{param|cc|use_dv}}=0, otherwise timing artifacts will appear in data. The following combinations are OK:&lt;br /&gt;
::{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
! {{param|cc|select_clk}} !! {{param|cc|use_sync}} !! {{param|cc|use_dv}}&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 2 || 2&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || 2&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Readout card commands ==&lt;br /&gt;
Similar to the '''sys''' card used to issue commands to all cards, [[MAS]] provides the special physical card '''rca''' which can be used to issue '''rb''' or '''wb''' commands to all installed readout cards.  The firmware also implements the special physical card '''rcs''' which is used to issue commands to the {{param|rc|ret_dat}} register on all cards.&lt;br /&gt;
{{cmdrow header}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=sa_bias|addr=10|params=bias[0..7]|desc=Read/write the SA bias values for all columns on a readout card}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=offset|addr=11|params=offset[0..7]|desc=Read/write the SA offset values for all columns on a readout card}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|span=8|paramspan=4|card=rc|id=gainp0|addr=70|params=gainp[0..40]|desc=Read/write the Readout Card's P coefficients for any given column.  P gains are signed 10-bit values}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gainp1|addr=71}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gainp2|addr=72}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gainp3|addr=73}}&lt;br /&gt;
{{cmdrow|short=1|paramspan=4|card=rc|id=gainp4|addr=74|params6=gainp[0..63]}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gainp5|addr=75}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gainp6|addr=76}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gainp7|addr=77}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|span=8|paramspan=4|card=rc|id=gaini0|addr=78|params=gaini[0..40]|desc=Read/write the Readout Card's I coefficients for any given column.  I gains are signed 10-bit values}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaini1|addr=79}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaini2|addr=7A}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaini3|addr=7B}}&lt;br /&gt;
{{cmdrow|short=1|paramspan=4|card=rc|id=gaini4|addr=7C|params6=gaini[0..63]}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaini5|addr=7D}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaini6|addr=7E}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaini7|addr=7F}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|span=8|paramspan=4|card=rc|id=flx_quanta0|addr=80|params=quantum[0..40]|desc=Read/write the Readout Card's flux quanta for any given column.  Flux Quanta are used to calculate the SQ1 feedback value}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=flx_quanta1|addr=81}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=flx_quanta2|addr=82}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=flx_quanta3|addr=83}}&lt;br /&gt;
{{cmdrow|short=1|paramspan=4|card=rc|id=flx_quanta4|addr=84|params6=quantum[0..63]}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=flx_quanta5|addr=85}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=flx_quanta6|addr=86}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=flx_quanta7|addr=87}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|span=8|paramspan=4|card=rc|id=gaind0|addr=88|params=gaind[0..40]|desc=Read/write the Readout Card's D coefficients for any given column.  D gains are signed 10-bit values}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaind1|addr=89}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaind2|addr=8A}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaind3|addr=8B}}&lt;br /&gt;
{{cmdrow|short=1|paramspan=4|card=rc|id=gaind4|addr=8C|params6=gaind[0..63]}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaind5|addr=8D}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaind6|addr=8E}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=gaind7|addr=8F}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|span=8|paramspan=4|card=rc|id=adc_offset0|addr=68|params=offset[0..40]|desc=Read/write the Readout Card's ADC offsets for any given column.  The ADC Offset coefficients are used to digitally offset each 50 MHz ADC sample on the Readout Cards}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=adc_offset1|addr=69}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=adc_offset2|addr=6A}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=adc_offset3|addr=6B}}&lt;br /&gt;
{{cmdrow|short=1|paramspan=4|card=rc|id=adc_offset4|addr=6C|params6=offset[0..63]}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=adc_offset5|addr=6D}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=adc_offset6|addr=6E}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=adc_offset7|addr=6F}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=readout_row_index|addr=13|params=index|desc=Specify the starting row index of data to be returned in a data block.  Default = 0.  Note: if {{param|rc|num_rows_reported}} &amp;gt; {{param|sys|num_rows}} – {{param|rc|readout_row_index}} – 1, then the readout row index will wrap around to 0 during readout|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=ret_dat|addr=16|type=go,st|params='''1'''|desc=Return data frames. Prior to this command, the Clock Card expects a {{param|cc|ret_dat_s}} command to set up how many frames are to be collected and what sequence numbers to assign. Following that, a single {{param|rc|ret_dat}} command triggers the return of all requested data frames.  To simultaneously start or stop data return for all cards, this parameter should be accessed via the special '''&amp;lt;tt&amp;gt;rcs&amp;lt;/tt&amp;gt;''' card.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=en_fb_jump|addr=15|params=enabled|desc=Enable (=1) or disable (=0) flux jumping on the Readout Card. The size of flux jumps is specified by the {{param|rc|flx_quanta0|flx_quanta''#''}} commands}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=data_mode|addr=17|params=mode|desc=Set/return [[data mode]].  Not all data modes are supported by all firmware revisions.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=captr_raw|addr=18|params=enabled|desc=Capture (=1) a 64k timestream snapshot of the error signal when Address-Return-to-Zero is asserted. 65,536 50MHz ADC samples from the channel specified by {{param|rc|readout_col_index}} are stored in the raw-data buffer on the Readout Card|fwrev=5.0.1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=servo_mode|addr=1B|params=mode[0..7]|desc=Set the per-column servo mode on the Readout Cards. Available modes are:&lt;br /&gt;
* '''mode=0 or 1''': constant feedback mode as specified by {{param|rc|fb_const}} parameter&lt;br /&gt;
* '''mode=2''': ramp mode&lt;br /&gt;
* '''mode=3''': PID-loop lock mode}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=ramp_dly|addr=1C|params=# frames|desc=Specify the number of frame-periods before the next step in a ramp function. This delay can be tuned to the data-frame readout rate ({{param|cc|data_rate}}), so that one frame of data is read out per ramp step}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=ramp_amp|addr=1D|params=value|desc=Specify the maximum ramp value, in 14-bits}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=ramp_step|addr=1E|params=step|desc=Specify what the step size of each step in the ramp is, max 14-bit}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=fb_const|addr=1F|params=fb_const[0..7]|desc=Specify the constant feedback DAC value for a each column when the servo is in constant mode (see {{param|rc|servo_mode}}). Applied to SQ1 feedback. Range: -8192 to 8191. The constant value is applied to the Readout Card DAC repetitively for every new row}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=sample_dly|addr=32|params=# cycles|desc=Specify the number of 50MHz clock cycles from the start of a row during which ADC samples do not contribute to a co-added value on the Readout Cards}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=sample_num|addr=33|params=count|desc=Specify the number of 50MHz samples which are co-added during a row-period on the Readout Cards. Co-addition begins after the sample delay, and one value is co-added per 50MHz clock cycle. Note that default is 0 and therefore you need to explicitly set this parameter}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=fb_dly|addr=34|params=# cycles|desc=Specify the number of 50MHz clock-cycles between the start of a row and the assertion of the row's feed-back value on the Readout Cards. (minimum is 7 with flux-jumping off, 10 or 18 (depending on firmware revision) when flux-jumping is on).}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=flx_lp_init|addr=37|type=wb|params='''1'''|desc=Initialize/reset the PID loop calculations on the Readout Cards for new PID parameters to take effect}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=readout_col_index|addr=19|params=column|desc=Specify the starting column index of data to be returned in a data block. Default = 0.  Note: if {{param|rc|num_rows_reported}} &amp;gt; {{param|sys|num_rows}} – {{param|rc|readout_row_index}} – 1, then the readout row index will wrap around to 0 during readout. During raw readout, this parameter specifies the index of the column for which raw data is stored|fwrev=5.0.1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=num_rows_reported|addr=55|params=# rows|desc=number of rows of data that are reported in a data packet. This parameter is set in conjunction with the {{param|rc|readout_row_index}}. This parameter is also available on clock cards; see: {{param|cc|num_rows_reported|cc&amp;amp;nbsp;num_rows_reported}}. See also {{param|rc|num_cols_reported}}, {{param|rc|readout_col_index}}. Default = 41|fwrev=4.0.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=num_cols_reported|addr=AD|type=wb|params=#&amp;amp;nbsp;columns|desc=number of columns of data that are reported in a data packet. This parameter is set in conjunction with the {{param|rc|readout_col_index}}.  This parameter is also available on clock cards; see: {{param|cc|num_cols_reported|cc&amp;amp;nbsp;num_cols_reported}}. See also {{param|rc|num_rows_reported}}, {{param|rc|readout_row_index}}. Default = 8|fwrev=5.0.0}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- {{cmdrow|card=rc|id=readout_priority|addr=67|params=mode|desc=Specify whether readout should be&lt;br /&gt;
column-major or row-major.  Default = 0.  Available values:&lt;br /&gt;
* '''mode=0''': Data readout is in row-major order – all the pixels in a row are read out before moving on to the next row.&lt;br /&gt;
* '''mode=1''': Data readout is in column-major order – all the pixels in a column are read out before moving on to the next column&lt;br /&gt;
'''''This command is not supported by MAS.'''''|fwrev=5.0.0}} --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=integral_clamp|addr=66|params=value|desc=This parameter is used to clamp the integral term used in SQ1 feedback calculation. Once this value is reached, the integral term is permanently clamped and can only be reset by issuing a {{param|rc|flx_lp_init}} command or reset. This is invented to prevent ramping of unlocked pixels and mitigate the adverse effects of the ramping pixels on locked pixels.  See [[integral clamp]].|fwrev=5.0.9}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=servo_rst_arm|addr=F8|type=wb|params='''1'''|desc=When set to 1, the flux-loop servo on all detectors flagged by {{param|rc|servo_rst_col0|servo_rst_col''#''}} are reset; see [[Flux-loop reset per detector]]|fwrev=5.2.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|span=8|paramspan=4|card=rc|id=servo_rst_col0|addr=F0|params=reset_row[0..40]|desc=A per-detector flag indicating which pixels to reset when {{param|rc|servo_rst_arm}} is set to 1; see [[Flux-loop reset per detector]]|fwrev=5.2.0}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=servo_rst_col1|addr=F1}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=servo_rst_col2|addr=F2}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=servo_rst_col3|addr=F3}}&lt;br /&gt;
{{cmdrow|short=1|paramspan=4|card=rc|id=servo_rst_col4|params6=reset_row[0..63]|addr=F4}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=servo_rst_col5|addr=F5}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=servo_rst_col6|addr=F6}}&lt;br /&gt;
{{cmdrow|short=1|card=rc|id=servo_rst_col7|addr=F7}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=fltr_rst|addr=14|type=wb|params='''1'''|desc=Reset the filter data pipeline. Triggering {{param|rc|flx_lp_init}} also automatically triggers {{param|rc|fltr_rst}}}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=fltr_coeff|addr=1A|params=b&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, b&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, b&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, b&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt;, k&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, k&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;|desc=Specifies a set of 6 filter parameters for the low-pass Butterworth filter, the first 4 are the biquad coefficients followed by k&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and k&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;; see [[Digital 4-pole Butterworth Low-pass filter]]|fwrev=5.1.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=fltr_type|addr=65|params=type|desc=Specify the filter type.  Default is 1.  Allowed values:&lt;br /&gt;
* '''type=1''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226Hz / 15151Hz &lt;br /&gt;
* '''type=2''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75Hz / 30000Hz &lt;br /&gt;
* '''type=255''': filter specified by {{param|rc|fltr_coeff}}|fwrev=5.0.a}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=rc|id=pterm_decay_bits|addr=64|type=rb,wb|params=bit count|desc=This is the value ''k'' in the p-term calculation: [[File:Math_pn_calc.png|250px|alt=p_n {{=}} \mathrm{err}_n + \left(1 - \frac{1}{2^k}\right) p_{n-1}]].  Setting this to zero (the default) disables the decay, which is the behaviour in older firmwares.|fwrev=5.1.a}}&lt;br /&gt;
{{cmdrow footer}}&lt;br /&gt;
&lt;br /&gt;
== Bias card commands ==&lt;br /&gt;
{{cmdrow header}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=bc|id=flux_fb|addr=20|params=flux_fb[0..31]|desc=Specify the flux feedback for all 32 16-bit DAC channels on the Bias Cards.  The mapping between DAC channels and SQUIDs is hardware dependent.  For 32-column systems (72-HP subracks):&lt;br /&gt;
* BC1 flux_fb[0..31] ↔ SA feedback&lt;br /&gt;
* BC2 flux_fb[0..31] ↔ SQ2 feedback&lt;br /&gt;
* BC3 flux_fb[0..31] ↔ SQ2 bias&lt;br /&gt;
For most 16-column systems (48-HP subracks):&lt;br /&gt;
* BC1 flux_fb[0..15] ↔ SA feedback&lt;br /&gt;
* BC1 flux_fb[16..31] ↔ SQ2 bias&lt;br /&gt;
* BC2 flux_fb[0..15] ↔ SQ2 feedback&lt;br /&gt;
* BC3 flux_fb[0..15] ↔ TES bias&lt;br /&gt;
For 16-column systems with only two bias cards, the TES bias mapping is, instead:&lt;br /&gt;
* BC2 flux_fb[16..31] ↔ TES bias&lt;br /&gt;
These maps are abstracted in MAS by the sa, sq1, sq2, and tes virtual cards.  MAS supports any arbitrary mapping.}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=bc|id=bias|addr=21|params=bias[0..11]|desc=Read/Write the low-noise LVDS 16-bit DACs that are typically used to supply TES bias or pixel heater currents. Rev. E and later Bias Cards have 12 low-noise bias lines while Rev D. and earlier have only one, with the nominal mapping of [BC1 bias ↔ Pixel Heater] and [BC2 bias ↔ TES Bias]&lt;br /&gt;
Firmware revisions before 5.0.4 support only one value for this register.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=bc|id=flux_fb_upper|addr=24|params=flux_fb[16..31]|desc=Specify the flux feedback for 16 upper 16-bit DACs, i.e. channel 16 to 31 on bias cards. This command was implemented to match the cryostat wiring for the MCEv2 subracks, which use the upper 16 channels of BC1 to supply the SQ2 Bias.  See &amp;lt;tt&amp;gt;flux_fb&amp;lt;/tt&amp;gt; above.|fwrev=1.4.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|span=32|paramspan=16|card=bc|id=fb_col0|addr=C0|params=fb_row[0..40]|desc=When {{param|bc|enbl_mux}} = 1 or multiplexing mode is enabled, then these commands specify the per-row multiplexing values for each of the 32 DAC channels ({{param|bc|fb_col0|fb_col''#''}}) on the bias card|fwrev=5.0.3}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col1 |addr=C1}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col2 |addr=C2}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col3 |addr=C3}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col4 |addr=C4}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col5 |addr=C5}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col6 |addr=C6}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col7 |addr=C7}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col8 |addr=C8}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col9 |addr=C9}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col10|addr=CA}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col11|addr=CB}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col12|addr=CC}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col13|addr=CD}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col14|addr=CE}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col15|addr=CF}}&lt;br /&gt;
{{cmdrow|short=1|paramspan=16|card=bc|id=fb_col16|addr=D0|params6=fb_row[0..63]}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col17|addr=D1}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col18|addr=D2}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col19|addr=D3}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col20|addr=D4}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col21|addr=D5}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col22|addr=D6}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col23|addr=D7}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col24|addr=D8}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col25|addr=D9}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col26|addr=DA}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col27|addr=DB}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col28|addr=DC}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col29|addr=DD}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col30|addr=DE}}&lt;br /&gt;
{{cmdrow|short=1|card=bc|id=fb_col31|addr=DF}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=bc|id=enbl_mux|addr=05|params=mode[0..31]|desc=enable/disable per-column multiplexing DAC values. Default = 0.  Allowed values:&lt;br /&gt;
* '''mode=0''':  disables multiplexing on the particular column. The column DAC is updated only once when a new value is commanded by issuing a {{param|bc|flux_fb}} command. This is the legacy behavior prior to introducing {{param|bc|enbl_mux}} and {{param|bc|fb_col0|fb_col''#''}} parameters.&lt;br /&gt;
* '''mode=1''':  enables multiplexing on the particular column. The column DAC is updated at every row visit by values specified through {{param|bc|fb_col0|fb_col''#''}} parameters|fwrev=5.0.3}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=bc|id=enbl_flux_fb_mod|addr=25|params=enabled[0..31]|desc=Enable (=1) or disable (=0) the per-column addition of {{param|bc|mod_val}} to {{param|bc|flux_fb}} values for regular DACs|fwrev=5.3.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=bc|id=enbl_bias_mod|addr=26|params=enabled[0..31]|desc=Enable (=1) or disable (=0) the per-column addition of {{param|bc|mod_val}} to {{param|bc|bias}} values for low-noise bias DACs|fwrev=5.3.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=bc|id=mod_val|addr=27|params=value|desc=Modulation value to be added to either of {{param|bc|flux_fb}} or {{param|bc|bias}} values depending on whether modulation is enabled or not. (see {{param|bc|enbl_flux_fb_mod}} and {{param|bc|enbl_bias_mod}})|fwrev=5.3.0}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=bc|id=num_rows_idle|addr=28|params=# rows|desc=number of rows at the start of each ARZ that no bias is applied, only valid when multiplexing is enabled or ({{param|bc|enbl_mux}} is 1). |fwrev=5.3.5}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow footer}}&lt;br /&gt;
&lt;br /&gt;
== Address card commands ==&lt;br /&gt;
{{cmdrow header}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=row_order|addr=01|params=row_num[0..40]|params6=row_num[0..63]|desc='''This command is relevant when {{param|ac|enbl_mux}} = 1 or 2.''' Read/write the row-addressing order. A sequence of up to 41 (v5 firmware) or 64 (v6 firmware) rows is specified at once. The row numbers that are specified with this command refer to the physical channel numbers on the Address Card. Note: After this command is issued, a {{param|rc|flx_lp_init}} command must be issued to all the readout cards to discard previous PID-loop calculations and to clean out the rest of the data pipeline. Default = 0,0,0,...}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=on_bias|addr=02|params=bias_row[0..40]|desc='''Applies when {{param|ac|enbl_mux}} = 1 or 3.''' Read/write the14-bit on-bias values for all 41 channels of the DACs on the Address Card. Bias values are stored in the order of physical channels on the Address card – which is not necessarily the multiplexing order specified with {{param|ac|row_order}}. This command is nominally is used to specify the SQ1 &amp;quot;on&amp;quot; biases, and are applied one at a time in the sequence specified by {{param|ac|row_order}}. Default = 0,0,0,...}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=off_bias|addr=03|params=bias_row[0..40]|desc='''Applies when {{param|ac|enbl_mux}} = 1 or 3.''' Read/write the 14-bit off-bias values for all 41 channels of the row-addressing DACs on the Address Card. Bias values are stored in the order of physical channels on the Address card – which is not necessarily the multiplexing order specified with {{param|ac|row_order}}. This command is nominally is used to specify the SQ1 &amp;quot;off&amp;quot; biases. Default = 0,0,0,...}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=enbl_mux|addr=05|params=mode|desc=Start/stop array multiplexing. Default: 0.  Allowed values:&lt;br /&gt;
* '''mode=0''': Multiplexing off. This is the default value.&lt;br /&gt;
* '''mode=1''': Multiplexing on. The Address Card turns one DAC &amp;quot;on&amp;quot; and one DAC &amp;quot;off&amp;quot; at every row switch. The multiplexed values are specified by {{param|ac|on_bias}} and {{param|ac|off_bias}}.  The values are applied in the first two clock cycles after a row switch.&lt;br /&gt;
* '''mode=2''': Multiplexing on. The Address Card changes the values on all the DACs at every row switch. The multiplexed values are specified by {{param|ac|fb_col0|fb_col''#''}}. All 41 DAC values are applied in the first 4 clock cycles after a row switch.  This mode is only used by [[Biasing Address Card]]s.&lt;br /&gt;
* '''mode=3''': Special multiplexing on. In the first {{param|ac|heater_bias_len}} clock cycles of each row visit, the {{param|ac|heater_bias}} values are applied to the DACs, the remaining time, the {{param|ac|on_bias}} values are applied}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=bias_start|addr=09|params=start[0..40]|desc='''Applies only when {{param|ac|enbl_mux}} = 1.''' Specify the point during each row dwell period when the SQ1 bias is applied. This is specified on a row-by-row basis so that SCUBA2 can do differential bias heating across the rows of their arrays.|fwrev=5.0.1}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=heater_bias|addr=0A|params=bias[0..40]|desc=When {{param|ac|enbl_mux}}=3, specify the magnitude of the SQ1-bias heating pulse in DAC units (0 to 16383) during the initial {{param|ac|heater_bias_len}} period of each row visit.|fwrev=5.0.2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=heater_bias_len|addr=0B|params=# cycles|desc=When {{param|ac|enbl_mux}}=3, specify the length of the SQ1 bias heating pulses at the beginning of every new row period.|fwrev=5.0.2}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|span=32|card=ac|id=fb_col0|addr=E3|params=fb_row[0..40]|desc='''These commands are relevant when {{param|ac|enbl_mux}} = 2.''' Specifies the 41 multiplexing values for each DAC channel on the Address Card, and for each row that the channel is to multiplex. There are 41 channels on the Address Card, and up to 41 rows per channel that need to be specified.  These commands are used only when the address card is used from a bias card slot (see [[Biasing Address Card]]).|fwrev=2.0.5}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col1 |addr=E1}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col2 |addr=DF}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col3 |addr=DD}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col4 |addr=DB}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col5 |addr=D9}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col6 |addr=D7}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col7 |addr=D5}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col8 |addr=D3}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col9 |addr=D1}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col10|addr=CF}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col11|addr=CD}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col12|addr=CB}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col13|addr=C9}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col14|addr=C7}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col15|addr=C5}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col16|addr=E2}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col17|addr=E0}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col18|addr=DE}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col19|addr=DC}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col20|addr=DA}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col21|addr=D8}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col22|addr=D6}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col23|addr=D4}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col24|addr=D2}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col25|addr=D0}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col26|addr=CE}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col27|addr=CC}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col28|addr=CA}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col29|addr=C8}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col30|addr=C6}}&lt;br /&gt;
{{cmdrow|short=1|card=ac|id=fb_col31|addr=C4}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=const_mode|addr=06|params=mode[0..40]|desc=Specify which DAC channels are held at a constant value regardless of the value of {{param|ac|enbl_mux}}. A constant value is applied once only, and is specified by const_val. In addition, DACs for which const_mode=1 do not receive data strobes during multiplexing – so that there are no glitches or excess noise on the DAC outputs.&lt;br /&gt;
* '''mode=0''': this DAC channel is multiplexed when {{param|ac|enbl_mux}} = 1, 2, or 3&lt;br /&gt;
* '''mode=1''': this DAC channel is held at a constant value and not strobed when {{param|ac|enbl_mux}} = 1, or 2 ([[Biasing Address Card]] only)|fwrev=2.0.6}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow|card=ac|id=const_val|addr=07|params=val[0..40]|desc=Specify values for the DACs that are held constant. '''val[n]''' is asserted by DAC '''n''' when {{param|ac|const_mode}}[n] = 1.  In addition, all constant values are applied to each respective DAC when {{param|ac|enbl_mux}} = 0. When {{param|ac|enbl_mux}}, {{param|ac|const_mode}}, or {{param|ac|const_val}} values are changed, all the DACs that are being held constant have their values re-strobed ([[Biasing Address Card]] only)|fwrev=2.0.6}}&lt;br /&gt;
&lt;br /&gt;
{{cmdrow footer}}&lt;br /&gt;
&lt;br /&gt;
= Legacy documents =&lt;br /&gt;
The document linked below provides the same information as this page, except that it includes obsolete and unimplemented commands.  It was last updated in April of 2013, an does not list any command added after that time.  In some instances the command names listed in the following document are different than the command names used by MAS (which are listed above).  The description of some commands may be obsolete.&lt;br /&gt;
&lt;br /&gt;
* [http://www.phas.ubc.ca/~mce/mcedocs/software/SC2_ELE_S580_515_mce_command_description.pdf SC2_ELE_S580_515_mce_command_description.pdf]&lt;br /&gt;
[[Category:Address Card Firmware]]&lt;br /&gt;
[[Category:Bias Card Firmware]]&lt;br /&gt;
[[Category:Clock Card Firmware]]&lt;br /&gt;
[[Category:Readout Card Firmware]]&lt;br /&gt;
[[Category:Commanding| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_pn_calc.png&amp;diff=11090</id>
		<title>File:Math pn calc.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_pn_calc.png&amp;diff=11090"/>
		<updated>2026-01-05T22:48:31Z</updated>

		<summary type="html">&lt;p&gt;Dvw: p_n = \mathbf{err}_n + \left(1 - \frac{1}{2^k}\right) p_{n-1}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 p_n = \mathbf{err}_n + \left(1 - \frac{1}{2^k}\right) p_{n-1}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Data_mode&amp;diff=11089</id>
		<title>Data mode</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Data_mode&amp;diff=11089"/>
		<updated>2026-01-05T22:46:55Z</updated>

		<summary type="html">&lt;p&gt;Dvw: math&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;During data readout from the MCE, there are different types of data associated with each detector. These are:&lt;br /&gt;
&lt;br /&gt;
# calculated SQ1 feedback ('''''sq1_fb'''''): &lt;br /&gt;
#*[[File:Math_sq1_fb_eq.png|800px|alt=\mathbf{sq1\_fb}_{n+1} {{=}} \frac{1}{2^{12}} \left[\left(\mathbf{gainp} \times q_{n}\right) + \left(\mathbf{gaini} \times \sum_{i=1}^{n} \mathbf{error}_i\right) + \left(\mathbf{gaind} \times [\mathbf{error}_n - \mathbf{error}_{n-1}]\right)\right] ]]&lt;br /&gt;
#* where ''q''&amp;lt;sub&amp;gt;''n''&amp;lt;/sub&amp;gt; = '''error'''&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + ''b'' &amp;amp;times; ''q''&amp;lt;sub&amp;gt;''n''-1&amp;lt;/sub&amp;gt;&lt;br /&gt;
#* ''n'' is the multiplexing-frame index&lt;br /&gt;
#*''i'' is reset when the PID servo is restarted by setting the {{param|rc|servo_mode}} to 3 or {{param|rc|flx_lp_init}} to 1.&lt;br /&gt;
#*''b'' &amp;lt; 1 and specified by {{param|rc|pterm_decay_bits}}&lt;br /&gt;
# coadded error ('''''error'''''):&lt;br /&gt;
#* calculated from the Series-Array signal sampled @ 50MHz by the ADC&lt;br /&gt;
#* [[File:Math_error_eq.png|400px|alt=error {{=}} \sum_{1}^{sample\_num} (adc\_reading_{i} - adc\_offset)]]&lt;br /&gt;
# low-pass filtered SQ1 feedback ('''''sq1_fb_filtered'''''): &lt;br /&gt;
#*see [[ Digital 4-pole Butterworth Low-pass filter|4-pole Butterworth low-pass filter]].  &lt;br /&gt;
#* The effective DC gain, including quantization error, is approximately: '''sq1_fb_filtered'''&amp;lt;sub&amp;gt;''n''&amp;lt;/sub&amp;gt; ≈ 1218 &amp;amp;times; '''sq1_fb'''&amp;lt;sub&amp;gt;''n''-1&amp;lt;/sub&amp;gt;&lt;br /&gt;
# flux-jump counter ('''''num_flux_jumps''''').  See [[ Flux jumping ]].&lt;br /&gt;
# raw ADC samples @ 50 MHz ('''''raw''''').  See [[ Raw-mode readout ]].&lt;br /&gt;
&lt;br /&gt;
Note that '''''error''''', '''''sq1_fb''''', and '''''sq1_fb_filtered''''' are internally stored as 32 bits while '''''num_flux_jumps''''' are stored as 8 bits and '''''raw''''' as 14 bits. During readout the appropriate windowing is chosen for each data type.&lt;br /&gt;
== Data Modes and Windowing ==&lt;br /&gt;
The type of data reported by the MCE during data acquisition is determined by the MCE parameter {{param|rc|data_mode}}. Depending on the data mode, the reported data will be windowed in a different way. The notes in the table below explain the windowing, in terms of how many bits are reported and the relative scaling of the windowed value relative to some reference data mode. The reference data modes for error, sq1fb and filtered_sq1fb are, respectively, 0, 1, and 2. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! data-mode !! data-type !! Description !! RC Firmware Revision &lt;br /&gt;
|-&lt;br /&gt;
| 0 &lt;br /&gt;
|| &amp;lt;center&amp;gt;''error''&amp;lt;/center&amp;gt;&lt;br /&gt;
|| 32b (signed) co-added error &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:0] = error &lt;br /&gt;
&lt;br /&gt;
|| all&lt;br /&gt;
|-&lt;br /&gt;
| 1 &lt;br /&gt;
|| &amp;lt;center&amp;gt;''sq1_fb''&amp;lt;/center&amp;gt;&lt;br /&gt;
|| 32b (signed) calculated SQ1 feedback. &lt;br /&gt;
* [31:0] = sq1_fb * 2&amp;lt;sup&amp;gt;12&amp;lt;/sup&amp;gt;  when {{param|rc|servo_mode}} = 3&lt;br /&gt;
* [31:0] = sq1_fb when {{param|rc|servo_mode}} != 3&lt;br /&gt;
''Note that {{param|rc|servo_mode}}=3 is the normal running condition. The non-servoing form, used at times during array-auto-tune for example, is included here for completeness.&lt;br /&gt;
'' &lt;br /&gt;
|| all&lt;br /&gt;
|-&lt;br /&gt;
| 2 &lt;br /&gt;
|| &amp;lt;center&amp;gt;''filtered_sq1_fb''&amp;lt;/center&amp;gt;&lt;br /&gt;
||32b (signed) low-pass filtered SQ1 feedback data.   &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:0] = sq1_fb_filtered&lt;br /&gt;
&lt;br /&gt;
|| 2.0.5 and later&lt;br /&gt;
|-&lt;br /&gt;
| 3 obsolete &amp;lt;br /&amp;gt; (see 12)&lt;br /&gt;
|| &amp;lt;center&amp;gt;raw&amp;lt;/center&amp;gt;&lt;br /&gt;
|| Raw 50 MHz ADC samples raw[13:i], where i=0 in rev. 4.3.7 and i=6 in all previous firmware. &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:0] = raw_data / (2&amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt;),&lt;br /&gt;
&lt;br /&gt;
|| Only 3.0.6, 3.0.16, 3.0.25, 4.1.7, 4.2.7, 4.3.7&lt;br /&gt;
|-&lt;br /&gt;
| 4 &lt;br /&gt;
|| &amp;lt;center&amp;gt;18:14 mixed &amp;lt;/center&amp;gt;&lt;br /&gt;
||signed 18b SQ1 feedback + signed 14b coadded error   &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:14] = sq1_fb &lt;br /&gt;
* [13:0]  = error&lt;br /&gt;
&lt;br /&gt;
|| 2.0.9 and later&lt;br /&gt;
|-&lt;br /&gt;
| 5 &lt;br /&gt;
|| &amp;lt;center&amp;gt;24:8 mixed &amp;lt;/center&amp;gt;&lt;br /&gt;
|| signed 24b SQ1 feedback + signed 8b num_flux_jumps[7:0]. &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:8] = sq1_fb * 2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;&lt;br /&gt;
* [7:0]  = num_flux_jumps&lt;br /&gt;
&lt;br /&gt;
|| all&lt;br /&gt;
|-&lt;br /&gt;
| 6 obsolete &lt;br /&gt;
|| &amp;lt;center&amp;gt;18:14 mixed&amp;lt;/center&amp;gt;&lt;br /&gt;
|| signed 18b filtered data + signed 14b co-added &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:13] = sq1_fb_filtered / (2&amp;lt;sup&amp;gt;11&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* [12:0]  = error&lt;br /&gt;
&lt;br /&gt;
|| 3.0.30 to 4.0.6 only&lt;br /&gt;
|-&lt;br /&gt;
| 7 &lt;br /&gt;
|| &amp;lt;center&amp;gt;22:10 mixed&amp;lt;/center&amp;gt;&lt;br /&gt;
|| signed 22b filtered data + signed 10b coadded error&amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:10] = sq1_fb_filtered / (2&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* [9:0]   = error / (2&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
|| 4.0.2 and later&lt;br /&gt;
|-&lt;br /&gt;
| 8 obsolete&lt;br /&gt;
||&amp;lt;center&amp;gt;24:8 mixed&amp;lt;/center&amp;gt; &lt;br /&gt;
|| signed 24b filtered data  + signed 8b num_flux_jumps[7:0]. &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:8] = sq1_fb_filtered / (2&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* [7:0]  = num_flux_jumps&lt;br /&gt;
&lt;br /&gt;
|| 4.0.4 only&lt;br /&gt;
|-&lt;br /&gt;
| 9 obsolete&lt;br /&gt;
|| &amp;lt;center&amp;gt;24:8 mixed &amp;lt;/center&amp;gt;&lt;br /&gt;
|| signed 24b filtered data  + signed 8b num_flux_jumps[7:0]. &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:8] = sq1_fb_filtered/ (2&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* [7:0]  = num_flux_jumps &lt;br /&gt;
&lt;br /&gt;
|| 4.0.5 till 4.0.a&lt;br /&gt;
|-&lt;br /&gt;
| 10 &lt;br /&gt;
|| &amp;lt;center&amp;gt;25:7 mixed&amp;lt;/center&amp;gt;&lt;br /&gt;
|| Signed 25b filtered data + signed 7b num_flux_jumps. &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:7] = sq1_fb_filtered / (2&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* [6:0]  = num_flux_jumps&lt;br /&gt;
&lt;br /&gt;
|| 4.1.6, 4.0.b and later&lt;br /&gt;
|-&lt;br /&gt;
| 11 &lt;br /&gt;
|| &amp;lt;center&amp;gt;6:3 mixed, debugging mode &amp;lt;/center&amp;gt;&lt;br /&gt;
|| Unsigned 6b row_index + unsigned 3b column_index. &amp;lt;br /&amp;gt;&lt;br /&gt;
* [31:10] '''----'''&lt;br /&gt;
* [9:3] '''row_index'''&lt;br /&gt;
* [2:0] '''column_index'''&lt;br /&gt;
&lt;br /&gt;
|| 5.0.0 and later&lt;br /&gt;
|-&lt;br /&gt;
| 12 &lt;br /&gt;
||&amp;lt;center&amp;gt; raw&amp;lt;/center&amp;gt;&lt;br /&gt;
|| Raw 50 MHz ADC samples raw[13:0], sign-extended to 32 bits.&lt;br /&gt;
* [31:0] = raw_data&lt;br /&gt;
&lt;br /&gt;
|| 4.0.d, 4.0.e, 5.0.1+&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [[ MCE firmware ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Readout Card Firmware]]&lt;br /&gt;
[[Category:MAS]]&lt;br /&gt;
[[Category:MCE Script]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_error_eq.png&amp;diff=11088</id>
		<title>File:Math error eq.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_error_eq.png&amp;diff=11088"/>
		<updated>2026-01-05T22:42:58Z</updated>

		<summary type="html">&lt;p&gt;Dvw: \mathbf{error} = \sum_{1}^{\mathrm{sample\_num}} (\mathbf{adc\_reading}_{i} - \mathbf{adc\_offset})&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 \mathbf{error} = \sum_{1}^{\mathrm{sample\_num}} (\mathbf{adc\_reading}_{i} - \mathbf{adc\_offset})&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_sq1_fb_eq.png&amp;diff=11087</id>
		<title>File:Math sq1 fb eq.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_sq1_fb_eq.png&amp;diff=11087"/>
		<updated>2026-01-05T22:36:07Z</updated>

		<summary type="html">&lt;p&gt;Dvw: \mathbf{sq1\_fb}_{n+1} =  \frac{1}{2^{12}} \left[\left(\mathbf{gainp} \times q_{n}\right) + \left(\mathbf{gaini} \times \sum_{i=1}^{n} \mathbf{error}_i\right) + \left(\mathbf{gaind} \times [\mathbf{error}_n - \mathbf{error}_{n-1}]\right)\right]&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 \mathbf{sq1\_fb}_{n+1} =  \frac{1}{2^{12}} \left[\left(\mathbf{gainp} \times q_{n}\right) + \left(\mathbf{gaini} \times \sum_{i=1}^{n} \mathbf{error}_i\right) + \left(\mathbf{gaind} \times [\mathbf{error}_n - \mathbf{error}_{n-1}]\right)\right]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Digital_4-pole_Butterworth_Low-pass_filter&amp;diff=11086</id>
		<title>Digital 4-pole Butterworth Low-pass filter</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Digital_4-pole_Butterworth_Low-pass_filter&amp;diff=11086"/>
		<updated>2026-01-05T22:33:58Z</updated>

		<summary type="html">&lt;p&gt;Dvw: /* Filter Specification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
A digital 4-pole Butterworth low-pass filter is implemented as 2 cascaded biquads (2-pole topology) in the '''[[Readout card firmware]]''' of the MCE. The transfer function of the IIR filter is:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_butterworth.png|1000px|alt=H(z) {{=}} \frac {1+2 z^{-1}+z^{-2}}{1+b^*_{11} z^{-1}+b^*_{12} z^{-2}} \cdot 2^{-k_2} \cdot \frac {1+2z^{-1}+z^{-2}}{1+b^*_{21} z^{-1}+b^*_{22} z^{-2}} \cdot {2^{-k_1}}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Filter coefficients [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]], [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]], and truncation factors, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, are hard coded in older firmware (before '''version 5.1.0'''), but with modern firmware, they can be programmed through software:&lt;br /&gt;
&lt;br /&gt;
  wb rca {{param|rc|fltr_coeff}} ''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''b&amp;lt;sub&amp;gt;xy&amp;lt;/sub&amp;gt;'' is a quantized version of [[File:math_bxy_star.png|30px|alt=b^*_{xy}]] computed as: [[File:Math_bxy_eq.png|150px|alt=b_{xy} {{=}} \left\lfloor\left{{bar}}b^*_{xy}\right{{bar}} \times 2^{14}\right\rfloor]], where ⌊•⌋ indicates the floor function. Note that in order to accommodate the quantization effects, you have to follow the recipe prescribed in the [[#Filter Coefficients|Filter Coefficients section]] below when specifying the coefficients and truncation factors.&lt;br /&gt;
&lt;br /&gt;
There are 3 filter-related MCE parameters/commands:&lt;br /&gt;
* {{param|rc|fltr_type}}: to determine whether filter coefficients are hard-coded or configurable&lt;br /&gt;
* {{param|rc|fltr_coeff}}: to specify filter coefficients&lt;br /&gt;
* {{param|rc|fltr_rst}}: to reset the filter pipeline after changing coefficients&lt;br /&gt;
&lt;br /&gt;
== Filter Specification ==&lt;br /&gt;
Filter specification of the 4-pole Butterworth filter is determined by the filter coefficients [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]], [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]], described earlier.&lt;br /&gt;
&lt;br /&gt;
Assume: &lt;br /&gt;
&lt;br /&gt;
* '''''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;''' is the frequency at which the signal after filtering is √2 of its maximum value (nominally the read-out rate Nyquist frequency), and   &lt;br /&gt;
* '''''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt;''' is the sampling frequency, calculated as &amp;lt;code&amp;gt;(50&amp;amp;nbsp;Mhz) / (num_rows &amp;amp;times; row_len)&amp;lt;/code&amp;gt;. For example: &amp;lt;code&amp;gt;50&amp;amp;nbsp;MHz / (33 &amp;amp;times; 100) = 15151.5&amp;amp;nbsp;Hz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''Note that the filter ''f''&amp;lt;sub&amp;gt;3dB&amp;lt;/sub&amp;gt; scales if ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; changes.''&lt;br /&gt;
&lt;br /&gt;
; Type 1 (hard-coded coefficients)&lt;br /&gt;
: ''supported in all rc '''except''' 5.0.7''&lt;br /&gt;
: DC amplification = 1217.9148 &lt;br /&gt;
: ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15151&amp;amp;nbsp;Hz&lt;br /&gt;
: Gain @ 200&amp;amp;nbsp;Hz = 0.14189148 (wrt the DC gain) &lt;br /&gt;
&lt;br /&gt;
; Type 2 (hard-coded coefficients)&lt;br /&gt;
: ''supported '''only''' in rc version 5.0.7''&lt;br /&gt;
: DC amplification = 2044&lt;br /&gt;
: ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30000&amp;amp;nbsp;Hz&lt;br /&gt;
: A plot of the transfer function generated by simulating MCE firmware (VHDL) &lt;br /&gt;
[[File:mce_filter_type2_magnitude.png |150px]][[File:mce_filter_type2_phase.png|150px]]&lt;br /&gt;
&lt;br /&gt;
; Type 255 (configurable coefficients)&lt;br /&gt;
: ''supported in rc 5.1.0+''&lt;br /&gt;
: Quantized filter coefficients ''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; and truncation factors, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are parameterized and programmable by software. &lt;br /&gt;
&lt;br /&gt;
The fitler type can be determined by reading back the MCE parameter called {{param|rc|fltr_type}}. (supported in firmware 5.0.a+)&lt;br /&gt;
&lt;br /&gt;
The following plot shows the magnitude and the phase of Type 1 filter.&lt;br /&gt;
&lt;br /&gt;
Here is Elia's original plot [[Media:BW_filter.ps]]. Then we see the same plot with the impulse-response also added (by Joe, Nov 29, 2007): &lt;br /&gt;
[[Image: BW_filter2.png]]&lt;br /&gt;
&lt;br /&gt;
Here is the filter response for Scuba2 setting (''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 9.5&amp;amp;nbsp;kHz, ''f''&amp;lt;sub&amp;gt;readout&amp;lt;/sub&amp;gt; = 200&amp;amp;nbsp;Hz): [[Media: Filter fs10kHz 200Hzdecimated response.ps ]]&lt;br /&gt;
&lt;br /&gt;
== Filter-related Software changes ==&lt;br /&gt;
&lt;br /&gt;
=== Determining the filter type ===&lt;br /&gt;
&lt;br /&gt;
A {{param|rc|fltr_type}} parameter is introduced starting firmware 5.0.a:&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 1''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15151&amp;amp;nbsp;Hz&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 2''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30000&amp;amp;nbsp;Hz&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 255''': configurable coefficient&lt;br /&gt;
&lt;br /&gt;
All earlier firmware revisions are set to filter type 1 by default, except version 5.0.7 which is set to filter type 2.&lt;br /&gt;
&lt;br /&gt;
=== Software requirements ===&lt;br /&gt;
&lt;br /&gt;
* MAS - use mas/trunk r493 or later to get access to the {{param|rc|fltr_coeff}} MCE parameter.&lt;br /&gt;
** In [[mce.cin]], specify &amp;lt;code&amp;gt;$fw_rev[&amp;quot;rc&amp;quot;] = 0x5010000&amp;lt;/code&amp;gt; or greater.&lt;br /&gt;
* mce_script - use mce_script/trunk r764 or later&lt;br /&gt;
* In [[Mce config template system#experiment.cfg | experiment.cfg]]:&lt;br /&gt;
**specify one of:&lt;br /&gt;
  config_filter = 0;  #  do not write filter coefficients to the MCE&lt;br /&gt;
  config_filter = 1;  #  write filter coefficients to the MCE&lt;br /&gt;
and when config_filter = 1, the filter coefficients to be written to the MCE must be specified in the &amp;quot;filter_params&amp;quot; parameter, in the order [''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;],  e.g.:&lt;br /&gt;
  filter_params = [ 32092, 15750, 31238, 14895, 0, 11];  # type 1 filter, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15.151&amp;amp;nbsp;kHz&lt;br /&gt;
  filter_params = [ 32295, 15915, 32568, 16188, 3, 14];  # type 2 filter, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30&amp;amp;nbsp;kHz&lt;br /&gt;
  filter_params = [ 32295, 15915, 32568, 16188, 5, 12];  # type 2 filter with more inter-biquad dynamic range (recommended)&lt;br /&gt;
  filter_params = [ 32297, 15934, 31683, 15320, 0, 11];  # SCUBA-2 filter after 2011-06, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 12.97&amp;amp;nbsp;kHz&lt;br /&gt;
&lt;br /&gt;
== Code for simulations ==&lt;br /&gt;
&lt;br /&gt;
Note that as of mce_script r902, '''mce_data.py''' contains code for handling the MCE Butterworth filters.  This can be used to load filter parameters from a runfile, and to get the complex frequency response of a filter.  See [[mce_data.py#MCEButterworth_class]].&lt;br /&gt;
&lt;br /&gt;
A smaller, quicker python example:&lt;br /&gt;
[[ Media: mce_filt_py.txt ]]&lt;br /&gt;
&lt;br /&gt;
In this little IDL program you can find the functional form as a function of the frequency of the filter. First, Elia's original program, then as modified by Joe on November 29, 2007, then modified by Mandana on Jan. 14, 2009 for Scuba2 numbers:&lt;br /&gt;
* [[ Media: filter_pro.txt ]] &lt;br /&gt;
* [[ Media: filter_pro2.txt ]]&lt;br /&gt;
* [[ Media: low_pass_filter_model_pro.txt ]]&lt;br /&gt;
&lt;br /&gt;
=== Digital, time domain simulation codes ===&lt;br /&gt;
&lt;br /&gt;
Python-based model of a single biquad, in the time domain, for exploring digitization and dynamic range:&lt;br /&gt;
* [[ Media: biquad_time_domain_py.txt ]]&lt;br /&gt;
&lt;br /&gt;
== Filter Coefficients  ==&lt;br /&gt;
=== Butterworth Coefficients ===&lt;br /&gt;
The filter coefficients are generated using ''fdatool'' (Filter-design &amp;amp; Analysis tool, part of DSP Toolbox) in '''MATLAB/Simulink'''. These coefficients are floating numbers and in order to feed them to MCE firmware, they need to be quantized by converting to signed binary fractional (SBF) 1.14 format. You may use [[#Alternative to fdatool|alternate methods]] to generate coefficients. Here, we explain the method using ''fdatool''.&lt;br /&gt;
&lt;br /&gt;
Once you launch the ''fdatool'', choose the following settings:&lt;br /&gt;
&lt;br /&gt;
* Response Type: Low Pass&lt;br /&gt;
* Design Method: Butterworth&lt;br /&gt;
* Filter Order: 4&lt;br /&gt;
&lt;br /&gt;
* Frequency Specifications: &lt;br /&gt;
** For Type 1:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 12,195&amp;amp;nbsp;Hz = 50&amp;amp;nbsp;MHz/ (100 &amp;amp;times; 41)&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; = 100&amp;amp;nbsp;Hz&lt;br /&gt;
** For Type 2:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 30,000&amp;amp;nbsp;Hz ≈ 50&amp;amp;nbsp;MHz / (50 &amp;amp;times; 33)&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz&lt;br /&gt;
** For Type 255:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 50&amp;amp;nbsp;MHz / ({{param|sys|row_len}} &amp;amp;times; {{param|sys|num_rows}})&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;=''f''&amp;lt;sub&amp;gt;readout&amp;lt;/sub&amp;gt; / 2 (= ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; / {{param|cc|data_rate}} / 2, if using internal CC triggering)&lt;br /&gt;
* The attenuation at ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; is fixed at 3&amp;amp;nbsp;dB (half the passband power)&lt;br /&gt;
&lt;br /&gt;
Then click on Design Filter and you will get the following coefficients:&lt;br /&gt;
; Type 1 &lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9587428340882587  0.96134553442399129 &lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.00065067508393319923 (not implemented)&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9066292518523014  0.90916270571237567&lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;= 0.00063336346501859835  (not implemented)&lt;br /&gt;
&lt;br /&gt;
; Type 2 &lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9711486088510415  0.97139181456687917&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9878047097960421  0.98804997058724808 &lt;br /&gt;
:Gain = 1/(''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;amp;times; ''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)= 0.0000000037280516432624239  (not implemented)&lt;br /&gt;
&lt;br /&gt;
; Type 255&lt;br /&gt;
: Plug in your desired ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; and ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; in MATLAB fdatool and you will get a set of coefficients:&lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]]&lt;br /&gt;
:: Gain = 1/''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1 [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]]&lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Coefficient Quantization ===&lt;br /&gt;
The quantization format is signed-binary fractional (SBF) 1.14 and then 2's complement to be able to account for positive and negative values.&lt;br /&gt;
* Compute the quantised coefficients ''b&amp;lt;sub&amp;gt;xy&amp;lt;/sub&amp;gt;'' via: [[File:Math_bxy_eq.png|150px|alt=b_{xy} {{=}} \left\lfloor\left{{bar}}b^*_{xy}\right{{bar}} \times 2^{14}\right\rfloor]] (i.e. take the absolute value, multiply by 2&amp;lt;sup&amp;gt;14&amp;lt;/sup&amp;gt; and then drop the fractional part).&lt;br /&gt;
* [[File:Math_k1_eq.png|170px|alt=k_1 {{=}} \left\lfloor \log_2 g_2 \right\rfloor - 10]], the output-truncation (10 is a historical constant)&lt;br /&gt;
* [[File:Math_k2_eq.png|160px|alt=k_2 = 1 + \left\lfloor \log_2 g_1 \right\rfloor]], the inter-stage truncation&lt;br /&gt;
&lt;br /&gt;
For example, if we use this formula to quantize Type 1 coefficients listed above:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_coeff_calc.png|800px|alt=\begin{align}&lt;br /&gt;
   b_{11} &amp;amp;{{=}} \lfloor 1.9587428340882587 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 32092\\&lt;br /&gt;
   b_{12} &amp;amp;{{=}} \lfloor 0.96134553442399129 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 15750\\&lt;br /&gt;
   b_{21} &amp;amp;{{=}} \lfloor 1.9066292518523014 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 31238\\&lt;br /&gt;
   b_{22} &amp;amp;{{=}} \lfloor 0.90916270571237567 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 14895\\&lt;br /&gt;
   k_1 &amp;amp;{{=}} \left\lfloor \log_2 \left(1 / 0.00065067508393319923 \right)\right\rfloor - 10 &amp;amp;{{=}}&amp;amp;\ 0\\&lt;br /&gt;
   k_2 &amp;amp;{{=}} 1 + \left\lfloor \log_2 \left(1 / 0.00063336346501859835 \right)\right\rfloor &amp;amp;{{=}}&amp;amp;\ 11&lt;br /&gt;
\end{align}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;amp;lt; 16 and ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;lt; 32&lt;br /&gt;
* Now, if 32 &amp;amp;minus; ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;gt; 32, then you have to talk to UBC!&lt;br /&gt;
&lt;br /&gt;
:'''''The following ONLY concerns the MCE firmware developers:'''&lt;br /&gt;
&lt;br /&gt;
:Prior to firmware 5.1.0, the coefficients were hardcoded in  '''fsfb_calc_pack.vhd''' (FILTER_B11_COEF, FILTER_B12_COEF, FILTER_B21_COEFF, FILTER_B22_COEFF, FILTER_GAIN_WIDTH, FILTER_SCALE_LSB).''&lt;br /&gt;
&lt;br /&gt;
=== Calculating the DC Gain (''k'') ===&lt;br /&gt;
Note that in firmware, instead of ''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and ''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, an inter-biquad truncation of ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; (implemented as a binary shift) and ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, number of bits dropped after the second biquad, are implemented.&lt;br /&gt;
&lt;br /&gt;
Hence, the overall gain becomes [[File:Math_gain_eq.png|60px|alt=\frac {g_1 g_2}  {2^{(k_1 + k_2)}}]].&lt;br /&gt;
&lt;br /&gt;
:''(Note for firmware developers: see FILTER_GAIN_WIDTH and FILTER_SCALE_LSB in '''fsfb_calc_pack.vhd'''.) ''&lt;br /&gt;
&lt;br /&gt;
; Type 1&lt;br /&gt;
:''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 11, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0, the filter gain is estimated at 1184, but VHDL simulation results in a gain of 1216. &lt;br /&gt;
; Type 2&lt;br /&gt;
:''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 14, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 3, the filter gain is estimated at 2046, but VHDL simulation results in a gain of 2181. &lt;br /&gt;
&lt;br /&gt;
The gain difference can be attributed to the rounding effects associated with fixed-width arithmetic.&lt;br /&gt;
&lt;br /&gt;
To roughly compute the gain, including the effects from truncating the coefficients, reverse the quantization process to obtain the floating point values associated with your coefficients, and plug into the filter definition.  Here is a rough python program which computes the true gain for our Type 1 filter (''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt; = 32092, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt; = 15750, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt; = 31238, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; = 14895, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 11):&lt;br /&gt;
 from numpy import *&lt;br /&gt;
 # Sum of k1 and k2 shifts:&lt;br /&gt;
 k12 = 11+0&lt;br /&gt;
 # Quantized coefficients b11, b12, b21, b22:&lt;br /&gt;
 n = array([32092, 15750, 31238, 14895]).astype('float')&lt;br /&gt;
 # Re-float&lt;br /&gt;
 f = n/2**14&lt;br /&gt;
 # Compute gain&lt;br /&gt;
 gain = 16. / (2**k12 * (1 - f[0] + f[1]) * (1 - f[2] + f[3]))&lt;br /&gt;
 print gain&lt;br /&gt;
 # Result: 1217.8583043&lt;br /&gt;
&lt;br /&gt;
== Useful Links  ==&lt;br /&gt;
http://www.phas.ubc.ca/~mce/mcedocs/hardware/Firmware_block_spec/reaout_card/fsfb_calculations_rev1.11.pdf&lt;br /&gt;
&lt;br /&gt;
http://www.planetanalog.com/showArticle.jhtml?articleID=12802683&lt;br /&gt;
&lt;br /&gt;
== Alternative to fdatool ==&lt;br /&gt;
If you do not have access to fdatool or do not have DSP toolbox installed, you can use the following MATLAB functions (or equivalent in other packages) to get the coefficients:&lt;br /&gt;
* butter: is a matlab function to generate butterworth coefficients&lt;br /&gt;
* sos2tf: matlab function to break a transfer function to second-order sections&lt;br /&gt;
* bilinear: converts an s-domain (continuous) transfer function to z-domain (discrete) transfer function.&lt;br /&gt;
* Then run the following in matlab (or whatever syntax your tool has):&lt;br /&gt;
   num=[1 2 1]&lt;br /&gt;
   denum=[1 -1.9711486088510415  0.97139181456687917]&lt;br /&gt;
   max(dbode(num, denum, 1/fsamp) but also look at the bode-plot to make sure it is flat, otherwise read the max from the flat portion of the plot instead of the max function.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' When I used coefficients generated by [a,b] = butter(2, 50/20000); [SOS,G]=tf2sos(a,b), the filter was not as robust. not sure why?!&lt;br /&gt;
&lt;br /&gt;
[[Category:Readout Card Firmware]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Digital_4-pole_Butterworth_Low-pass_filter&amp;diff=11085</id>
		<title>Digital 4-pole Butterworth Low-pass filter</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Digital_4-pole_Butterworth_Low-pass_filter&amp;diff=11085"/>
		<updated>2026-01-05T22:33:11Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
A digital 4-pole Butterworth low-pass filter is implemented as 2 cascaded biquads (2-pole topology) in the '''[[Readout card firmware]]''' of the MCE. The transfer function of the IIR filter is:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_butterworth.png|1000px|alt=H(z) {{=}} \frac {1+2 z^{-1}+z^{-2}}{1+b^*_{11} z^{-1}+b^*_{12} z^{-2}} \cdot 2^{-k_2} \cdot \frac {1+2z^{-1}+z^{-2}}{1+b^*_{21} z^{-1}+b^*_{22} z^{-2}} \cdot {2^{-k_1}}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Filter coefficients [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]], [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]], and truncation factors, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, are hard coded in older firmware (before '''version 5.1.0'''), but with modern firmware, they can be programmed through software:&lt;br /&gt;
&lt;br /&gt;
  wb rca {{param|rc|fltr_coeff}} ''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt; ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where ''b&amp;lt;sub&amp;gt;xy&amp;lt;/sub&amp;gt;'' is a quantized version of [[File:math_bxy_star.png|30px|alt=b^*_{xy}]] computed as: [[File:Math_bxy_eq.png|150px|alt=b_{xy} {{=}} \left\lfloor\left{{bar}}b^*_{xy}\right{{bar}} \times 2^{14}\right\rfloor]], where ⌊•⌋ indicates the floor function. Note that in order to accommodate the quantization effects, you have to follow the recipe prescribed in the [[#Filter Coefficients|Filter Coefficients section]] below when specifying the coefficients and truncation factors.&lt;br /&gt;
&lt;br /&gt;
There are 3 filter-related MCE parameters/commands:&lt;br /&gt;
* {{param|rc|fltr_type}}: to determine whether filter coefficients are hard-coded or configurable&lt;br /&gt;
* {{param|rc|fltr_coeff}}: to specify filter coefficients&lt;br /&gt;
* {{param|rc|fltr_rst}}: to reset the filter pipeline after changing coefficients&lt;br /&gt;
&lt;br /&gt;
== Filter Specification ==&lt;br /&gt;
Filter specification of the 4-pole Butterworth filter is determined by the filter coefficients [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]], [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]], described earlier.&lt;br /&gt;
&lt;br /&gt;
Assume: &lt;br /&gt;
&lt;br /&gt;
* '''''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;''' is the frequency at which the signal after filtering is √2 of its maximum value (nominally the read-out rate Nyquist frequency), and   &lt;br /&gt;
* '''''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt;''' is the sampling frequency, calculated as &amp;lt;code&amp;gt;(50&amp;amp;nbspMhz) / (num_rows &amp;amp;times; row_len)&amp;lt;/code&amp;gt;. For example: &amp;lt;code&amp;gt;50&amp;amp;nbsp;MHz / (33 &amp;amp;times; 100) = 15151.5&amp;amp;nbsp;Hz&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''Note that the filter ''f''&amp;lt;sub&amp;gt;3dB&amp;lt;/sub&amp;gt; scales if ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; changes.''&lt;br /&gt;
&lt;br /&gt;
; Type 1 (hard-coded coefficients)&lt;br /&gt;
: ''supported in all rc '''except''' 5.0.7''&lt;br /&gt;
: DC amplification = 1217.9148 &lt;br /&gt;
: ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15151&amp;amp;nbsp;Hz&lt;br /&gt;
: Gain @ 200&amp;amp;nbsp;Hz = 0.14189148 (wrt the DC gain) &lt;br /&gt;
&lt;br /&gt;
; Type 2 (hard-coded coefficients)&lt;br /&gt;
: ''supported '''only''' in rc version 5.0.7''&lt;br /&gt;
: DC amplification = 2044&lt;br /&gt;
: ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30000&amp;amp;nbsp;Hz&lt;br /&gt;
: A plot of the transfer function generated by simulating MCE firmware (VHDL) &lt;br /&gt;
[[File:mce_filter_type2_magnitude.png |150px]][[File:mce_filter_type2_phase.png|150px]]&lt;br /&gt;
&lt;br /&gt;
; Type 255 (configurable coefficients)&lt;br /&gt;
: ''supported in rc 5.1.0+''&lt;br /&gt;
: Quantized filter coefficients ''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; and truncation factors, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; are parameterized and programmable by software. &lt;br /&gt;
&lt;br /&gt;
The fitler type can be determined by reading back the MCE parameter called {{param|rc|fltr_type}}. (supported in firmware 5.0.a+)&lt;br /&gt;
&lt;br /&gt;
The following plot shows the magnitude and the phase of Type 1 filter.&lt;br /&gt;
&lt;br /&gt;
Here is Elia's original plot [[Media:BW_filter.ps]]. Then we see the same plot with the impulse-response also added (by Joe, Nov 29, 2007): &lt;br /&gt;
[[Image: BW_filter2.png]]&lt;br /&gt;
&lt;br /&gt;
Here is the filter response for Scuba2 setting (''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 9.5&amp;amp;nbsp;kHz, ''f''&amp;lt;sub&amp;gt;readout&amp;lt;/sub&amp;gt; = 200&amp;amp;nbsp;Hz): [[Media: Filter fs10kHz 200Hzdecimated response.ps ]]&lt;br /&gt;
&lt;br /&gt;
== Filter-related Software changes ==&lt;br /&gt;
&lt;br /&gt;
=== Determining the filter type ===&lt;br /&gt;
&lt;br /&gt;
A {{param|rc|fltr_type}} parameter is introduced starting firmware 5.0.a:&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 1''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15151&amp;amp;nbsp;Hz&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 2''': ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; / ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30000&amp;amp;nbsp;Hz&lt;br /&gt;
* '''{{param|rc|fltr_type}} = 255''': configurable coefficient&lt;br /&gt;
&lt;br /&gt;
All earlier firmware revisions are set to filter type 1 by default, except version 5.0.7 which is set to filter type 2.&lt;br /&gt;
&lt;br /&gt;
=== Software requirements ===&lt;br /&gt;
&lt;br /&gt;
* MAS - use mas/trunk r493 or later to get access to the {{param|rc|fltr_coeff}} MCE parameter.&lt;br /&gt;
** In [[mce.cin]], specify &amp;lt;code&amp;gt;$fw_rev[&amp;quot;rc&amp;quot;] = 0x5010000&amp;lt;/code&amp;gt; or greater.&lt;br /&gt;
* mce_script - use mce_script/trunk r764 or later&lt;br /&gt;
* In [[Mce config template system#experiment.cfg | experiment.cfg]]:&lt;br /&gt;
**specify one of:&lt;br /&gt;
  config_filter = 0;  #  do not write filter coefficients to the MCE&lt;br /&gt;
  config_filter = 1;  #  write filter coefficients to the MCE&lt;br /&gt;
and when config_filter = 1, the filter coefficients to be written to the MCE must be specified in the &amp;quot;filter_params&amp;quot; parameter, in the order [''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt;, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;],  e.g.:&lt;br /&gt;
  filter_params = [ 32092, 15750, 31238, 14895, 0, 11];  # type 1 filter, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 122.226&amp;amp;nbsp;Hz / 15.151&amp;amp;nbsp;kHz&lt;br /&gt;
  filter_params = [ 32295, 15915, 32568, 16188, 3, 14];  # type 2 filter, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 30&amp;amp;nbsp;kHz&lt;br /&gt;
  filter_params = [ 32295, 15915, 32568, 16188, 5, 12];  # type 2 filter with more inter-biquad dynamic range (recommended)&lt;br /&gt;
  filter_params = [ 32297, 15934, 31683, 15320, 0, 11];  # SCUBA-2 filter after 2011-06, ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;/''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz / 12.97&amp;amp;nbsp;kHz&lt;br /&gt;
&lt;br /&gt;
== Code for simulations ==&lt;br /&gt;
&lt;br /&gt;
Note that as of mce_script r902, '''mce_data.py''' contains code for handling the MCE Butterworth filters.  This can be used to load filter parameters from a runfile, and to get the complex frequency response of a filter.  See [[mce_data.py#MCEButterworth_class]].&lt;br /&gt;
&lt;br /&gt;
A smaller, quicker python example:&lt;br /&gt;
[[ Media: mce_filt_py.txt ]]&lt;br /&gt;
&lt;br /&gt;
In this little IDL program you can find the functional form as a function of the frequency of the filter. First, Elia's original program, then as modified by Joe on November 29, 2007, then modified by Mandana on Jan. 14, 2009 for Scuba2 numbers:&lt;br /&gt;
* [[ Media: filter_pro.txt ]] &lt;br /&gt;
* [[ Media: filter_pro2.txt ]]&lt;br /&gt;
* [[ Media: low_pass_filter_model_pro.txt ]]&lt;br /&gt;
&lt;br /&gt;
=== Digital, time domain simulation codes ===&lt;br /&gt;
&lt;br /&gt;
Python-based model of a single biquad, in the time domain, for exploring digitization and dynamic range:&lt;br /&gt;
* [[ Media: biquad_time_domain_py.txt ]]&lt;br /&gt;
&lt;br /&gt;
== Filter Coefficients  ==&lt;br /&gt;
=== Butterworth Coefficients ===&lt;br /&gt;
The filter coefficients are generated using ''fdatool'' (Filter-design &amp;amp; Analysis tool, part of DSP Toolbox) in '''MATLAB/Simulink'''. These coefficients are floating numbers and in order to feed them to MCE firmware, they need to be quantized by converting to signed binary fractional (SBF) 1.14 format. You may use [[#Alternative to fdatool|alternate methods]] to generate coefficients. Here, we explain the method using ''fdatool''.&lt;br /&gt;
&lt;br /&gt;
Once you launch the ''fdatool'', choose the following settings:&lt;br /&gt;
&lt;br /&gt;
* Response Type: Low Pass&lt;br /&gt;
* Design Method: Butterworth&lt;br /&gt;
* Filter Order: 4&lt;br /&gt;
&lt;br /&gt;
* Frequency Specifications: &lt;br /&gt;
** For Type 1:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 12,195&amp;amp;nbsp;Hz = 50&amp;amp;nbsp;MHz/ (100 &amp;amp;times; 41)&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; = 100&amp;amp;nbsp;Hz&lt;br /&gt;
** For Type 2:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 30,000&amp;amp;nbsp;Hz ≈ 50&amp;amp;nbsp;MHz / (50 &amp;amp;times; 33)&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; = 75&amp;amp;nbsp;Hz&lt;br /&gt;
** For Type 255:&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; = 50&amp;amp;nbsp;MHz / ({{param|sys|row_len}} &amp;amp;times; {{param|sys|num_rows}})&lt;br /&gt;
*** ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt;=''f''&amp;lt;sub&amp;gt;readout&amp;lt;/sub&amp;gt; / 2 (= ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; / {{param|cc|data_rate}} / 2, if using internal CC triggering)&lt;br /&gt;
* The attenuation at ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; is fixed at 3&amp;amp;nbsp;dB (half the passband power)&lt;br /&gt;
&lt;br /&gt;
Then click on Design Filter and you will get the following coefficients:&lt;br /&gt;
; Type 1 &lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9587428340882587  0.96134553442399129 &lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0.00065067508393319923 (not implemented)&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9066292518523014  0.90916270571237567&lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;= 0.00063336346501859835  (not implemented)&lt;br /&gt;
&lt;br /&gt;
; Type 2 &lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9711486088510415  0.97139181456687917&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  -1.9878047097960421  0.98804997058724808 &lt;br /&gt;
:Gain = 1/(''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;amp;times; ''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;)= 0.0000000037280516432624239  (not implemented)&lt;br /&gt;
&lt;br /&gt;
; Type 255&lt;br /&gt;
: Plug in your desired ''f''&amp;lt;sub&amp;gt;samp&amp;lt;/sub&amp;gt; and ''f''&amp;lt;sub&amp;gt;cutoff&amp;lt;/sub&amp;gt; in MATLAB fdatool and you will get a set of coefficients:&lt;br /&gt;
:Section 1:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1  [[File:math_b11_star.png|30px|alt=b^*_{11}]], [[File:math_b12_star.png|30px|alt=b^*_{12}]]&lt;br /&gt;
:: Gain = 1/''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&lt;br /&gt;
:Section 2:&lt;br /&gt;
::Numerator: 1  2  1  &lt;br /&gt;
::Denominator: 1 [[File:math_b21_star.png|30px|alt=b^*_{21}]], [[File:math_b22_star.png|30px|alt=b^*_{22}]]&lt;br /&gt;
::Gain = 1/''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Coefficient Quantization ===&lt;br /&gt;
The quantization format is signed-binary fractional (SBF) 1.14 and then 2's complement to be able to account for positive and negative values.&lt;br /&gt;
* Compute the quantised coefficients ''b&amp;lt;sub&amp;gt;xy&amp;lt;/sub&amp;gt;'' via: [[File:Math_bxy_eq.png|150px|alt=b_{xy} {{=}} \left\lfloor\left{{bar}}b^*_{xy}\right{{bar}} \times 2^{14}\right\rfloor]] (i.e. take the absolute value, multiply by 2&amp;lt;sup&amp;gt;14&amp;lt;/sup&amp;gt; and then drop the fractional part).&lt;br /&gt;
* [[File:Math_k1_eq.png|170px|alt=k_1 {{=}} \left\lfloor \log_2 g_2 \right\rfloor - 10]], the output-truncation (10 is a historical constant)&lt;br /&gt;
* [[File:Math_k2_eq.png|160px|alt=k_2 = 1 + \left\lfloor \log_2 g_1 \right\rfloor]], the inter-stage truncation&lt;br /&gt;
&lt;br /&gt;
For example, if we use this formula to quantize Type 1 coefficients listed above:&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Math_coeff_calc.png|800px|alt=\begin{align}&lt;br /&gt;
   b_{11} &amp;amp;{{=}} \lfloor 1.9587428340882587 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 32092\\&lt;br /&gt;
   b_{12} &amp;amp;{{=}} \lfloor 0.96134553442399129 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 15750\\&lt;br /&gt;
   b_{21} &amp;amp;{{=}} \lfloor 1.9066292518523014 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 31238\\&lt;br /&gt;
   b_{22} &amp;amp;{{=}} \lfloor 0.90916270571237567 \times 2^{14}\rfloor &amp;amp;{{=}}&amp;amp;\ 14895\\&lt;br /&gt;
   k_1 &amp;amp;{{=}} \left\lfloor \log_2 \left(1 / 0.00065067508393319923 \right)\right\rfloor - 10 &amp;amp;{{=}}&amp;amp;\ 0\\&lt;br /&gt;
   k_2 &amp;amp;{{=}} 1 + \left\lfloor \log_2 \left(1 / 0.00063336346501859835 \right)\right\rfloor &amp;amp;{{=}}&amp;amp;\ 11&lt;br /&gt;
\end{align}]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; &amp;amp;lt; 16 and ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;lt; 32&lt;br /&gt;
* Now, if 32 &amp;amp;minus; ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; + ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; &amp;amp;gt; 32, then you have to talk to UBC!&lt;br /&gt;
&lt;br /&gt;
:'''''The following ONLY concerns the MCE firmware developers:'''&lt;br /&gt;
&lt;br /&gt;
:Prior to firmware 5.1.0, the coefficients were hardcoded in  '''fsfb_calc_pack.vhd''' (FILTER_B11_COEF, FILTER_B12_COEF, FILTER_B21_COEFF, FILTER_B22_COEFF, FILTER_GAIN_WIDTH, FILTER_SCALE_LSB).''&lt;br /&gt;
&lt;br /&gt;
=== Calculating the DC Gain (''k'') ===&lt;br /&gt;
Note that in firmware, instead of ''g''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; and ''g''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, an inter-biquad truncation of ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; (implemented as a binary shift) and ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, number of bits dropped after the second biquad, are implemented.&lt;br /&gt;
&lt;br /&gt;
Hence, the overall gain becomes [[File:Math_gain_eq.png|60px|alt=\frac {g_1 g_2}  {2^{(k_1 + k_2)}}]].&lt;br /&gt;
&lt;br /&gt;
:''(Note for firmware developers: see FILTER_GAIN_WIDTH and FILTER_SCALE_LSB in '''fsfb_calc_pack.vhd'''.) ''&lt;br /&gt;
&lt;br /&gt;
; Type 1&lt;br /&gt;
:''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 11, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0, the filter gain is estimated at 1184, but VHDL simulation results in a gain of 1216. &lt;br /&gt;
; Type 2&lt;br /&gt;
:''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 14, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 3, the filter gain is estimated at 2046, but VHDL simulation results in a gain of 2181. &lt;br /&gt;
&lt;br /&gt;
The gain difference can be attributed to the rounding effects associated with fixed-width arithmetic.&lt;br /&gt;
&lt;br /&gt;
To roughly compute the gain, including the effects from truncating the coefficients, reverse the quantization process to obtain the floating point values associated with your coefficients, and plug into the filter definition.  Here is a rough python program which computes the true gain for our Type 1 filter (''b''&amp;lt;sub&amp;gt;11&amp;lt;/sub&amp;gt; = 32092, ''b''&amp;lt;sub&amp;gt;12&amp;lt;/sub&amp;gt; = 15750, ''b''&amp;lt;sub&amp;gt;21&amp;lt;/sub&amp;gt; = 31238, ''b''&amp;lt;sub&amp;gt;22&amp;lt;/sub&amp;gt; = 14895, ''k''&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; = 0, ''k''&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; = 11):&lt;br /&gt;
 from numpy import *&lt;br /&gt;
 # Sum of k1 and k2 shifts:&lt;br /&gt;
 k12 = 11+0&lt;br /&gt;
 # Quantized coefficients b11, b12, b21, b22:&lt;br /&gt;
 n = array([32092, 15750, 31238, 14895]).astype('float')&lt;br /&gt;
 # Re-float&lt;br /&gt;
 f = n/2**14&lt;br /&gt;
 # Compute gain&lt;br /&gt;
 gain = 16. / (2**k12 * (1 - f[0] + f[1]) * (1 - f[2] + f[3]))&lt;br /&gt;
 print gain&lt;br /&gt;
 # Result: 1217.8583043&lt;br /&gt;
&lt;br /&gt;
== Useful Links  ==&lt;br /&gt;
http://www.phas.ubc.ca/~mce/mcedocs/hardware/Firmware_block_spec/reaout_card/fsfb_calculations_rev1.11.pdf&lt;br /&gt;
&lt;br /&gt;
http://www.planetanalog.com/showArticle.jhtml?articleID=12802683&lt;br /&gt;
&lt;br /&gt;
== Alternative to fdatool ==&lt;br /&gt;
If you do not have access to fdatool or do not have DSP toolbox installed, you can use the following MATLAB functions (or equivalent in other packages) to get the coefficients:&lt;br /&gt;
* butter: is a matlab function to generate butterworth coefficients&lt;br /&gt;
* sos2tf: matlab function to break a transfer function to second-order sections&lt;br /&gt;
* bilinear: converts an s-domain (continuous) transfer function to z-domain (discrete) transfer function.&lt;br /&gt;
* Then run the following in matlab (or whatever syntax your tool has):&lt;br /&gt;
   num=[1 2 1]&lt;br /&gt;
   denum=[1 -1.9711486088510415  0.97139181456687917]&lt;br /&gt;
   max(dbode(num, denum, 1/fsamp) but also look at the bode-plot to make sure it is flat, otherwise read the max from the flat portion of the plot instead of the max function.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' When I used coefficients generated by [a,b] = butter(2, 50/20000); [SOS,G]=tf2sos(a,b), the filter was not as robust. not sure why?!&lt;br /&gt;
&lt;br /&gt;
[[Category:Readout Card Firmware]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_gain_eq.png&amp;diff=11084</id>
		<title>File:Math gain eq.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_gain_eq.png&amp;diff=11084"/>
		<updated>2026-01-05T22:27:39Z</updated>

		<summary type="html">&lt;p&gt;Dvw: \frac {g_1 g_2} {2^{(k_1 + k_2)}}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 \frac {g_1 g_2} {2^{(k_1 + k_2)}}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_coeff_calc.png&amp;diff=11083</id>
		<title>File:Math coeff calc.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_coeff_calc.png&amp;diff=11083"/>
		<updated>2026-01-05T22:20:52Z</updated>

		<summary type="html">&lt;p&gt;Dvw: \begin{align}
    b_{11} &amp;amp;= \lfloor 1.9587428340882587 \times 2^{14}\rfloor &amp;amp;=&amp;amp;\ 32092\\
    b_{12} &amp;amp;= \lfloor 0.96134553442399129 \times 2^{14}\rfloor &amp;amp;=&amp;amp;\ 15750\\
    b_{21} &amp;amp;= \lfloor 1.9066292518523014 \times 2^{14}\rfloor &amp;amp;=&amp;amp;\ 31238\\
    b_{22} &amp;amp;...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 \begin{align}&lt;br /&gt;
    b_{11} &amp;amp;= \lfloor 1.9587428340882587 \times 2^{14}\rfloor &amp;amp;=&amp;amp;\ 32092\\&lt;br /&gt;
    b_{12} &amp;amp;= \lfloor 0.96134553442399129 \times 2^{14}\rfloor &amp;amp;=&amp;amp;\ 15750\\&lt;br /&gt;
    b_{21} &amp;amp;= \lfloor 1.9066292518523014 \times 2^{14}\rfloor &amp;amp;=&amp;amp;\ 31238\\&lt;br /&gt;
    b_{22} &amp;amp;= \lfloor 0.90916270571237567 \times 2^{14}\rfloor &amp;amp;=&amp;amp;\ 14895\\&lt;br /&gt;
    k_1 &amp;amp;= \left\lfloor \log_2 \left(1 / 0.00065067508393319923 \right)\right\rfloor - 10 &amp;amp;=&amp;amp;\ 0\\&lt;br /&gt;
    k_2 &amp;amp;= 1 + \left\lfloor \log_2 \left(1 / 0.00063336346501859835 \right)\right\rfloor &amp;amp;=&amp;amp;\ 11&lt;br /&gt;
 \end{align}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_k2_eq.png&amp;diff=11082</id>
		<title>File:Math k2 eq.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_k2_eq.png&amp;diff=11082"/>
		<updated>2026-01-05T22:13:58Z</updated>

		<summary type="html">&lt;p&gt;Dvw: k_2 = 1 + \left\lfloor \log_2 g_1 \right\rfloor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 k_2 = 1 + \left\lfloor \log_2 g_1 \right\rfloor&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_k1_eq.png&amp;diff=11081</id>
		<title>File:Math k1 eq.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_k1_eq.png&amp;diff=11081"/>
		<updated>2026-01-05T22:12:03Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 k_1 = \left\lfloor \log_2 g_2 \right\rfloor - 10&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_k1_eq.png&amp;diff=11080</id>
		<title>File:Math k1 eq.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_k1_eq.png&amp;diff=11080"/>
		<updated>2026-01-05T22:11:52Z</updated>

		<summary type="html">&lt;p&gt;Dvw: k_1 = \left\lfloor \log_2 g_2 \right\rfloor - 10&amp;lt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 k_1 = \left\lfloor \log_2 g_2 \right\rfloor - 10&amp;lt;&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Template:Bar&amp;diff=11079</id>
		<title>Template:Bar</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Template:Bar&amp;diff=11079"/>
		<updated>2026-01-05T22:04:19Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
== Documentation ==&lt;br /&gt;
This template can be used when you want to use a pipe/bar: &amp;quot;|&amp;quot; symbol somewhere where MediaWiki would treat it specially (e.g. in a template parameter).&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Template:Bar&amp;diff=11078</id>
		<title>Template:Bar</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Template:Bar&amp;diff=11078"/>
		<updated>2026-01-05T22:01:19Z</updated>

		<summary type="html">&lt;p&gt;Dvw: Created page with &amp;quot;|&amp;lt;noinclude&amp;gt; == Documentation == This template can be used when you want to use a pipe/bar: &amp;quot;|&amp;quot; symbol somewhere where MediaWiki would treat it specially (e.g. in a template p...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;|&amp;lt;noinclude&amp;gt;&lt;br /&gt;
== Documentation ==&lt;br /&gt;
This template can be used when you want to use a pipe/bar: &amp;quot;|&amp;quot; symbol somewhere where MediaWiki would treat it specially (e.g. in a template parameter).&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Template:%3D&amp;diff=11077</id>
		<title>Template:=</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Template:%3D&amp;diff=11077"/>
		<updated>2026-01-05T21:54:01Z</updated>

		<summary type="html">&lt;p&gt;Dvw: Created page with &amp;quot;=&amp;lt;noinclude&amp;gt; == Documentation == This template can be used to insert an equals sign in places where an equals sign is treated specially by the WikiMedia software (e.g. in temp...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=&amp;lt;noinclude&amp;gt;&lt;br /&gt;
== Documentation ==&lt;br /&gt;
This template can be used to insert an equals sign in places where an equals sign is treated specially by the WikiMedia software (e.g. in template arguments).&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_bxy_eq.png&amp;diff=11076</id>
		<title>File:Math bxy eq.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_bxy_eq.png&amp;diff=11076"/>
		<updated>2026-01-05T21:49:03Z</updated>

		<summary type="html">&lt;p&gt;Dvw: b_{xy} = \left\lfloor\left|b^*_{xy}\right| \times 2^{14}\right\rfloor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 b_{xy} = \left\lfloor\left|b^*_{xy}\right| \times 2^{14}\right\rfloor&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_bxy_star.png&amp;diff=11075</id>
		<title>File:Math bxy star.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_bxy_star.png&amp;diff=11075"/>
		<updated>2026-01-05T21:47:17Z</updated>

		<summary type="html">&lt;p&gt;Dvw: b^*_{xy}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 b^*_{xy}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_b22_star.png&amp;diff=11074</id>
		<title>File:Math b22 star.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_b22_star.png&amp;diff=11074"/>
		<updated>2026-01-05T21:46:20Z</updated>

		<summary type="html">&lt;p&gt;Dvw: b^*_{22}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 b^*_{22}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_b21_star.png&amp;diff=11073</id>
		<title>File:Math b21 star.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_b21_star.png&amp;diff=11073"/>
		<updated>2026-01-05T21:45:04Z</updated>

		<summary type="html">&lt;p&gt;Dvw: b^*_{21}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 b^*_{21}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_b12_star.png&amp;diff=11072</id>
		<title>File:Math b12 star.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_b12_star.png&amp;diff=11072"/>
		<updated>2026-01-05T21:43:32Z</updated>

		<summary type="html">&lt;p&gt;Dvw: b^*_{12}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 b^*_{12}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_butterworth.png&amp;diff=11071</id>
		<title>File:Math butterworth.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_butterworth.png&amp;diff=11071"/>
		<updated>2026-01-05T21:41:21Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Butterworth filter.&lt;br /&gt;
&lt;br /&gt;
 H(z) = \frac {1+2 z^{-1}+z^{-2}}{1+b^*_{11} z^{-1}+b^*_{12} z^{-2}} \cdot 2^{-k_2} \cdot \frac {1+2z^{-1}+z^{-2}}{1+b^*_{21} z^{-1}+b^*_{22} z^{-2}} \cdot {2^{-k_1}}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_b11_star.png&amp;diff=11070</id>
		<title>File:Math b11 star.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_b11_star.png&amp;diff=11070"/>
		<updated>2026-01-05T21:40:48Z</updated>

		<summary type="html">&lt;p&gt;Dvw: b^*_{11}&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
 b^*_{11}&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_butterworth.png&amp;diff=11069</id>
		<title>File:Math butterworth.png</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=File:Math_butterworth.png&amp;diff=11069"/>
		<updated>2026-01-05T21:36:08Z</updated>

		<summary type="html">&lt;p&gt;Dvw: Butterworth filter.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Butterworth filter.&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_firmware&amp;diff=7164</id>
		<title>MCE firmware</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_firmware&amp;diff=7164"/>
		<updated>2025-01-31T21:29:15Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|Firmware}}&lt;br /&gt;
== Releases ==&lt;br /&gt;
All firmware can be downloaded from [http://e-mode.phas.ubc.ca/mce/firmware/ http://e-mode.phas.ubc.ca/mce/firmware/]. Release notes for each firmware release can be found below:&lt;br /&gt;
* [[ Clock Card firmware]]&lt;br /&gt;
* [[ Readout Card firmware]]&lt;br /&gt;
* [[ Bias Card firmware]]&lt;br /&gt;
* [[ Address Card firmware]]&lt;br /&gt;
* [[ PCI card firmware ]]&lt;br /&gt;
* [[ Sync Box Firmware ]]&lt;br /&gt;
&lt;br /&gt;
See also:&lt;br /&gt;
* [[Recommended firmware versions]]&lt;br /&gt;
&lt;br /&gt;
== Loading firmware onto cards ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to load MCE firmware: &lt;br /&gt;
# [[ Remote Firmware Update | Remote firmware update over the MCE fibre interface]]&lt;br /&gt;
# Using Altera-supplied Hardware/Software and MCE Front-panel Connector&lt;br /&gt;
#* [[ USB Blaster | step-by-step instructions ]]&lt;br /&gt;
&lt;br /&gt;
Things to bear in mind:&lt;br /&gt;
* In v5+ firmware, if you update firmware on any readout card, the card doesn't reply to any command unless the Clock Card is also reprogrammed.&lt;br /&gt;
* Always cleanly reset the MCE after a power-up or a reconfiguration!  If not, MCE communication with the PC or Sync Box may not work.  On MAS prompt, type: '''''mce_reset_clean'''''&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
&lt;br /&gt;
* Source on GitHub: https://github.com/multi-channel-electronics/mce_firmware&lt;br /&gt;
* [[ MCE Timing Diagram ]]&lt;br /&gt;
* [[MCE fibre protocol]] - communication between the MCE and the controlling PC over the fibre-optic link&lt;br /&gt;
* [[MCE backplane protocol]] - communication between cards within the MCE&lt;br /&gt;
* Monitoring MCE Status [[http://www.phas.ubc.ca/%7Emce/mcedocs/system/monitoring_mce_status.doc DOC]] (Nov. 9, 2006)&lt;br /&gt;
* [[MCE commands]]&lt;br /&gt;
&lt;br /&gt;
== Firmware Development Tools ==&lt;br /&gt;
* [[ Quartus II Installation ]]&lt;br /&gt;
* [[ ModelSim SE Installation ]]&lt;br /&gt;
** [[ Setting up Altera libraries in ModelSim SE ]]&lt;br /&gt;
* [[ JAM Player ]]&lt;br /&gt;
* [[ Convert sof to jic for EPCS64 Serial Configuration Device ]]&lt;br /&gt;
&lt;br /&gt;
== Development notes ==&lt;br /&gt;
* [[intmce:MCE bugs]]&lt;br /&gt;
* [[intmce:Firmware Features Under Development]]&lt;br /&gt;
* [[intmce:Closed firmware features]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Firmware]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Template:MCE_hardware_table&amp;diff=7157</id>
		<title>Template:MCE hardware table</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Template:MCE_hardware_table&amp;diff=7157"/>
		<updated>2022-07-08T17:43:02Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component&lt;br /&gt;
! Type{{#if: {{{obsolete|}}}|/Part}}&lt;br /&gt;
! Doc. Id&lt;br /&gt;
! Technical&amp;lt;br/&amp;gt;Description&amp;lt;sup&amp;gt;&amp;amp;dagger;&amp;lt;/sup&amp;gt;&lt;br /&gt;
! Block&amp;lt;BR/&amp;gt;Diagram&amp;lt;sup&amp;gt;&amp;amp;dagger;&amp;lt;/sup&amp;gt;&lt;br /&gt;
! Schematics&lt;br /&gt;
! Rev.&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | [[Clock Card]]&lt;br /&gt;
| S581&lt;br /&gt;
| [[http://www.phas.ubc.ca/~mce/mcedocs/hardware/tech_description/CC_TechDescr.pdf PDF]]&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/cc_bd.pdf PDF]]&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Clock%20Card%20RevB/SC2-ELE-S581-101_RevB5_CC_Schematics.pdf PDF]]&lt;br /&gt;
| B5&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot; | [[Readout Card]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | S582&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/SC2_ELE_S582_501_readout_card_description.pdf PDF]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/rc_bd.pdf PDF]]&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Readout%20Card%20RevB/RO_S582_101BIss9_Schematic.pdf PDF]]&lt;br /&gt;
| B9&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Readout%20Card%20RevE/RC_C582_101E0_Schematic.pdf PDF]]&lt;br /&gt;
| E0&lt;br /&gt;
| Low-power RC&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;9&amp;quot; | [[Bias Card]]&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | S583&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/SC2_ELE_S583_501_bias_card_description.pdf PDF]]&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/bc_bd.pdf PDF]]&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevD/BC_S583_101DIss6_Schematics.pdf PDF]]&lt;br /&gt;
| D6&lt;br /&gt;
| Original design&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevD/SC2-ELE-S583-101-RevDIss7&amp;amp;8_BiasCard_Schematics.pdf PDF]]&lt;br /&gt;
| D7/8&lt;br /&gt;
| High-current det_bias&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevD/SC2-ELE-S583-101D10_D11_BC_Schematic.PDF PDF]]&lt;br /&gt;
| D11&lt;br /&gt;
| High-current det_bias/no heater&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevE/BC_ELE_C583_101E0_Schematic.pdf PDF]]&lt;br /&gt;
| E0&lt;br /&gt;
| Multiple det_bias lines&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevF/ELE-C583-101F_BiasCard_Schematic.PDF PDF]]&lt;br /&gt;
| F0&lt;br /&gt;
| Multi det_bias &amp;amp; MHz-response bias lines; Low-noise bias lines turned off&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevF/ELE-C583-101F1_BiasCard_Schematic.PDF PDF]]&lt;br /&gt;
| F1&lt;br /&gt;
| Power turned off on ln_bias&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevF/ELE-C583-101F2_BiasCard_Schematic.PDF PDF]]&lt;br /&gt;
| F2&lt;br /&gt;
| Minor change in ln_bias circuit&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevF/ELE-C583-101F3_BiasCard_Schematic.PDF PDF]]&lt;br /&gt;
| F3&lt;br /&gt;
| low 1/f-noise opamp for channel 0-15&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Bias%20Card%20RevF/ELE-C583-101F4_BiasCard_Schematic.PDF PDF]]&lt;br /&gt;
| F4&lt;br /&gt;
| low 1/f-noise opamp for channel 15-31&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot; | [[Address Card]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | S584&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/AC_TechDescr.pdf PDF]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/ac_bd.pdf PDF]]&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Address%20Card%20RevC/AC_S584_101CIss4_Schematics.pdf PDF]]&lt;br /&gt;
| C4&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Address%20Card%20RevD/AC_S584_101_RevDIss0_Schematics.pdf PDF]]&lt;br /&gt;
| D0&lt;br /&gt;
|&lt;br /&gt;
{{#if: {{{obsolete|}}}|&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} rowspan=&amp;quot;6&amp;quot; {{!}} [[Instrument Backplane]]&lt;br /&gt;
{{!}} rowspan=&amp;quot;2&amp;quot; {{!}} MCEv1&lt;br /&gt;
{{!}} rowspan=&amp;quot;2&amp;quot; {{!}} S587-101&lt;br /&gt;
{{!}} rowspan=&amp;quot;6&amp;quot; {{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/instr_backplane_descr.pdf PDF]]&lt;br /&gt;
{{!}} rowspan=&amp;quot;2&amp;quot; {{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Instrument%20Backplane%20RevC/S587-101_Inst_Backplane_Schematics.pdf PDF]]&lt;br /&gt;
{{!}} C3&lt;br /&gt;
{{!}} Obsolete&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Instrument%20Backplane%20RevC/S587-101CI5_Inst_Backplane_Schematics.pdf PDF]]&lt;br /&gt;
{{!}} C5&lt;br /&gt;
{{!}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if: {{{obsolete|}}}||&lt;br /&gt;
{{!}} rowspan=&amp;quot;4&amp;quot; {{!}} [[Instrument Backplane]]&lt;br /&gt;
}}&lt;br /&gt;
| {{#if: {{{obsolete|}}}|MCEv2}} 5MDM&lt;br /&gt;
| C587-201&lt;br /&gt;
{{#if: {{{obsolete|}}}||&lt;br /&gt;
{{!}} rowspan=&amp;quot;4&amp;quot; {{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/instr_backplane_descr.pdf PDF]]&lt;br /&gt;
}}&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/mceV2_InstrumentBackplane/ELE_C587-201_RevA0_Inst_Backplane_Schematics.pdf PDF]]&lt;br /&gt;
| A&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{#if: {{{obsolete|}}}|MCEv2}} 3MDM &lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | C587-101&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/ELE-C580-100_MCEv2_Instrument_Bus_Block_Diagram.pdf PDF]]&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/mceV2_InstrumentBackplane/ELE-C587-101_RevB_Inst_Backplane_Schematic.pdf PDF]]&lt;br /&gt;
| B&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/mceV2_InstrumentBackplane/ELE-C587-101_RevC1_3MDM_Inst_Backplane_Schematics.pdf PDF]]&lt;br /&gt;
| C1&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/mceV2_InstrumentBackplane/ELE-C587-101_RevC2_3MDM_Inst_Backplane_Schematics.pdf PDF]]&lt;br /&gt;
| C2&lt;br /&gt;
|&lt;br /&gt;
{{#if: {{{obsolete|}}}|&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} [[Bus Backplane]]&lt;br /&gt;
{{!}} MCEv1&lt;br /&gt;
{{!}} S586&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/bus_backplane_descr.pdf PDF]]&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/Firmware_block_spec/atc_blkdia/fw_blkdia/Subrack.pdf PDF]]&lt;br /&gt;
{{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} C&lt;br /&gt;
{{!}} Obsolete&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if: {{{obsolete|}}}||&lt;br /&gt;
{{!}} rowspan=&amp;quot;2&amp;quot; {{!}} [[Bus Backplane]]&lt;br /&gt;
}}&lt;br /&gt;
| {{#if: {{{obsolete|}}}|MCEv2}} 3MDM&lt;br /&gt;
| C586-101&lt;br /&gt;
{{#if: {{{obsolete|}}}||&lt;br /&gt;
{{!}} rowspan=&amp;quot;2&amp;quot; {{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/bus_backplane_descr.pdf PDF]]&lt;br /&gt;
}}&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/mceV2_BusBackplane_RevD/ELE-C586-101_BusBP_Schematic%20Prints.pdf PDF]]&lt;br /&gt;
| A&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#if: {{{obsolete|}}}|MCEv2}} 5MDM&lt;br /&gt;
| C586-201&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/mceV2_BusBackplane_RevD/ELE-C586-201_RevD0_BusBp_Schematics.pdf PDF]]&lt;br /&gt;
| D&lt;br /&gt;
| &lt;br /&gt;
{{#if: {{{obsolete|}}}|&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} [[Filter Board]]&lt;br /&gt;
{{!}} MCEv1&lt;br /&gt;
{{!}} S587-111&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/Filter%20Board/FB_S587_111BIss2_Schematics.pdf PDF]]&lt;br /&gt;
{{!}} B2&lt;br /&gt;
{{!}} Obsolete&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if: {{{obsolete|}}}||&lt;br /&gt;
{{!}} rowspan=&amp;quot;2&amp;quot; {{!}} [[Filter Board]]&lt;br /&gt;
}}&lt;br /&gt;
| {{#if: {{{obsolete|}}}|MCEv2}} 3MDM&lt;br /&gt;
| C587-111&lt;br /&gt;
{{#if: {{{obsolete|}}}||&lt;br /&gt;
{{!}} rowspan=&amp;quot;2&amp;quot; {{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} rowspan=&amp;quot;2&amp;quot; {{!}} &amp;amp;mdash;&lt;br /&gt;
}}&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/mceV2_Filter_Board/ELE-C587-111_Filter_Schematic.pdf PDF]]&lt;br /&gt;
| A&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{#if: {{{obsolete|}}}|MCEv2}} 5MDM&lt;br /&gt;
| C587-210&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/mceV2_Filter_Board/ELE-C587-210_Filter_Schematics.pdf PDF]]&lt;br /&gt;
| A&lt;br /&gt;
|&lt;br /&gt;
{{#if: {{{obsolete|}}}|&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} [[Power Supply Assembly]]&lt;br /&gt;
{{!}} [[PSU]]&lt;br /&gt;
{{!}} S585-103&lt;br /&gt;
{{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/SCUBA-2%20Power%20Supply%20Specification%20Aug-26-2005%20JM%20WH.doc DOC]]&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/PowerSupplyUnit/PSU_S585_103B_20060502_schematics.pdf PDF]]&lt;br /&gt;
{{!}} B&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} Obsolete&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} [[PSUC]]&lt;br /&gt;
{{!}} S585-102&lt;br /&gt;
{{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/PowerSupplyController/PSUC%20S585_102GIss8%20Schematic.pdf PDF]]&lt;br /&gt;
{{!}} G8&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} Wiring&lt;br /&gt;
{{!}} S585-104&lt;br /&gt;
{{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/documentation/schematics_pcb/SC2-ELE-S585-104_RevB_PSA_Wiring_Diagram.pdf PDF]]&lt;br /&gt;
{{!}} B&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
'''&amp;lt;sup&amp;gt;&amp;amp;dagger;&amp;lt;/sup&amp;gt;''': Not updated since early design stages.&lt;br /&gt;
&lt;br /&gt;
=== External Hardware and Accessories ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Component&lt;br /&gt;
! Part&lt;br /&gt;
! Doc. Id&lt;br /&gt;
! Technical&amp;lt;br/&amp;gt;Description&amp;lt;sup&amp;gt;&amp;amp;dagger;&amp;lt;/sup&amp;gt;&lt;br /&gt;
! Block&amp;lt;BR/&amp;gt;Diagram&lt;br /&gt;
! Schematics&lt;br /&gt;
! Rev.&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | [[MDM Breakout Board]]&lt;br /&gt;
| S58H&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/MDM%20Pinout/SubrackIB-TestPinouts1b_Rev2.1.xls XLS]]&lt;br /&gt;
| B&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | [[Linear Feed Card]]&lt;br /&gt;
| C585-104&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/PLA/Linear_PS_MCE_Adaptor-ELE-C585-104_RevB.pdf PDF]]&lt;br /&gt;
| B&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | [[Vicor Power Assembly]]&lt;br /&gt;
| PCB&lt;br /&gt;
| C585-401&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/PowerSupplyVicor/ELE_C585-401_RevC2_VicorPSU_Schematics.pdf PDF]]&lt;br /&gt;
| C2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| Wiring Harness&lt;br /&gt;
| C584-402&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/PowerSupplyVicor/ELE-C584-402_RevA_Wiring_Harness.pdf PDF]]&lt;br /&gt;
| A&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | [[Sync Box]]&lt;br /&gt;
| PCB&lt;br /&gt;
| S589-101&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/SyncBox_UserGuide_S589_502.pdf PDF]]&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/SC2-ELE-S589-101_RevA2_SyncGen_Schematics.pdf PDF]]&lt;br /&gt;
| A2&lt;br /&gt;
| Used in both Sync Box enclosures&lt;br /&gt;
|-&lt;br /&gt;
| AC-in: Internal Wiring&lt;br /&gt;
| S589-102&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/S589-001_Syncbox_Block_Diagram.pdf PDF]]&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/S589-102_SyncBox_Wiring_Diagram.pdf PDF]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | A2&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| AC-in: Cable Wiring&lt;br /&gt;
| S589-103&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/S589-103_SyncBox_IO_Cable_Wiring.pdf PDF]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| DC-in: Internal Wiring&lt;br /&gt;
| C589-102&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/ELE-C589-101B_DC-In_Sync_Blk_Diagram.pdf PDF]]&lt;br /&gt;
| [[https://phas.ubc.ca/~mce/mcedocs/hardware/schematics/SyncBox/ELE-C589-102_Sync_Box_Connector_Pinouts_Rev4.pdf PDF]]&lt;br /&gt;
| A&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | [[PCI fibre card]]&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/others/SDSU/250hzPCI_schematic.pdf PDF]]&lt;br /&gt;
| 5A&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | [[Extender Card]]&lt;br /&gt;
| S565-008&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/ext_card_descr.pdf PDF]]&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/ExtenderCard/extender_card_sc2_ele_s58A_101B PDF]]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | [[IB Tester]]&lt;br /&gt;
| S58E-502&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/tech_description/sc2-ele-s58e-502_gpib_ib_tester_description.pdf PDF]]&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/IB%20Tester/ELE-S58E-101C_GPIB_IB_Tester_Schmatics.pdf PDF]]&lt;br /&gt;
| C&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot; | [[2-slot Backplane]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | S58G&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/2slot_bp/SC2_ELE_S58G_101.pdf PDF]]&lt;br /&gt;
| A&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/2slot_bp/2-slot_bp_SC2_ELE_S565_101_RevB0.pdf PDF]]&lt;br /&gt;
| B&lt;br /&gt;
|&lt;br /&gt;
{{#if: {{{obsolete|}}}|&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} colspan=&amp;quot;2&amp;quot; {{!}} SCUBA2 24V Power Distribution&lt;br /&gt;
{{!}} S565-010&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/pdrdocs/24v_ps_descr.pdf PDF]]&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/24v_pwr_distr.pdf PDF]]&lt;br /&gt;
{{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}} Obsolete&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} [[AC-DC Unit]] &lt;br /&gt;
{{!}} Rectifier Board&lt;br /&gt;
{{!}} S588-103&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/PowerSupplyUnit/SCUBA-2%20Power%20Supply%20Specification%20Aug-26-2005%20JM%20WH.doc DOC]]&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} &amp;amp;mdash;&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/acdcu/S588_103A_acdcu_rect_%28051128gf%29.pdf PDF]]&lt;br /&gt;
{{!}} A&lt;br /&gt;
{{!}} rowspan=&amp;quot;3&amp;quot; {{!}} Obsolete&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} Controller Board&lt;br /&gt;
{{!}} S588-104&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/acdcu/S588_104A_acdcu_cntrl_%28060719gf%29.pdf PDF]]&lt;br /&gt;
{{!}} A&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} Wiring&lt;br /&gt;
{{!}} S588-105&lt;br /&gt;
{{!}} [[http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/acdcu/S588_105A_acdcu_wiring_%28060719gf%29.pdf PDF]]&lt;br /&gt;
{{!}} A&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
'''&amp;lt;sup&amp;gt;&amp;amp;dagger;&amp;lt;/sup&amp;gt;''': Not updated since early design stages.&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
This template contains the hardware document table.  It comes in two flavours:&lt;br /&gt;
&lt;br /&gt;
== Modern ==&lt;br /&gt;
  &amp;amp;#123;&amp;amp;#123;MCE hardware table}}&lt;br /&gt;
&lt;br /&gt;
is used on [[MCE hardware]] and produces:&lt;br /&gt;
{{MCE hardware table}}&lt;br /&gt;
&lt;br /&gt;
== Legacy ==&lt;br /&gt;
  &amp;amp;#123;&amp;amp;#123;MCE hardware table{{!}}obsolete=yes}}&lt;br /&gt;
is used on [[Old MCE Documents]] and produces:&lt;br /&gt;
{{MCE hardware table|obsolete=yes}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Sync_Box&amp;diff=7156</id>
		<title>Sync Box</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Sync_Box&amp;diff=7156"/>
		<updated>2022-06-11T02:18:28Z</updated>

		<summary type="html">&lt;p&gt;Dvw: /* Documents */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|Sync Box}}&lt;br /&gt;
[[Image:Sync_Box_DC-In_Chassis.JPG|thumb| A 5VDC-in Sync Box with six of eight transmitters installed]] &lt;br /&gt;
[[Image:Sync_Box_AC-In_Rack_Mount.JPG|thumb|A rack-mount AC-in Sync Box - Back]] &lt;br /&gt;
[[Image:Sync_Box_AC-In_Rack_Mount_Front.JPG|thumb|A rack-mount AC-in Sync Box - Front]] &lt;br /&gt;
The '''Sync Box''' generates a data-valid pulse along with a sequential 32-bit number to synchronize the data-acquisition operation of up-to 8 MCE subracks and other housekeeping equipment. The 32-bit number can be used to stamp all collected data points. The Sync Box has 8 fibre outputs to connect to the MCE subracks and few TTL/RS485 outputs to be used by other housekeeping equipment.  User commands are input to the Sync Box via RS-232.  The CPLD generates a serial bit stream which is Manchester encoded with a 25MHz clock, and contains information for occurrences of &amp;lt;tt&amp;gt;address_zero&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;data_valid&amp;lt;/tt&amp;gt;, and also a frame sequence number.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
=== Power consumption ===&lt;br /&gt;
Excluding the fibre transmitters, the sync box consumes 1.35W.  Each fibre transmitter (Avago HFBR-1119TZ) consumes 185mA x 5V = 0.925W, so a sync box with all eight tranmitters populated consumes 8.75W.  To minimise power consumption, only the required number of transmitters should be populated.  Input power is either 5V or 24V, depending on configuration.&lt;br /&gt;
&lt;br /&gt;
=== Approximate dimensions ===&lt;br /&gt;
;Size: 5cm × 20cm × 25cm&lt;br /&gt;
;Weight: 600 grams&lt;br /&gt;
&lt;br /&gt;
The obsolete, rack-mount AC-in sync box was 2U (9cm) × 19 inches (48cm) × 21cm deep and weighed 1.9kg.&lt;br /&gt;
&lt;br /&gt;
== External connectors and I/O ==&lt;br /&gt;
:''These are the connectors and pinout for the DC-in sync box.  For the connector pinout of the obsolete AC-in sync box, see [[Sync Box AC-in Rack Mount I/O]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;CP1&amp;quot;&amp;gt;CP1: DC power in&amp;lt;/span&amp;gt; ===&lt;br /&gt;
Different connectors are used for 5V and 24V input.&lt;br /&gt;
;5V&lt;br /&gt;
* Box connector is an AMP 206486-1.  +5VDC on pins 1 and 2.  Return on pins 3 and 6.  Other pins not populated.  Pins 3 and 6 are connected to sync box ground.&lt;br /&gt;
:[[File:Sync box 5v in.png]]&lt;br /&gt;
* mating connector on the power brick is: AMP 206485-1&lt;br /&gt;
;24V&lt;br /&gt;
* Box connector is an Amphenol PT-2A-14-5P.  +24VDC on pins B and C.  Return on pins D and E.  Pin A is not connected.  Unlike the 5V-in sync box, the 24V-in sync box isolates pins D and E from sync box ground.&lt;br /&gt;
:[[File:small_mcc_power.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;CJ2&amp;quot;&amp;gt;CJ2: RS-232 command port&amp;lt;/span&amp;gt; ===&lt;br /&gt;
A nine pin DE-9F provides the serial command port.  See [[#RS-232 communication and commanding|RS-232 communication and commanding]] below for details.  The only lines wired through to the Atmel processor are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin !! Signal&lt;br /&gt;
|-&lt;br /&gt;
| 2 || TxD&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RxD&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DSR&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GND&lt;br /&gt;
|}&lt;br /&gt;
Don't rely on &amp;lt;tt&amp;gt;DSR&amp;lt;/tt&amp;gt;.  Assume no hardware or software flow control.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;CJ3&amp;quot;&amp;gt;CJ3: Digital I/O&amp;lt;/span&amp;gt; ===&lt;br /&gt;
A twenty five pin DB-25F is used for digital I/O.  Pins 1, 2, and 14 are inputs.  All other pins are outputs.  All grounds, including pin 14, are connected in the sync box to sync box ground.&lt;br /&gt;
&lt;br /&gt;
In [[#RTS mode vs Free-run mode|RTS mode]], any falling edge of &amp;lt;tt&amp;gt;Data_Valid&amp;lt;/tt&amp;gt; will be taken as a RTS DV signal.  In Free Run mode, this input is ignored.&lt;br /&gt;
&lt;br /&gt;
There are two pairs of RS485 outputs which provide a NRZ and clock version of the DV sync word.  &amp;lt;tt&amp;gt;Data_Sync_1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Data_Sync_4&amp;lt;/tt&amp;gt; have the clock and &amp;lt;tt&amp;gt;Data_Sync_2&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Data_Sync_3&amp;lt;/tt&amp;gt; have the NRZ sync word.   There are also TTL versions of &amp;lt;tt&amp;gt;Data_sync_3&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Data_Sync_4&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note: the output contains only the DV sync word, not the single-zero-bit ARZ occurrences between DVs.  For firmware versions before 1f, the clock rate is fixed at 5MHz.  Later versions allow changing the clock rate by setting a divisor, ''d'', with the '''&amp;lt;tt&amp;gt;ckd&amp;lt;/tt&amp;gt;''' command.  In these versions the clock rate is 50MHz &amp;amp;divide; ''d''.  The default value of ''d'' is 10 (meaning the default clock rate remains 5MHz).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin || Signal !! Pin !! Signal&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  1 || style=&amp;quot;background: #F99&amp;quot; rowspan=2&amp;quot; | Data_Valid RS485− || colspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 14 || style=&amp;quot;background: #F99&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  2 || style=&amp;quot;background: #F99&amp;quot; rowspan=2&amp;quot; | Data_Valid RS485+&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #9F9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 15 || style=&amp;quot;background: #9F9&amp;quot; rowspan=2&amp;quot; | Data_Sync_1 RS485−&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #9F9&amp;quot; rowspan=&amp;quot;2&amp;quot; |  3 || style=&amp;quot;background: #9F9&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #9F9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 16 || style=&amp;quot;background: #9F9&amp;quot; rowspan=2&amp;quot; | Data_Sync_1 RS485+&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99F&amp;quot; rowspan=&amp;quot;2&amp;quot; |  4 || style=&amp;quot;background: #99F&amp;quot; rowspan=2&amp;quot; | Data_Sync_2 RS485−&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99F&amp;quot; rowspan=&amp;quot;2&amp;quot; | 17 || style=&amp;quot;background: #99F&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99F&amp;quot; rowspan=&amp;quot;2&amp;quot; |  5 || style=&amp;quot;background: #99F&amp;quot; rowspan=2&amp;quot; | Data_Sync_2 RS485+&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 18 || style=&amp;quot;background: #FF9&amp;quot; rowspan=2&amp;quot; | Data_Sync_3 RS485−&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF9&amp;quot; rowspan=&amp;quot;2&amp;quot; |  6 || style=&amp;quot;background: #FF9&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 19 || style=&amp;quot;background: #FF9&amp;quot; rowspan=2&amp;quot; | Data_Sync_3 RS485+&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #EE9&amp;quot; rowspan=&amp;quot;2&amp;quot; |  7 || style=&amp;quot;background: #EE9&amp;quot; rowspan=2&amp;quot; | Data_Sync_3 TTL&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #EE9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 20 || style=&amp;quot;background: #EE9&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F9F&amp;quot; rowspan=&amp;quot;2&amp;quot; |  8 || style=&amp;quot;background: #F9F&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F9F&amp;quot; rowspan=&amp;quot;2&amp;quot; | 21 || style=&amp;quot;background: #F9F&amp;quot; rowspan=2&amp;quot; | Data_Sync_4 RS485−&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #E9E&amp;quot; rowspan=&amp;quot;2&amp;quot; |  9 || style=&amp;quot;background: #E9E&amp;quot; rowspan=2&amp;quot; | Data_Sync_4 TTL&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F9F&amp;quot; rowspan=&amp;quot;2&amp;quot; | 22 || style=&amp;quot;background: #F9F&amp;quot; rowspan=2&amp;quot; | Data_Sync_4 RS485+&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 10 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #E9E&amp;quot; rowspan=&amp;quot;2&amp;quot; | 23 || style=&amp;quot;background: #E9E&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 11 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 24 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 12 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 25 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 13 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;CP4&amp;quot;&amp;gt;CP4: ACDCU&amp;lt;/span&amp;gt; ===&lt;br /&gt;
:''Note: to make full use of these, firmware updates are needed.''&lt;br /&gt;
The ACDCU connector is a DB-25M.  It can be used for general purpose I/O.  Originally, these lines were used to control associated [[AC-DC Unit]]s, which are no longer in production.  In most cases, this connector is left unpopulated.  All grounds are connected in the sync box to sync box ground.  The '''&amp;lt;tt&amp;gt;ps&amp;lt;/tt&amp;gt;''' command will read these lines and report them as a hex-encoded byte:&lt;br /&gt;
 Synco&amp;gt; ps&lt;br /&gt;
        ACDCU_Status = 0X7B&lt;br /&gt;
The '''&amp;lt;tt&amp;gt;dpu&amp;lt;/tt&amp;gt;''', '''&amp;lt;tt&amp;gt;dpa&amp;lt;/tt&amp;gt;''', '''&amp;lt;tt&amp;gt;epa&amp;lt;/tt&amp;gt;''', and '''&amp;lt;tt&amp;gt;pof&amp;lt;/tt&amp;gt;''' commands can be used to control them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin || Signal !! Pin !! Signal&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FFBE99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  1 || style=&amp;quot;background: #FFBE99&amp;quot; rowspan=2&amp;quot; | Aux_in_1 || colspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FFBE99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 14 || style=&amp;quot;background: #FFBE99&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FFBE99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  2 || style=&amp;quot;background: #FFBE99&amp;quot; rowspan=2&amp;quot; | Aux_out_1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99FFD8&amp;quot; rowspan=&amp;quot;2&amp;quot; | 15 || style=&amp;quot;background: #99FFD8&amp;quot; rowspan=2&amp;quot; | Aux_in_2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99FFD8&amp;quot; rowspan=&amp;quot;2&amp;quot; |  3 || style=&amp;quot;background: #99FFD8&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99FFD8&amp;quot; rowspan=&amp;quot;2&amp;quot; | 16 || style=&amp;quot;background: #99FFD8&amp;quot; rowspan=2&amp;quot; | Aux_out_2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F199FF&amp;quot; rowspan=&amp;quot;2&amp;quot; |  4 || style=&amp;quot;background: #F199FF&amp;quot; rowspan=2&amp;quot; | Aux_in_3&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F199FF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 17 || style=&amp;quot;background: #F199FF&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F199FF&amp;quot; rowspan=&amp;quot;2&amp;quot; |  5 || style=&amp;quot;background: #F199FF&amp;quot; rowspan=2&amp;quot; | Aux_out_3&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F3FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 18 || style=&amp;quot;background: #F3FF99&amp;quot; rowspan=2&amp;quot; | Aux_in_4&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F3FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  6 || style=&amp;quot;background: #F3FF99&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F3FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 19 || style=&amp;quot;background: #F3FF99&amp;quot; rowspan=2&amp;quot; | Aux_out_4&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99DAFF&amp;quot; rowspan=&amp;quot;2&amp;quot; |  7 || style=&amp;quot;background: #99DAFF&amp;quot; rowspan=2&amp;quot; | Aux_in_5&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99DAFF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 20 || style=&amp;quot;background: #99DAFF&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99DAFF&amp;quot; rowspan=&amp;quot;2&amp;quot; |  8 || style=&amp;quot;background: #99DAFF&amp;quot; rowspan=2&amp;quot; | Aux_out_5&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF99C0&amp;quot; rowspan=&amp;quot;2&amp;quot; | 21 || style=&amp;quot;background: #FF99C0&amp;quot; rowspan=2&amp;quot; | Aux_in_6&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF99C0&amp;quot; rowspan=&amp;quot;2&amp;quot; |  9 || style=&amp;quot;background: #FF99C0&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF99C0&amp;quot; rowspan=&amp;quot;2&amp;quot; | 22 || style=&amp;quot;background: #FF99C0&amp;quot; rowspan=2&amp;quot; | Aux_out_6&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A7FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 10 || style=&amp;quot;background: #A7FF99&amp;quot; rowspan=2&amp;quot; | Aux_in_7&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A7FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 23 || style=&amp;quot;background: #A7FF99&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A7FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 11 || style=&amp;quot;background: #A7FF99&amp;quot; rowspan=2&amp;quot; | Aux_out_7&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A599FF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 24 || style=&amp;quot;background: #A599FF&amp;quot; rowspan=2&amp;quot; | Aux_in_8&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A599FF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 12 || style=&amp;quot;background: #A599FF&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A599FF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 25 || style=&amp;quot;background: #A599FF&amp;quot; rowspan=2&amp;quot; | Aux_out_8&lt;br /&gt;
|-&lt;br /&gt;
|                             rowspan=&amp;quot;2&amp;quot; | 13 ||                             rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CJ5: TTL in ===&lt;br /&gt;
A female BNC used to provide an external TTL clock.  The line is 50-ohm terminated.  Ground (outer conductor) is connected to sync box ground.  ''Note: this input is currently ignored in firmware.''&lt;br /&gt;
&lt;br /&gt;
=== CJ6: TTL out ===&lt;br /&gt;
A female BNC providing a NRZ version of the [[#The Manchester output stream|output stream]].  The line is 50-ohm terminated.  Ground (outer conductor) is connected to sync box ground.&lt;br /&gt;
&lt;br /&gt;
=== MCE0 through MCE7: Fibre outputs ===&lt;br /&gt;
There are up to eight fibre-optic outputs (some which may not be populated to reduce power consumption).  These outputs are connected to MCE [[Clock Card]] sync-in connection.  The fibre-optic outputs are divided into two groups of four each, which allow the possibility for dual-rate operation.  All outputs provide the [[#The Manchester output stream|Manchester-encoded output stream]].&lt;br /&gt;
&lt;br /&gt;
=== Reset button ===&lt;br /&gt;
Pressing the reset momentary switch restarts the sync box control program and resets all parameters to their default values.&lt;br /&gt;
&lt;br /&gt;
=== Front panel LEDs ===&lt;br /&gt;
* '''Power (green)''': The power LED is on whenever the sync box is powered on. Note: because the power for this LED is teed off of the power wiring harness (see schematic above), in cases where P5 has become disconnected, with external power applied, this lamp will be lit without the sync box actually being powered.&lt;br /&gt;
* '''Free run (yellow)''': The free-run LED is on whenever the sync box is in free-run mode.&lt;br /&gt;
* '''DV error (red)''': The DV error LED is turned on whenever more than one [[#CJ3|RTS DV pulse]] is received between successive address-reutrns-to-zero (ARZs); see [[#The Manchester output stream|The Manchester output stream]] below. It is turned off at the next ARZ.  This cannot occur in free-run mode.&lt;br /&gt;
&lt;br /&gt;
== Schematics ==&lt;br /&gt;
Here is a box diagram of the 5VDC-in sync box.  The 24VDC-in sync box includes a 24-to-5V DC-DC converter module between the front panel power connector (CP1) and P5 on the sync board.  The obsolete AC-in sync box also uses the same sync board, but has different external connections.&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
[[File:Sync box schematic.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Documents ===&lt;br /&gt;
* [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/SC2-ELE-S589-101_RevA2_SyncGen_Schematics.pdf Sync Board Schematics (S589-101)]&lt;br /&gt;
* Block Diagram: &lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/S589-001_Syncbox_Block_Diagram.pdf rack-mount AC-in Sync Box (S589-001)]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/ELE-C589-111A_5VDC_Sync_Box_Block_Diagram.pdf 5V DC-in Sync Box (C589-111A)]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/ELE-C589-121A_24VDC_Sync_Box_Block_Diagram.pdf 24V DC-in Sync Box (C589-121A)]&lt;br /&gt;
* Wiring Diagrams&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/ELE-C589-102_Sync_Box_Connector_Pinouts_Rev4.pdf DC-in Sync Box Wiring (C589-102)]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/S589-102_SyncBox_Wiring_Diagram.pdf rack-mount AC-in Sync Box Wiring]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/S589-103_SyncBox_IO_Cable_Wiring.pdf Cable connection to rack-mount Sync Box]&lt;br /&gt;
&lt;br /&gt;
== RTS mode vs Free-run mode ==&lt;br /&gt;
The sync box operates either in free-run mode (the default) or else RTS mode.  When in free-run mode, the sync box generates its own data valid (DV) triggers by down-counting occurrences of address-return-to-zero (ARZ), which occur at a rate of 25MHz &amp;amp;times; &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; &amp;amp;times; &amp;lt;tt&amp;gt;num_rows&amp;lt;/tt&amp;gt;.  The &amp;lt;tt&amp;gt;data_rate&amp;lt;/tt&amp;gt; parameter to '''&amp;lt;tt&amp;gt;fr&amp;lt;/tt&amp;gt;''' indicates how many ARZ occurrences occur between successive DVs.&lt;br /&gt;
&lt;br /&gt;
In RTS mode, &amp;lt;tt&amp;gt;data_rate&amp;lt;/tt&amp;gt; is ignored.  Instead, the sync box waits for a falling edge on the &amp;lt;tt&amp;gt;[[#CJ3|Data_Valid]]&amp;lt;/tt&amp;gt; RS485 digital input.  When a falling edge is detected, a DV will be output on the next ARZ.  If multiple falling edges are detected before an ARZ, only a single DV will be issued.  (That is: only one external DV trigger is honoured per ARZ.)&lt;br /&gt;
&lt;br /&gt;
These days, almost everyone uses free-run mode.&lt;br /&gt;
&lt;br /&gt;
== The Manchester output stream ==&lt;br /&gt;
By default, the Manchester output bit-stream encodes simply the 25MHz clock as a series of (Manchester-encoded) one bits.  Exceptions to this are:&lt;br /&gt;
* '''Address-Return-to-Zero (ARZ)''': Occurrences of ARZ are encoded into the Manchester bit-stream as a single binary zero.  ARZ occurs at a rate of 25MHz &amp;amp;times; &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; &amp;amp;times; &amp;lt;tt&amp;gt;num_rows&amp;lt;/tt&amp;gt;, regardless of operating mode (free-run or RTS).&lt;br /&gt;
* '''Data Valid sync word''': This is a 40-bit sequence which is output on certain ARZ occurrences.  In free-run mode, the &amp;lt;tt&amp;gt;data_rate&amp;lt;/tt&amp;gt; parameter indicates the number of ARZs between successive DV sync word output.  In [[#RTS mode vs Free-run mode|RTS mode]], it can be output on ''every'' ARZ, but only if a [[#CJ3|RTS DV pulse]] has arrived since the last ARZ.  On ARZs where the DV sync word is not output, only the ARZ bit will be zero (all other bits will be 1).&lt;br /&gt;
&lt;br /&gt;
:The 40-bit DV sync word looks like this; bit zero is sent first:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  zd-fe--- Nnnnnnnn nnnnnnnn nnnnnnnn nnnnnnnn&lt;br /&gt;
  0        0        1        2        3&lt;br /&gt;
  0        8        6        4        2&lt;br /&gt;
&lt;br /&gt;
:where:&lt;br /&gt;
&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt;''' is the address-return-to-zero (ARZ) bit (always zero)&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;d&amp;lt;/tt&amp;gt;''' is the data valid bit (always zero)&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;-&amp;lt;/tt&amp;gt;''' are reserved (unused) sync-word status bits&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;f&amp;lt;/tt&amp;gt;''' is one when operating in free-run mode and zero when in RTS mode&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;e&amp;lt;/tt&amp;gt;''' is the &amp;lt;tt&amp;gt;dv_error&amp;lt;/tt&amp;gt; bit.  It is one if in RTS mode and more than one RTS DV pulse was received since the last ARZ.  Zero otherwise (including always zero in free-run mode).&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;Nnn...&amp;lt;/tt&amp;gt;''' is the 32-bit frame sequence number.  The most significant bit (''N'') is sent first.&lt;br /&gt;
&lt;br /&gt;
== Firmware ==&lt;br /&gt;
:''See: [[Sync Box Firmware]]''&lt;br /&gt;
The sync box program comes in two parts: a program that runs on the Atmel microcontroller, and another that runs on the CPLD.  For information on how to obtain the firmware, how to reprogram your sync box, and access to the source code, see [[Sync Box Firmware]].&lt;br /&gt;
&lt;br /&gt;
== RS-232 communication and commanding ==&lt;br /&gt;
Commands are sent to the Sync Box over a 9600 baud RS-232 link, with no hardware or software flow control, connected to an Atmel AT89C5131A-M, an 8-bit, 80C51-compatible single-chip microcontroller.  Input command variables are checked by the command processor and loaded one byte at a time into the sync generator CPLD over programmed I/O connections with eight bits for data and an eight-bit address.&lt;br /&gt;
&lt;br /&gt;
Text returned by the sync box over RS232 use carriage return for line termination.  Most Linux users will need to tell minicom (or whatever serial terminal they use) to add line feeds to avoid all output being overwritten on the same line.&lt;br /&gt;
&lt;br /&gt;
More than one command may be put on a single input command line, up to a maximum of 12 tokens (commands + arguments), and 80 characters.&lt;br /&gt;
&lt;br /&gt;
=== Command summary ===&lt;br /&gt;
The sync box responds to the following commands over the RS-232 link:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
! Default&lt;br /&gt;
! [[Sync Box Firmware|FW]]&amp;lt;br/&amp;gt;Version&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;h&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Help: print a list of commands.&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | all&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;?&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Shows the [[#Status output|current sync box parameters and status]].&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | &amp;lt;tt&amp;gt;rl&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Set &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; to ''n'' where 1 &amp;amp;le; ''n'' &amp;amp;le; 4095&amp;lt;br/&amp;gt;&lt;br /&gt;
'''''NB:'''''  Because the sync box clock is 25MHz, this value should be ''half'' the value of the corresponding MCE {{param|sys|row_len}}. For example, to have a {{param|sys|row_len}} of 100 on the MCE, set this value to 50.  Also, &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; &amp;amp;times; &amp;lt;tt&amp;gt;num_rows&amp;lt;/tt&amp;gt; must be &amp;amp;ge; 250.&lt;br /&gt;
| 64 &lt;br /&gt;
| &amp;amp;le; 1f&lt;br /&gt;
|-&lt;br /&gt;
| 53&lt;br /&gt;
| 20, 21&lt;br /&gt;
|-&lt;br /&gt;
| 50&lt;br /&gt;
| &amp;amp;ge; 22&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | &amp;lt;tt&amp;gt;nr&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Set {{param|cc|num_rows}} to ''n'' where 1 &amp;amp;le; ''n'' &amp;amp;le; 63&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; &amp;amp;times; &amp;lt;tt&amp;gt;num_rows&amp;lt;/tt&amp;gt; must be &amp;amp;ge; 250.&lt;br /&gt;
| 41&lt;br /&gt;
| &amp;amp;le; 1f&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| &amp;amp;ge; 20&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;rt&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Enable RTS mode (turn off free-run mode).&lt;br /&gt;
| Off&lt;br /&gt;
| all&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | &amp;lt;tt&amp;gt;fr&amp;lt;/tt&amp;gt; [''n'']&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Enable free-run mode (turn off RTS mode) and set {{param|cc|data_rate}} to ''n'' where 1 &amp;amp;le; ''n'' &amp;amp;le; 4095.  If ''n'' is omitted, the previously commanded value for &amp;lt;tt&amp;gt;data_rate&amp;lt;/tt&amp;gt; is re-used.&lt;br /&gt;
| 47&lt;br /&gt;
| &amp;amp;le; 1f&lt;br /&gt;
|-&lt;br /&gt;
| 120&lt;br /&gt;
| 20, 21&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| &amp;amp;ge; 22&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;fn&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Set frame sequence number to ''n'' where 0 &amp;amp;le; ''n'' &amp;amp;le; 2&amp;lt;sup&amp;gt;32&amp;lt;/sup&amp;gt;&amp;amp;minus;1&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| all&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;ckd&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Set the clock divisor to ''n'' where 1 &amp;amp;le; ''n'' &amp;amp;le; 255.  The NRZ output clock is 50MHz &amp;amp;divide; ''n''.  Before version 1f, the divisor is fixed at 10 (5MHz clock).&lt;br /&gt;
| 10&lt;br /&gt;
| &amp;amp;ge; 1f&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Enable Manchester and DV outputs.&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | On&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | all&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;st&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Disable Manchester and DV outputs.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;dpa&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Disable all power outputs.&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | All on&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;dpu&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Disable power output ''n'' where 0 &amp;amp;le; ''n'' &amp;amp;le; 7&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;epu&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Enable power output ''n'' where 0 &amp;amp;le; ''n'' &amp;amp;le; 7&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;pof&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Get ACDCU on/off control byte&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;ps&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Get ACDCU status byte&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;bank&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Change target MCE bank for commands. ''n''=0 for both (unbanked); ''n''=1 for low bank (MCE1&amp;amp;ndash;4); ''n''=2 for high bank (MCE5&amp;amp;ndash;8)&lt;br /&gt;
| 0&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;ge; 31&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;eeprom&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Enter [[#EEPROM manipulation mode|EEPROM manipulation mode]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;re&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Reset sync box to default state.&lt;br /&gt;
| all&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; style=&amp;quot;text-align:center&amp;quot; | &lt;br /&gt;
=== EEPROM manipulation mode ===&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; | ''Note: this menu is activated by the ''&amp;lt;tt&amp;gt;eeprom&amp;lt;/tt&amp;gt;'' command from the main menu.''&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;h&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Help: print a list of EEPROM manipulation mode commands.&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | &amp;amp;ge; 31&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;exit&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Leave EEPROM manipulation mode and return to the main menu.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;dump&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Dump the contents of the EEPROM.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;load&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Load the Sync Box configuration saved to the EEPROM, overwriting the currently-running configuration.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;save&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Save the currently-running Sync Box configuration to the EEPROM.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;enable_boot&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Load the saved configuration from the EEPROM on boot.&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Off&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;disable_boot&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Don't load the configuration saved to EEPROM on boot.  Instead, the baked-in default configuration hard-coded in the code will be used.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Status output ===&lt;br /&gt;
The '''&amp;lt;tt&amp;gt;?&amp;lt;/tt&amp;gt;''' command produces output similar to this:&lt;br /&gt;
&lt;br /&gt;
 Synco&amp;gt; ?&lt;br /&gt;
 Mancho_Enable = ON&lt;br /&gt;
 DV_Mode = FreeRun_DV&lt;br /&gt;
 Frun_Count = 47&lt;br /&gt;
 Row_len = 64&lt;br /&gt;
 Num_Row = 41&lt;br /&gt;
 ACDCU_onoff = 0X00&lt;br /&gt;
&lt;br /&gt;
=== Command error messages ===&lt;br /&gt;
Some example error messages:&lt;br /&gt;
 Synco&amp;gt; xx       WHAT? &amp;quot;xx&amp;quot;      // Unrecognised command&lt;br /&gt;
 Synco&amp;gt; rl 9999  TOO BIG &amp;quot;9999&amp;quot;  // Parameter too large&lt;br /&gt;
 Synco&amp;gt; rl 0     TOO SMALL &amp;quot;0&amp;quot;   // Parameter too small&lt;br /&gt;
 Synco&amp;gt; rl xx    WHAT? &amp;quot;xx&amp;quot;      // Parameter could not be parsed&lt;br /&gt;
&lt;br /&gt;
=== Using minicom in Linux ===&lt;br /&gt;
To issue commands to a Sync Box over an RS-232 line, you can use a Linux program called &amp;lt;tt&amp;gt;minicom&amp;lt;/tt&amp;gt;.  To install this application, do:&lt;br /&gt;
 sudo apt-get install minicom&lt;br /&gt;
To start MiniCom:&lt;br /&gt;
 sudo minicom&lt;br /&gt;
Minicom needs the following options changed for it to work properly:&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;a&amp;gt; (to turn on line feeds)&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Serial port setup&amp;gt; &amp;lt;Serial Device&amp;gt; = /dev/ttyS0&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Serial port setup&amp;gt; &amp;lt;Bps/Par/Bits&amp;gt; = 9600 8N1&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Serial port setup&amp;gt; &amp;lt;Hardware Flow Control&amp;gt; = No&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Serial port setup&amp;gt; &amp;lt;Software Flow Control&amp;gt; = No&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Modem and dialing&amp;gt; &amp;lt;Modem has DCD line&amp;gt; = No&lt;br /&gt;
After you modify these settings, remember to save, exit, and restart Minicom.&lt;br /&gt;
&lt;br /&gt;
== Enabling sync box use in the MCE ==&lt;br /&gt;
To check that the sync box is connected correctly to the MCE, issue the command&lt;br /&gt;
 wb cc {{param|cc|select_clk}} 1&lt;br /&gt;
and then read back the value:&lt;br /&gt;
 rb cc {{param|cc|select_clk}}&lt;br /&gt;
 Line   0 : ok : 1&lt;br /&gt;
&lt;br /&gt;
Setting {{param|cc|select_clk}} to 1 tells the MCE to sync its internal clock with the clock signal encoded from the sync box.  If the MCE does not see the sync box, the parameter will revert to zero (internal clock) in about one second.&lt;br /&gt;
&lt;br /&gt;
To accept sync triggers and serial numbers from the sync box, two more commands are needed:&lt;br /&gt;
 wb cc {{param|cc|use_sync}} 2&lt;br /&gt;
 wb cc {{param|cc|use_dv}} 2&lt;br /&gt;
&lt;br /&gt;
These registers are configured automatically by the config system if the parameters &amp;lt;tt&amp;gt;hardware_sync=1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config_sync=1&amp;lt;/tt&amp;gt; in [[experiment.cfg]].  If you change the values in &amp;lt;tt&amp;gt;$MAS_DATA/experiment.cfg&amp;lt;/tt&amp;gt; instead of &amp;lt;tt&amp;gt;$MAS_CONFIG/experiment.cfg&amp;lt;/tt&amp;gt;, remember to run &amp;lt;tt&amp;gt;[[mce_make_config]]&amp;lt;/tt&amp;gt; before re-running the config script.&lt;br /&gt;
&lt;br /&gt;
Also be sure that you have the correct [[mce.cfg]] file.  A quick way to check that sync numbers are getting into the MCE frame data is to take some frames and check the data using the [[eat_packets]] tool:&lt;br /&gt;
 &lt;br /&gt;
 $  mce_run sync_test 400 s&lt;br /&gt;
 RUNFILE_NAME=/data/cryo/current_data//sync_test.run&lt;br /&gt;
 FRAME_BASENAME=/data/cryo/current_data//sync_test&lt;br /&gt;
 &lt;br /&gt;
 $ eat_packets -n 5424 -f $MAS_DATA/sync_test&lt;br /&gt;
 Forced     frame_size=1356 (5424)&lt;br /&gt;
 offset     frm_idx   frame#&lt;br /&gt;
 0000000000        0        0  surprise sync_dv 4168076, after sequence [0,0)&lt;br /&gt;
 EOF, exiting after 10000 frames + 0 bytes&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;tt&amp;gt;[[mce_run]]&amp;lt;/tt&amp;gt; does not terminate quickly, the sync box may not be properly connected to the MCE.  If &amp;lt;tt&amp;gt;eat_packets&amp;lt;/tt&amp;gt; complains only about the first frame (offset 00000000), then the sync numbers are intact and incrementing contiguously.  If &amp;lt;tt&amp;gt;eat_packets&amp;lt;/tt&amp;gt; complains about pretty much every frame, the sync numbers are not being inserted into the frame data.&lt;br /&gt;
&lt;br /&gt;
== Legacy documents ==&lt;br /&gt;
* The original &amp;quot;Sync Box User's Guide&amp;quot; is available here:&lt;br /&gt;
:http://www.phas.ubc.ca/~mce/mcedocs/hardware/tech_description/SyncBox_UserGuide_S589_502.pdf&lt;br /&gt;
:'''Please note:''' it is rather out of date (being last updated in 2007), and known to be wrong in places.  All relevant information from the guide should be available on this wiki.&lt;br /&gt;
&lt;br /&gt;
[[Category:Sync Box| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Sync_Box&amp;diff=7155</id>
		<title>Sync Box</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Sync_Box&amp;diff=7155"/>
		<updated>2022-06-11T02:15:43Z</updated>

		<summary type="html">&lt;p&gt;Dvw: /* CJ3: Digital I/O */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|Sync Box}}&lt;br /&gt;
[[Image:Sync_Box_DC-In_Chassis.JPG|thumb| A 5VDC-in Sync Box with six of eight transmitters installed]] &lt;br /&gt;
[[Image:Sync_Box_AC-In_Rack_Mount.JPG|thumb|A rack-mount AC-in Sync Box - Back]] &lt;br /&gt;
[[Image:Sync_Box_AC-In_Rack_Mount_Front.JPG|thumb|A rack-mount AC-in Sync Box - Front]] &lt;br /&gt;
The '''Sync Box''' generates a data-valid pulse along with a sequential 32-bit number to synchronize the data-acquisition operation of up-to 8 MCE subracks and other housekeeping equipment. The 32-bit number can be used to stamp all collected data points. The Sync Box has 8 fibre outputs to connect to the MCE subracks and few TTL/RS485 outputs to be used by other housekeeping equipment.  User commands are input to the Sync Box via RS-232.  The CPLD generates a serial bit stream which is Manchester encoded with a 25MHz clock, and contains information for occurrences of &amp;lt;tt&amp;gt;address_zero&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;data_valid&amp;lt;/tt&amp;gt;, and also a frame sequence number.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
=== Power consumption ===&lt;br /&gt;
Excluding the fibre transmitters, the sync box consumes 1.35W.  Each fibre transmitter (Avago HFBR-1119TZ) consumes 185mA x 5V = 0.925W, so a sync box with all eight tranmitters populated consumes 8.75W.  To minimise power consumption, only the required number of transmitters should be populated.  Input power is either 5V or 24V, depending on configuration.&lt;br /&gt;
&lt;br /&gt;
=== Approximate dimensions ===&lt;br /&gt;
;Size: 5cm × 20cm × 25cm&lt;br /&gt;
;Weight: 600 grams&lt;br /&gt;
&lt;br /&gt;
The obsolete, rack-mount AC-in sync box was 2U (9cm) × 19 inches (48cm) × 21cm deep and weighed 1.9kg.&lt;br /&gt;
&lt;br /&gt;
== External connectors and I/O ==&lt;br /&gt;
:''These are the connectors and pinout for the DC-in sync box.  For the connector pinout of the obsolete AC-in sync box, see [[Sync Box AC-in Rack Mount I/O]].&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;CP1&amp;quot;&amp;gt;CP1: DC power in&amp;lt;/span&amp;gt; ===&lt;br /&gt;
Different connectors are used for 5V and 24V input.&lt;br /&gt;
;5V&lt;br /&gt;
* Box connector is an AMP 206486-1.  +5VDC on pins 1 and 2.  Return on pins 3 and 6.  Other pins not populated.  Pins 3 and 6 are connected to sync box ground.&lt;br /&gt;
:[[File:Sync box 5v in.png]]&lt;br /&gt;
* mating connector on the power brick is: AMP 206485-1&lt;br /&gt;
;24V&lt;br /&gt;
* Box connector is an Amphenol PT-2A-14-5P.  +24VDC on pins B and C.  Return on pins D and E.  Pin A is not connected.  Unlike the 5V-in sync box, the 24V-in sync box isolates pins D and E from sync box ground.&lt;br /&gt;
:[[File:small_mcc_power.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;CJ2&amp;quot;&amp;gt;CJ2: RS-232 command port&amp;lt;/span&amp;gt; ===&lt;br /&gt;
A nine pin DE-9F provides the serial command port.  See [[#RS-232 communication and commanding|RS-232 communication and commanding]] below for details.  The only lines wired through to the Atmel processor are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin !! Signal&lt;br /&gt;
|-&lt;br /&gt;
| 2 || TxD&lt;br /&gt;
|-&lt;br /&gt;
| 3 || RxD&lt;br /&gt;
|-&lt;br /&gt;
| 4 || DSR&lt;br /&gt;
|-&lt;br /&gt;
| 5 || GND&lt;br /&gt;
|}&lt;br /&gt;
Don't rely on &amp;lt;tt&amp;gt;DSR&amp;lt;/tt&amp;gt;.  Assume no hardware or software flow control.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;CJ3&amp;quot;&amp;gt;CJ3: Digital I/O&amp;lt;/span&amp;gt; ===&lt;br /&gt;
A twenty five pin DB-25F is used for digital I/O.  Pins 1, 2, and 14 are inputs.  All other pins are outputs.  All grounds, including pin 14, are connected in the sync box to sync box ground.&lt;br /&gt;
&lt;br /&gt;
In [[#RTS mode vs Free-run mode|RTS mode]], any falling edge of &amp;lt;tt&amp;gt;Data_Valid&amp;lt;/tt&amp;gt; will be taken as a RTS DV signal.  In Free Run mode, this input is ignored.&lt;br /&gt;
&lt;br /&gt;
There are two pairs of RS485 outputs which provide a NRZ and clock version of the DV sync word.  &amp;lt;tt&amp;gt;Data_Sync_1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Data_Sync_4&amp;lt;/tt&amp;gt; have the clock and &amp;lt;tt&amp;gt;Data_Sync_2&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Data_Sync_3&amp;lt;/tt&amp;gt; have the NRZ sync word.   There are also TTL versions of &amp;lt;tt&amp;gt;Data_sync_3&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Data_Sync_4&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note: the output contains only the DV sync word, not the single-zero-bit ARZ occurrences between DVs.  For firmware versions before 1f, the clock rate is fixed at 5MHz.  Later versions allow changing the clock rate by setting a divisor, ''d'', with the '''&amp;lt;tt&amp;gt;ckd&amp;lt;/tt&amp;gt;''' command.  In these versions the clock rate is 50MHz &amp;amp;divide; ''d''.  The default value of ''d'' is 10 (meaning the default clock rate remains 5MHz).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin || Signal !! Pin !! Signal&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  1 || style=&amp;quot;background: #F99&amp;quot; rowspan=2&amp;quot; | Data_Valid RS485− || colspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 14 || style=&amp;quot;background: #F99&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  2 || style=&amp;quot;background: #F99&amp;quot; rowspan=2&amp;quot; | Data_Valid RS485+&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #9F9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 15 || style=&amp;quot;background: #9F9&amp;quot; rowspan=2&amp;quot; | Data_Sync_1 RS485−&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #9F9&amp;quot; rowspan=&amp;quot;2&amp;quot; |  3 || style=&amp;quot;background: #9F9&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #9F9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 16 || style=&amp;quot;background: #9F9&amp;quot; rowspan=2&amp;quot; | Data_Sync_1 RS485+&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99F&amp;quot; rowspan=&amp;quot;2&amp;quot; |  4 || style=&amp;quot;background: #99F&amp;quot; rowspan=2&amp;quot; | Data_Sync_2 RS485−&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99F&amp;quot; rowspan=&amp;quot;2&amp;quot; | 17 || style=&amp;quot;background: #99F&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99F&amp;quot; rowspan=&amp;quot;2&amp;quot; |  5 || style=&amp;quot;background: #99F&amp;quot; rowspan=2&amp;quot; | Data_Sync_2 RS485+&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 18 || style=&amp;quot;background: #FF9&amp;quot; rowspan=2&amp;quot; | Data_Sync_3 RS485−&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF9&amp;quot; rowspan=&amp;quot;2&amp;quot; |  6 || style=&amp;quot;background: #FF9&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 19 || style=&amp;quot;background: #FF9&amp;quot; rowspan=2&amp;quot; | Data_Sync_3 RS485+&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #EE9&amp;quot; rowspan=&amp;quot;2&amp;quot; |  7 || style=&amp;quot;background: #EE9&amp;quot; rowspan=2&amp;quot; | Data_Sync_3 TTL&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #EE9&amp;quot; rowspan=&amp;quot;2&amp;quot; | 20 || style=&amp;quot;background: #EE9&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F9F&amp;quot; rowspan=&amp;quot;2&amp;quot; |  8 || style=&amp;quot;background: #F9F&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F9F&amp;quot; rowspan=&amp;quot;2&amp;quot; | 21 || style=&amp;quot;background: #F9F&amp;quot; rowspan=2&amp;quot; | Data_Sync_4 RS485−&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #E9E&amp;quot; rowspan=&amp;quot;2&amp;quot; |  9 || style=&amp;quot;background: #E9E&amp;quot; rowspan=2&amp;quot; | Data_Sync_4 TTL&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F9F&amp;quot; rowspan=&amp;quot;2&amp;quot; | 22 || style=&amp;quot;background: #F9F&amp;quot; rowspan=2&amp;quot; | Data_Sync_4 RS485+&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 10 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #E9E&amp;quot; rowspan=&amp;quot;2&amp;quot; | 23 || style=&amp;quot;background: #E9E&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 11 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 24 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 12 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 25 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
|                          rowspan=&amp;quot;2&amp;quot; | 13 ||                          rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;CP4&amp;quot;&amp;gt;CP4: ACDCU&amp;lt;/span&amp;gt; ===&lt;br /&gt;
:''Note: to make full use of these, firmware updates are needed.''&lt;br /&gt;
The ACDCU connector is a DB-25M.  It can be used for general purpose I/O.  Originally, these lines were used to control associated [[AC-DC Unit]]s, which are no longer in production.  In most cases, this connector is left unpopulated.  All grounds are connected in the sync box to sync box ground.  The '''&amp;lt;tt&amp;gt;ps&amp;lt;/tt&amp;gt;''' command will read these lines and report them as a hex-encoded byte:&lt;br /&gt;
 Synco&amp;gt; ps&lt;br /&gt;
        ACDCU_Status = 0X7B&lt;br /&gt;
The '''&amp;lt;tt&amp;gt;dpu&amp;lt;/tt&amp;gt;''', '''&amp;lt;tt&amp;gt;dpa&amp;lt;/tt&amp;gt;''', '''&amp;lt;tt&amp;gt;epa&amp;lt;/tt&amp;gt;''', and '''&amp;lt;tt&amp;gt;pof&amp;lt;/tt&amp;gt;''' commands can be used to control them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin || Signal !! Pin !! Signal&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FFBE99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  1 || style=&amp;quot;background: #FFBE99&amp;quot; rowspan=2&amp;quot; | Aux_in_1 || colspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FFBE99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 14 || style=&amp;quot;background: #FFBE99&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FFBE99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  2 || style=&amp;quot;background: #FFBE99&amp;quot; rowspan=2&amp;quot; | Aux_out_1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99FFD8&amp;quot; rowspan=&amp;quot;2&amp;quot; | 15 || style=&amp;quot;background: #99FFD8&amp;quot; rowspan=2&amp;quot; | Aux_in_2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99FFD8&amp;quot; rowspan=&amp;quot;2&amp;quot; |  3 || style=&amp;quot;background: #99FFD8&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99FFD8&amp;quot; rowspan=&amp;quot;2&amp;quot; | 16 || style=&amp;quot;background: #99FFD8&amp;quot; rowspan=2&amp;quot; | Aux_out_2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F199FF&amp;quot; rowspan=&amp;quot;2&amp;quot; |  4 || style=&amp;quot;background: #F199FF&amp;quot; rowspan=2&amp;quot; | Aux_in_3&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F199FF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 17 || style=&amp;quot;background: #F199FF&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F199FF&amp;quot; rowspan=&amp;quot;2&amp;quot; |  5 || style=&amp;quot;background: #F199FF&amp;quot; rowspan=2&amp;quot; | Aux_out_3&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F3FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 18 || style=&amp;quot;background: #F3FF99&amp;quot; rowspan=2&amp;quot; | Aux_in_4&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F3FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; |  6 || style=&amp;quot;background: #F3FF99&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #F3FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 19 || style=&amp;quot;background: #F3FF99&amp;quot; rowspan=2&amp;quot; | Aux_out_4&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99DAFF&amp;quot; rowspan=&amp;quot;2&amp;quot; |  7 || style=&amp;quot;background: #99DAFF&amp;quot; rowspan=2&amp;quot; | Aux_in_5&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99DAFF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 20 || style=&amp;quot;background: #99DAFF&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #99DAFF&amp;quot; rowspan=&amp;quot;2&amp;quot; |  8 || style=&amp;quot;background: #99DAFF&amp;quot; rowspan=2&amp;quot; | Aux_out_5&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF99C0&amp;quot; rowspan=&amp;quot;2&amp;quot; | 21 || style=&amp;quot;background: #FF99C0&amp;quot; rowspan=2&amp;quot; | Aux_in_6&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF99C0&amp;quot; rowspan=&amp;quot;2&amp;quot; |  9 || style=&amp;quot;background: #FF99C0&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #FF99C0&amp;quot; rowspan=&amp;quot;2&amp;quot; | 22 || style=&amp;quot;background: #FF99C0&amp;quot; rowspan=2&amp;quot; | Aux_out_6&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A7FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 10 || style=&amp;quot;background: #A7FF99&amp;quot; rowspan=2&amp;quot; | Aux_in_7&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A7FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 23 || style=&amp;quot;background: #A7FF99&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A7FF99&amp;quot; rowspan=&amp;quot;2&amp;quot; | 11 || style=&amp;quot;background: #A7FF99&amp;quot; rowspan=2&amp;quot; | Aux_out_7&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A599FF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 24 || style=&amp;quot;background: #A599FF&amp;quot; rowspan=2&amp;quot; | Aux_in_8&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A599FF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 12 || style=&amp;quot;background: #A599FF&amp;quot; rowspan=2&amp;quot; | GND&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background: #A599FF&amp;quot; rowspan=&amp;quot;2&amp;quot; | 25 || style=&amp;quot;background: #A599FF&amp;quot; rowspan=2&amp;quot; | Aux_out_8&lt;br /&gt;
|-&lt;br /&gt;
|                             rowspan=&amp;quot;2&amp;quot; | 13 ||                             rowspan=2&amp;quot; | ''N/C''&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== CJ5: TTL in ===&lt;br /&gt;
A female BNC used to provide an external TTL clock.  The line is 50-ohm terminated.  Ground (outer conductor) is connected to sync box ground.  ''Note: this input is currently ignored in firmware.''&lt;br /&gt;
&lt;br /&gt;
=== CJ6: TTL out ===&lt;br /&gt;
A female BNC providing a NRZ version of the [[#The Manchester output stream|output stream]].  The line is 50-ohm terminated.  Ground (outer conductor) is connected to sync box ground.&lt;br /&gt;
&lt;br /&gt;
=== MCE0 through MCE7: Fibre outputs ===&lt;br /&gt;
There are up to eight fibre-optic outputs (some which may not be populated to reduce power consumption).  These outputs are connected to MCE [[Clock Card]] sync-in connection.  The fibre-optic outputs are divided into two groups of four each, which allow the possibility for dual-rate operation.  All outputs provide the [[#The Manchester output stream|Manchester-encoded output stream]].&lt;br /&gt;
&lt;br /&gt;
=== Reset button ===&lt;br /&gt;
Pressing the reset momentary switch restarts the sync box control program and resets all parameters to their default values.&lt;br /&gt;
&lt;br /&gt;
=== Front panel LEDs ===&lt;br /&gt;
* '''Power (green)''': The power LED is on whenever the sync box is powered on. Note: because the power for this LED is teed off of the power wiring harness (see schematic above), in cases where P5 has become disconnected, with external power applied, this lamp will be lit without the sync box actually being powered.&lt;br /&gt;
* '''Free run (yellow)''': The free-run LED is on whenever the sync box is in free-run mode.&lt;br /&gt;
* '''DV error (red)''': The DV error LED is turned on whenever more than one [[#CJ3|RTS DV pulse]] is received between successive address-reutrns-to-zero (ARZs); see [[#The Manchester output stream|The Manchester output stream]] below. It is turned off at the next ARZ.  This cannot occur in free-run mode.&lt;br /&gt;
&lt;br /&gt;
== Schematics ==&lt;br /&gt;
Here is a box diagram of the 5VDC-in sync box.  The 24VDC-in sync box includes a 24-to-5V DC-DC converter module between the front panel power connector (CP1) and P5 on the sync board.  The obsolete AC-in sync box also uses the same sync board, but has different external connections.&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
[[File:Sync box schematic.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Documents ===&lt;br /&gt;
* [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/SC2-ELE-S589-101_RevA2_SyncGen_Schematics.pdf Sync Board Schematics (S589-101)]&lt;br /&gt;
* Block Diagram: &lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/S589-001_Syncbox_Block_Diagram.pdf rack-mount AC-in Sync Box (S589-001)]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/ELE-C589-111A_5VDC_Sync_Box_Block_Diagram.pdf 5V DC-in Sync Box (C589-111A)]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/board_block_diagram/ELE-C589-121A_24VDC_Sync_Box_Block_Diagram.pdf 24V DC-in Sync Box (C589-121A)]&lt;br /&gt;
* Wiring Diagrams&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/ELE-C589-102_Sync_Box_Connector_Pinouts_Rev3.pdf DC-in Sync Box Wiring (C589-102)]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/S589-102_SyncBox_Wiring_Diagram.pdf rack-mount AC-in Sync Box Wiring]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/hardware/schematics/SyncBox/S589-103_SyncBox_IO_Cable_Wiring.pdf Cable connection to rack-mount Sync Box]&lt;br /&gt;
&lt;br /&gt;
== RTS mode vs Free-run mode ==&lt;br /&gt;
The sync box operates either in free-run mode (the default) or else RTS mode.  When in free-run mode, the sync box generates its own data valid (DV) triggers by down-counting occurrences of address-return-to-zero (ARZ), which occur at a rate of 25MHz &amp;amp;times; &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; &amp;amp;times; &amp;lt;tt&amp;gt;num_rows&amp;lt;/tt&amp;gt;.  The &amp;lt;tt&amp;gt;data_rate&amp;lt;/tt&amp;gt; parameter to '''&amp;lt;tt&amp;gt;fr&amp;lt;/tt&amp;gt;''' indicates how many ARZ occurrences occur between successive DVs.&lt;br /&gt;
&lt;br /&gt;
In RTS mode, &amp;lt;tt&amp;gt;data_rate&amp;lt;/tt&amp;gt; is ignored.  Instead, the sync box waits for a falling edge on the &amp;lt;tt&amp;gt;[[#CJ3|Data_Valid]]&amp;lt;/tt&amp;gt; RS485 digital input.  When a falling edge is detected, a DV will be output on the next ARZ.  If multiple falling edges are detected before an ARZ, only a single DV will be issued.  (That is: only one external DV trigger is honoured per ARZ.)&lt;br /&gt;
&lt;br /&gt;
These days, almost everyone uses free-run mode.&lt;br /&gt;
&lt;br /&gt;
== The Manchester output stream ==&lt;br /&gt;
By default, the Manchester output bit-stream encodes simply the 25MHz clock as a series of (Manchester-encoded) one bits.  Exceptions to this are:&lt;br /&gt;
* '''Address-Return-to-Zero (ARZ)''': Occurrences of ARZ are encoded into the Manchester bit-stream as a single binary zero.  ARZ occurs at a rate of 25MHz &amp;amp;times; &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; &amp;amp;times; &amp;lt;tt&amp;gt;num_rows&amp;lt;/tt&amp;gt;, regardless of operating mode (free-run or RTS).&lt;br /&gt;
* '''Data Valid sync word''': This is a 40-bit sequence which is output on certain ARZ occurrences.  In free-run mode, the &amp;lt;tt&amp;gt;data_rate&amp;lt;/tt&amp;gt; parameter indicates the number of ARZs between successive DV sync word output.  In [[#RTS mode vs Free-run mode|RTS mode]], it can be output on ''every'' ARZ, but only if a [[#CJ3|RTS DV pulse]] has arrived since the last ARZ.  On ARZs where the DV sync word is not output, only the ARZ bit will be zero (all other bits will be 1).&lt;br /&gt;
&lt;br /&gt;
:The 40-bit DV sync word looks like this; bit zero is sent first:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  zd-fe--- Nnnnnnnn nnnnnnnn nnnnnnnn nnnnnnnn&lt;br /&gt;
  0        0        1        2        3&lt;br /&gt;
  0        8        6        4        2&lt;br /&gt;
&lt;br /&gt;
:where:&lt;br /&gt;
&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt;''' is the address-return-to-zero (ARZ) bit (always zero)&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;d&amp;lt;/tt&amp;gt;''' is the data valid bit (always zero)&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;-&amp;lt;/tt&amp;gt;''' are reserved (unused) sync-word status bits&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;f&amp;lt;/tt&amp;gt;''' is one when operating in free-run mode and zero when in RTS mode&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;e&amp;lt;/tt&amp;gt;''' is the &amp;lt;tt&amp;gt;dv_error&amp;lt;/tt&amp;gt; bit.  It is one if in RTS mode and more than one RTS DV pulse was received since the last ARZ.  Zero otherwise (including always zero in free-run mode).&lt;br /&gt;
:* '''&amp;lt;tt&amp;gt;Nnn...&amp;lt;/tt&amp;gt;''' is the 32-bit frame sequence number.  The most significant bit (''N'') is sent first.&lt;br /&gt;
&lt;br /&gt;
== Firmware ==&lt;br /&gt;
:''See: [[Sync Box Firmware]]''&lt;br /&gt;
The sync box program comes in two parts: a program that runs on the Atmel microcontroller, and another that runs on the CPLD.  For information on how to obtain the firmware, how to reprogram your sync box, and access to the source code, see [[Sync Box Firmware]].&lt;br /&gt;
&lt;br /&gt;
== RS-232 communication and commanding ==&lt;br /&gt;
Commands are sent to the Sync Box over a 9600 baud RS-232 link, with no hardware or software flow control, connected to an Atmel AT89C5131A-M, an 8-bit, 80C51-compatible single-chip microcontroller.  Input command variables are checked by the command processor and loaded one byte at a time into the sync generator CPLD over programmed I/O connections with eight bits for data and an eight-bit address.&lt;br /&gt;
&lt;br /&gt;
Text returned by the sync box over RS232 use carriage return for line termination.  Most Linux users will need to tell minicom (or whatever serial terminal they use) to add line feeds to avoid all output being overwritten on the same line.&lt;br /&gt;
&lt;br /&gt;
More than one command may be put on a single input command line, up to a maximum of 12 tokens (commands + arguments), and 80 characters.&lt;br /&gt;
&lt;br /&gt;
=== Command summary ===&lt;br /&gt;
The sync box responds to the following commands over the RS-232 link:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
! Default&lt;br /&gt;
! [[Sync Box Firmware|FW]]&amp;lt;br/&amp;gt;Version&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;h&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Help: print a list of commands.&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | all&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;?&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Shows the [[#Status output|current sync box parameters and status]].&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | &amp;lt;tt&amp;gt;rl&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Set &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; to ''n'' where 1 &amp;amp;le; ''n'' &amp;amp;le; 4095&amp;lt;br/&amp;gt;&lt;br /&gt;
'''''NB:'''''  Because the sync box clock is 25MHz, this value should be ''half'' the value of the corresponding MCE {{param|sys|row_len}}. For example, to have a {{param|sys|row_len}} of 100 on the MCE, set this value to 50.  Also, &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; &amp;amp;times; &amp;lt;tt&amp;gt;num_rows&amp;lt;/tt&amp;gt; must be &amp;amp;ge; 250.&lt;br /&gt;
| 64 &lt;br /&gt;
| &amp;amp;le; 1f&lt;br /&gt;
|-&lt;br /&gt;
| 53&lt;br /&gt;
| 20, 21&lt;br /&gt;
|-&lt;br /&gt;
| 50&lt;br /&gt;
| &amp;amp;ge; 22&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | &amp;lt;tt&amp;gt;nr&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Set {{param|cc|num_rows}} to ''n'' where 1 &amp;amp;le; ''n'' &amp;amp;le; 63&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: &amp;lt;tt&amp;gt;row_len&amp;lt;/tt&amp;gt; &amp;amp;times; &amp;lt;tt&amp;gt;num_rows&amp;lt;/tt&amp;gt; must be &amp;amp;ge; 250.&lt;br /&gt;
| 41&lt;br /&gt;
| &amp;amp;le; 1f&lt;br /&gt;
|-&lt;br /&gt;
| 33&lt;br /&gt;
| &amp;amp;ge; 20&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;rt&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Enable RTS mode (turn off free-run mode).&lt;br /&gt;
| Off&lt;br /&gt;
| all&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | &amp;lt;tt&amp;gt;fr&amp;lt;/tt&amp;gt; [''n'']&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | Enable free-run mode (turn off RTS mode) and set {{param|cc|data_rate}} to ''n'' where 1 &amp;amp;le; ''n'' &amp;amp;le; 4095.  If ''n'' is omitted, the previously commanded value for &amp;lt;tt&amp;gt;data_rate&amp;lt;/tt&amp;gt; is re-used.&lt;br /&gt;
| 47&lt;br /&gt;
| &amp;amp;le; 1f&lt;br /&gt;
|-&lt;br /&gt;
| 120&lt;br /&gt;
| 20, 21&lt;br /&gt;
|-&lt;br /&gt;
| 38&lt;br /&gt;
| &amp;amp;ge; 22&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;fn&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Set frame sequence number to ''n'' where 0 &amp;amp;le; ''n'' &amp;amp;le; 2&amp;lt;sup&amp;gt;32&amp;lt;/sup&amp;gt;&amp;amp;minus;1&lt;br /&gt;
| &amp;amp;mdash;&lt;br /&gt;
| all&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;ckd&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Set the clock divisor to ''n'' where 1 &amp;amp;le; ''n'' &amp;amp;le; 255.  The NRZ output clock is 50MHz &amp;amp;divide; ''n''.  Before version 1f, the divisor is fixed at 10 (5MHz clock).&lt;br /&gt;
| 10&lt;br /&gt;
| &amp;amp;ge; 1f&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Enable Manchester and DV outputs.&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | On&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | all&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;st&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Disable Manchester and DV outputs.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;dpa&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Disable all power outputs.&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | All on&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;dpu&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Disable power output ''n'' where 0 &amp;amp;le; ''n'' &amp;amp;le; 7&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;epu&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Enable power output ''n'' where 0 &amp;amp;le; ''n'' &amp;amp;le; 7&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;pof&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Get ACDCU on/off control byte&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;ps&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Get ACDCU status byte&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;bank&amp;lt;/tt&amp;gt; ''n''&lt;br /&gt;
| Change target MCE bank for commands. ''n''=0 for both (unbanked); ''n''=1 for low bank (MCE1&amp;amp;ndash;4); ''n''=2 for high bank (MCE5&amp;amp;ndash;8)&lt;br /&gt;
| 0&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;ge; 31&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;eeprom&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Enter [[#EEPROM manipulation mode|EEPROM manipulation mode]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;re&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Reset sync box to default state.&lt;br /&gt;
| all&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; style=&amp;quot;text-align:center&amp;quot; | &lt;br /&gt;
=== EEPROM manipulation mode ===&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; | ''Note: this menu is activated by the ''&amp;lt;tt&amp;gt;eeprom&amp;lt;/tt&amp;gt;'' command from the main menu.''&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;h&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Help: print a list of EEPROM manipulation mode commands.&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | &amp;amp;mdash;&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; | &amp;amp;ge; 31&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;exit&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Leave EEPROM manipulation mode and return to the main menu.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;dump&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Dump the contents of the EEPROM.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;load&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Load the Sync Box configuration saved to the EEPROM, overwriting the currently-running configuration.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;save&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Save the currently-running Sync Box configuration to the EEPROM.&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;enable_boot&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Load the saved configuration from the EEPROM on boot.&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Off&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;tt&amp;gt;disable_boot&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Don't load the configuration saved to EEPROM on boot.  Instead, the baked-in default configuration hard-coded in the code will be used.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Status output ===&lt;br /&gt;
The '''&amp;lt;tt&amp;gt;?&amp;lt;/tt&amp;gt;''' command produces output similar to this:&lt;br /&gt;
&lt;br /&gt;
 Synco&amp;gt; ?&lt;br /&gt;
 Mancho_Enable = ON&lt;br /&gt;
 DV_Mode = FreeRun_DV&lt;br /&gt;
 Frun_Count = 47&lt;br /&gt;
 Row_len = 64&lt;br /&gt;
 Num_Row = 41&lt;br /&gt;
 ACDCU_onoff = 0X00&lt;br /&gt;
&lt;br /&gt;
=== Command error messages ===&lt;br /&gt;
Some example error messages:&lt;br /&gt;
 Synco&amp;gt; xx       WHAT? &amp;quot;xx&amp;quot;      // Unrecognised command&lt;br /&gt;
 Synco&amp;gt; rl 9999  TOO BIG &amp;quot;9999&amp;quot;  // Parameter too large&lt;br /&gt;
 Synco&amp;gt; rl 0     TOO SMALL &amp;quot;0&amp;quot;   // Parameter too small&lt;br /&gt;
 Synco&amp;gt; rl xx    WHAT? &amp;quot;xx&amp;quot;      // Parameter could not be parsed&lt;br /&gt;
&lt;br /&gt;
=== Using minicom in Linux ===&lt;br /&gt;
To issue commands to a Sync Box over an RS-232 line, you can use a Linux program called &amp;lt;tt&amp;gt;minicom&amp;lt;/tt&amp;gt;.  To install this application, do:&lt;br /&gt;
 sudo apt-get install minicom&lt;br /&gt;
To start MiniCom:&lt;br /&gt;
 sudo minicom&lt;br /&gt;
Minicom needs the following options changed for it to work properly:&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;a&amp;gt; (to turn on line feeds)&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Serial port setup&amp;gt; &amp;lt;Serial Device&amp;gt; = /dev/ttyS0&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Serial port setup&amp;gt; &amp;lt;Bps/Par/Bits&amp;gt; = 9600 8N1&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Serial port setup&amp;gt; &amp;lt;Hardware Flow Control&amp;gt; = No&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Serial port setup&amp;gt; &amp;lt;Software Flow Control&amp;gt; = No&lt;br /&gt;
 &amp;lt;ctrl-a&amp;gt;, &amp;lt;z&amp;gt;, &amp;lt;o&amp;gt;, &amp;lt;Modem and dialing&amp;gt; &amp;lt;Modem has DCD line&amp;gt; = No&lt;br /&gt;
After you modify these settings, remember to save, exit, and restart Minicom.&lt;br /&gt;
&lt;br /&gt;
== Enabling sync box use in the MCE ==&lt;br /&gt;
To check that the sync box is connected correctly to the MCE, issue the command&lt;br /&gt;
 wb cc {{param|cc|select_clk}} 1&lt;br /&gt;
and then read back the value:&lt;br /&gt;
 rb cc {{param|cc|select_clk}}&lt;br /&gt;
 Line   0 : ok : 1&lt;br /&gt;
&lt;br /&gt;
Setting {{param|cc|select_clk}} to 1 tells the MCE to sync its internal clock with the clock signal encoded from the sync box.  If the MCE does not see the sync box, the parameter will revert to zero (internal clock) in about one second.&lt;br /&gt;
&lt;br /&gt;
To accept sync triggers and serial numbers from the sync box, two more commands are needed:&lt;br /&gt;
 wb cc {{param|cc|use_sync}} 2&lt;br /&gt;
 wb cc {{param|cc|use_dv}} 2&lt;br /&gt;
&lt;br /&gt;
These registers are configured automatically by the config system if the parameters &amp;lt;tt&amp;gt;hardware_sync=1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;config_sync=1&amp;lt;/tt&amp;gt; in [[experiment.cfg]].  If you change the values in &amp;lt;tt&amp;gt;$MAS_DATA/experiment.cfg&amp;lt;/tt&amp;gt; instead of &amp;lt;tt&amp;gt;$MAS_CONFIG/experiment.cfg&amp;lt;/tt&amp;gt;, remember to run &amp;lt;tt&amp;gt;[[mce_make_config]]&amp;lt;/tt&amp;gt; before re-running the config script.&lt;br /&gt;
&lt;br /&gt;
Also be sure that you have the correct [[mce.cfg]] file.  A quick way to check that sync numbers are getting into the MCE frame data is to take some frames and check the data using the [[eat_packets]] tool:&lt;br /&gt;
 &lt;br /&gt;
 $  mce_run sync_test 400 s&lt;br /&gt;
 RUNFILE_NAME=/data/cryo/current_data//sync_test.run&lt;br /&gt;
 FRAME_BASENAME=/data/cryo/current_data//sync_test&lt;br /&gt;
 &lt;br /&gt;
 $ eat_packets -n 5424 -f $MAS_DATA/sync_test&lt;br /&gt;
 Forced     frame_size=1356 (5424)&lt;br /&gt;
 offset     frm_idx   frame#&lt;br /&gt;
 0000000000        0        0  surprise sync_dv 4168076, after sequence [0,0)&lt;br /&gt;
 EOF, exiting after 10000 frames + 0 bytes&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;tt&amp;gt;[[mce_run]]&amp;lt;/tt&amp;gt; does not terminate quickly, the sync box may not be properly connected to the MCE.  If &amp;lt;tt&amp;gt;eat_packets&amp;lt;/tt&amp;gt; complains only about the first frame (offset 00000000), then the sync numbers are intact and incrementing contiguously.  If &amp;lt;tt&amp;gt;eat_packets&amp;lt;/tt&amp;gt; complains about pretty much every frame, the sync numbers are not being inserted into the frame data.&lt;br /&gt;
&lt;br /&gt;
== Legacy documents ==&lt;br /&gt;
* The original &amp;quot;Sync Box User's Guide&amp;quot; is available here:&lt;br /&gt;
:http://www.phas.ubc.ca/~mce/mcedocs/hardware/tech_description/SyncBox_UserGuide_S589_502.pdf&lt;br /&gt;
:'''Please note:''' it is rather out of date (being last updated in 2007), and known to be wrong in places.  All relevant information from the guide should be available on this wiki.&lt;br /&gt;
&lt;br /&gt;
[[Category:Sync Box| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Configuration_for_mux11d_operation&amp;diff=7142</id>
		<title>Configuration for mux11d operation</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Configuration_for_mux11d_operation&amp;diff=7142"/>
		<updated>2021-11-17T02:24:09Z</updated>

		<summary type="html">&lt;p&gt;Dvw: /* Software requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|Mux11d}}&lt;br /&gt;
:'''This topic is undergoing active development; information on this page is more subject to change than usual!'''&lt;br /&gt;
&lt;br /&gt;
== Hardware configuration ==&lt;br /&gt;
The following diagram shows a conceptual schematic of using the MCE hardware with mux11d SQUID chips [http://www.phas.ubc.ca/~mce/mcedocs/system/mux11d_and_mce.pdf mux11d_with_mce.pdf] (prepared by Jimmy Grayson at Stanford) &lt;br /&gt;
&lt;br /&gt;
For the reference: [[Media:Mux11d_bias_simple_diagram.pdf]]&lt;br /&gt;
&lt;br /&gt;
Here is the proposed MCE signal assignment scheme: [http://www.phas.ubc.ca/~mce/mcedocs/system/mce_mdm_signal_names_and_pinouts.pdf [PDF]] [http://www.phas.ubc.ca/~mce/mcedocs/system/mce_mdm_signal_names_and_pinouts.xls [XLS]]&lt;br /&gt;
&lt;br /&gt;
Note that the signals the MCE must provide to the mux11d SQUID system are:&lt;br /&gt;
* SA BIAS per column, constant&lt;br /&gt;
* SA FB per column, fast-switching&lt;br /&gt;
* SQ1 BIAS per column, fast-switching&lt;br /&gt;
* &amp;quot;Rowsel&amp;quot; feedback per row, multiplexing (one value when active, another value when not active)&lt;br /&gt;
&lt;br /&gt;
== Software requirements ==&lt;br /&gt;
&lt;br /&gt;
=== MAS ===&lt;br /&gt;
&lt;br /&gt;
The mux11d support in MAS has been merged back into trunk and the former mux11d branch deleted.  You can check out a new tree:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/multi-channel-electronics/mas.git&lt;br /&gt;
&lt;br /&gt;
The only mux11d-specific features are in the &amp;quot;mux_lock&amp;quot; applications (2 new programs) and in the config2 system (mce.cfg).&lt;br /&gt;
&lt;br /&gt;
=== mce_script ===&lt;br /&gt;
&lt;br /&gt;
Updates for mux11d have been put right into mce_script, starting with r914.  Just run &amp;quot;svn update&amp;quot; on your checked out copy.  The major changes so far are:&lt;br /&gt;
* [[ experiment.cfg ]] has extra parameters to configure and enable fast SA feedback and fast SQ1 bias switching, and to guide the new servo applications.&lt;br /&gt;
* the config script generation code (script/bits) will set up the MCE for mux11d operation depending on variables in experiment.cfg&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== mce.cfg ===&lt;br /&gt;
&lt;br /&gt;
When constructing [[ mce.cfg ]], start from templates/mce_v1_mux11d.cin or templates/mce_v2_mux11d.cin.  These will map SQ1 bias as a per-column register, and properly expose fast switching of the SA FB and SQ1 bias.  Since there is no &amp;quot;SQ2&amp;quot; in mux11d, this register is not defined.&lt;br /&gt;
&lt;br /&gt;
The default mux11d configuration maps:&lt;br /&gt;
* SA FB to BC1 FLUX_FB&lt;br /&gt;
* SQ1 BIAS to BC2 FLUX_FB&lt;br /&gt;
&lt;br /&gt;
There are other ways one might choose to do this mapping.  The SQ1 bias card and offset, can be overridden in mce.cin by changing these variables:&lt;br /&gt;
 /* These are only used if hw_mux11d != 0; they specify the bias card&lt;br /&gt;
  * and offset of the flux_fb register used for the SQ1 bias. */&lt;br /&gt;
 $mux11d_sq1_bc = &amp;quot;bc2&amp;quot;;&lt;br /&gt;
 $mux11d_sq1_offset = 0;&lt;br /&gt;
&lt;br /&gt;
At the MCE command level, fast-switching on the SA FB and SQ1 BIAS is accomplished with the same bias card registers used for Fast SQ2 switching (see [[Row-specific SQ2FB (fast switching)#Firmware_requirements|firmware requirements]]).  As an example, to load per-row values into the SA FB on column 5, and then enable muxing on that column, you could do the following:&lt;br /&gt;
 wb sa fb_col5  123 432 514 451 434 653 123 ...&lt;br /&gt;
 wra sa enbl_mux 5 1&lt;br /&gt;
Then to set a constant value on column 5, and disable muxing:&lt;br /&gt;
 wra sa fb 5 400&lt;br /&gt;
 wra sa enbl_mux 5 0&lt;br /&gt;
&lt;br /&gt;
The SQ1 BIAS is exposed in a similar way.  For example, the column 5 biases are exposed through:&lt;br /&gt;
 wb sq1 bias_col5  123 432 514 451 434 653 123 ...&lt;br /&gt;
 wra sq1 enbl_mux 5 1&lt;br /&gt;
&lt;br /&gt;
In practice users don't write these MCE commands directly, and instead use the slightly higher-level of support provided by the experiment.cfg / config script system.&lt;br /&gt;
&lt;br /&gt;
=== experiment.cfg ===&lt;br /&gt;
&lt;br /&gt;
A number of parameters have been added to experiment.cfg to allow the config script system to set up fast-switching on the SA FB and SQ1 BIAS.  These are:&lt;br /&gt;
&lt;br /&gt;
* Enable:&lt;br /&gt;
**'''hardware_mux11d = 1;''': triggers handling of all the other mux11d specific settings.&lt;br /&gt;
* Row Select DAC control; these are arrays of up to 41 integers representing values for the &amp;quot;row select&amp;quot; (AC ON_BIAS) and &amp;quot;row deselect&amp;quot; (AC OFF_BIAS) DACs.&lt;br /&gt;
**'''row_select = [...];''': will be written to &amp;quot;row select&amp;quot; by the config script.&lt;br /&gt;
**'''row_deselect = [...];''': will be written to &amp;quot;row deselect&amp;quot; by the config script.&lt;br /&gt;
**'''default_row_select, default_row_deselect''': Eventually these will be used by the tuning to select default row_select and row_deselect values if the tuning has been instructed not to try to choose them.&lt;br /&gt;
* SA FB control:&lt;br /&gt;
** '''config_fast_sa_fb = 0;''': When set to 0, MCE will be set up for constant SA FB output, with values obtained from the setting &amp;quot;sa_fb&amp;quot;.  When set to 1, MCE will be set up for fast-switching of SA FB output, with values obtained from '''sa_fb_set'''.&lt;br /&gt;
** '''sa_fb_set = [...];''':  A 1d array encoding SA FB values for each row and column.  (As usual the values are arranged as the 41 values for column 0, followed by the 41 values for column 1, etc.)&lt;br /&gt;
* SQ1 BIAS control - these work exactly like SA FB above.&lt;br /&gt;
** '''config_fast_sq1_bias = 1;'''&lt;br /&gt;
** '''sq1_bias_set = [...];'''&lt;br /&gt;
&lt;br /&gt;
For the purposes of array tuning the '''sq1_servo_*''' parameters will be used by the new '''sq1servo_sa''' program, which ramps the SQ1 FB and servos with the fast-switching SA FB (on each row independently).  This may optionally be done for a series of SQ1 bias values.&lt;br /&gt;
&lt;br /&gt;
A new set of servo control parameters, '''rowsel_servo_*''' (taking the same suffixes as the sq1_servo_* variables) has been introduced to control the new '''rs_servo''' program, which ramps the &amp;quot;row select&amp;quot; DACs and servos with the fast-switching SA FB (optionally at a series of SQ1 biases).  In particular these parameters are:&lt;br /&gt;
;; rowsel_servo_gain, rowsel_servo_flux_start, rowsel_servo_flux_count, rowsel_servo_flux_step, rowsel_servo_bias_ramp, rowsel_servo_bias_start, rowsel_servo_bias_count, rowsel_servo_bias_step&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== auto_setup, mux11d edition ===&lt;br /&gt;
&lt;br /&gt;
The auto_setup code has been updated to support mux11d.  I am uncertain as to how well-tested this code is, however.&lt;br /&gt;
&lt;br /&gt;
The steps in tuning a mux11d system are:&lt;br /&gt;
* '''sa_ramp''' -- same as classic tuning; select SA FB (and possibly also SA BIAS).&lt;br /&gt;
* '''rs_servo''' -- trace out the &amp;quot;Row Select&amp;quot; V-phi curves (all rows), probably at several different S1 bias values; pick a reasonable S1 BIAS (one value per row, column) and ROWSEL/ROWDESEL feedbacks (one value per row).  The algorithm for selecting ROWSEL/ROWDESEL feedback values is:&lt;br /&gt;
** All (row select) V-phi curves are analyzed to identify the first minimum and next maximum in the V-phi response.  Each V-phi curve (bias,row,column) is flagged as valid, or not.  Only valid curves are used when determining optimal biases and feedbacks for each column/row.&lt;br /&gt;
** '''SQ1 bias choice:''' If the SQ1 bias was ramped, an optimal SQ1 bias is chosen for each column and row by finding the bias at which the maximum peak-to-peak response is seen.&lt;br /&gt;
** '''ROWSEL/ROWDESEL choice''':  For a given row select V-phi curve, the ROWDESEL point is the first minimum (probably near FB=0) and the ROWSEL point is the first maximum to the right of the ROWDESEL point.  For each row, the ROWSEL and ROWDESEL feedback values are taken as the median of those values over all columns in the row.  Only the values corresponding to the optimal SQ1 bias are considered.&lt;br /&gt;
* '''sq1_servo_sa''' -- trace out the S1 V-phi curves (all rows), probably at several different S1 bias values; pick final fast-switching S1 BIAS values and fast-switching SA FB set-points.&lt;br /&gt;
** This is probably not fully implemented.&lt;br /&gt;
*  '''sq1_ramp''', '''sq1_ramp_check''', '''sq1_ramp_tes''' -- as in classic tuning; check your open loop response.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Using the new servo programs ===&lt;br /&gt;
&lt;br /&gt;
This is only relevant if you're trying to run the servo programs yourself on the command line.  The auto_setup should already know how to do all of this stuff correctly.&lt;br /&gt;
&lt;br /&gt;
The servo programs make a lot of assumptions about the state of the MCE before beginning their job.  Preparation is usually handled by the tuning code.  To run these programs manually, the biggest thing to be careful of is that you have enabled (or disabled) fast-switching on the relevant stages.  Here's a sequence of terminal commands which should work:&lt;br /&gt;
&lt;br /&gt;
 # Disable fast switching&lt;br /&gt;
 mas_param set config_fast_sa_fb 0&lt;br /&gt;
 mas_param set config_fast_sq1_bias 0&lt;br /&gt;
 # Basic MCE setup and SA tuning&lt;br /&gt;
 auto_setup --last-stage sa_ramp&lt;br /&gt;
 mas_param set config_fast_sa_fb 1&lt;br /&gt;
 # Recreate config script and run it to program the MCE.&lt;br /&gt;
 mce_make_config -x&lt;br /&gt;
 # Run the servos on RC2&lt;br /&gt;
 sq1servo_sa 2 myservo1&lt;br /&gt;
 rs_servo 2 myservo2&lt;br /&gt;
&lt;br /&gt;
Later, once you have set up the &amp;quot;sq1_bias_set&amp;quot; values:&lt;br /&gt;
 mas_param set config_fast_sq1_bias 1&lt;br /&gt;
 mce_make_config -x&lt;br /&gt;
&lt;br /&gt;
[[Category:Bias Card]]&lt;br /&gt;
[[Category:MAS]]&lt;br /&gt;
[[Category:MCE Script]]&lt;br /&gt;
[[Category:Mux11d]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Code_repositories&amp;diff=7141</id>
		<title>Code repositories</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Code_repositories&amp;diff=7141"/>
		<updated>2021-11-17T02:21:31Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The MCE software is available on GitHub in several repositories:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span style=&amp;quot;font-size:large&amp;quot;&amp;gt;https://github.com/multi-channel-electronics&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common things you'll need are:&lt;br /&gt;
* the [[MAS]] code here: https://github.com/multi-channel-electronics/mas&lt;br /&gt;
** MAS uses the GNU autotools for a bit of configuration work.&lt;br /&gt;
* the [[MCE script]]s here: https://github.com/multi-channel-electronics/mce_script&lt;br /&gt;
See [[MAS OS setup]] for information on how to build and install these packages.&lt;br /&gt;
&lt;br /&gt;
Also available:&lt;br /&gt;
* [[Sync box firmware]]: https://github.com/multi-channel-electronics/sync_box&lt;br /&gt;
** both CPLD and Atmel code are available&lt;br /&gt;
* [[PCI card firmware]]: https://github.com/multi-channel-electronics/arc_pci&lt;br /&gt;
&lt;br /&gt;
== What about card firmware? ==&lt;br /&gt;
&lt;br /&gt;
That's still in a CVS respository somewhere at UBC.  Ask us for it.&lt;br /&gt;
&lt;br /&gt;
[[Category:MAS]]&lt;br /&gt;
[[Category:MCE Script]]&lt;br /&gt;
[[Category:Sync Box Firmware]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_script&amp;diff=7140</id>
		<title>MCE script</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_script&amp;diff=7140"/>
		<updated>2021-11-17T02:20:52Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|MCE Script}}&lt;br /&gt;
The '''MCE script''' project is a collection of array setup tools and other utilities, built on top of [[MAS]], useful for running experiments.  MCE script can be obtained from GitHub.  See [[Code repositories]] for details on downloading MCE script.&lt;br /&gt;
&lt;br /&gt;
= Tutorials =&lt;br /&gt;
&lt;br /&gt;
* [[ Basic mce_script configuration ]]&lt;br /&gt;
* [[ Series array setup ]]&lt;br /&gt;
&lt;br /&gt;
= Tool descriptions =&lt;br /&gt;
* Auto-tuning system&lt;br /&gt;
** [[ Auto-setup (python) ]] - an integrated tool set for dealing with SQUID data.&lt;br /&gt;
** [[ auto_setup_squids.pro | Auto-setup (IDL) ]] - IDL-based auto-tuning code (obsolete)&lt;br /&gt;
** [[ experiment.cfg ]] - array and auto-setup configuration data.&lt;br /&gt;
** [[ mce_config_template system ]]&lt;br /&gt;
* Other scripts&lt;br /&gt;
** [[MCE Test Scripts]]&lt;br /&gt;
** [[MCE script utilities]]&lt;br /&gt;
** [[ place_sq1.pro ]] for row selection for the purposes of sq1servo&lt;br /&gt;
** [[ IV curves ]] - acquire and analyze TES IV curves&lt;br /&gt;
** [[ special_ops.py ]]&lt;br /&gt;
** [[ measure_quanta.py ]] - Analyzes tuning data to determine SQUID phi0.&lt;br /&gt;
* Scripting tools&lt;br /&gt;
** [[ mce_internal_ramp ]] - configure and run MCE internal command ramps&lt;br /&gt;
** [[Environmental variables]]&lt;br /&gt;
&lt;br /&gt;
= Other resources =&lt;br /&gt;
&lt;br /&gt;
* Educational tools&lt;br /&gt;
** [[ Media:MAS_auto-tuning_20090529.pdf ]] - Some quick graphical depictions of auto-tuning. (Not a stand-alone presentation!)&lt;br /&gt;
** Characterization and Locking SQUIDs with Multi-Channel Electronics [[http://www.phas.ubc.ca/%7Emce/mcedocs/software/locking_squids.pdf PDF]] (Jun. 07, 2005)&lt;br /&gt;
&lt;br /&gt;
* Sample auto-tune plots:&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/auto_tune_results/biasing_ac_sq2fb_switching biasing ac sq2fb switching]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/auto_tune_results/biasing_ac_not_switching biasing ac not switching]&lt;br /&gt;
[[Category:MCE Script| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=7139</id>
		<title>MAS</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=7139"/>
		<updated>2021-11-17T02:20:22Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|MAS}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;MAS&amp;quot; is meant to refer primarily to the lowest levels of the control software, including the PCI card driver, command line utilities, and basic python modules.&lt;br /&gt;
&lt;br /&gt;
For information on higher-level programs, such as the auto-tuning codes, please see [[MCE script]].&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
* System applications&lt;br /&gt;
** [[mce_cmd]]&lt;br /&gt;
** [[mce_status]]&lt;br /&gt;
** [[maslog]]&lt;br /&gt;
** [[dsp_cmd]]&lt;br /&gt;
&lt;br /&gt;
* Special applications&lt;br /&gt;
** [[ sq1_servo and sq2_servo ]]&lt;br /&gt;
** [[ mce_ramp ]]&lt;br /&gt;
** [[ psc_status ]]&lt;br /&gt;
&lt;br /&gt;
* Utilities&lt;br /&gt;
** [[mas_param]]&lt;br /&gt;
** [[mas_var]]&lt;br /&gt;
:These two utilities may be compiled separately from the rest of MAS, even on systems (ie. MacOS X) which are unable to run the control software.  See [[Mas param#Building_mas_param_on_MacOS_X|Building &amp;lt;tt&amp;gt;mas_param&amp;lt;/tt&amp;gt; on MacOS X]] for instructions.&lt;br /&gt;
&lt;br /&gt;
* MAS configuration&lt;br /&gt;
** [[ MAS start/stop ]]&lt;br /&gt;
** [[ mce.cfg ]]&lt;br /&gt;
** [[ mas.cfg ]]&lt;br /&gt;
** [[ MAS array_id and array_list | array_id and array_list ]]&lt;br /&gt;
** [[Environmental variables]]&lt;br /&gt;
&lt;br /&gt;
* MAS file formats&lt;br /&gt;
** [[ Runfile format v2 ]]&lt;br /&gt;
** [[ MCE flat-file format ]]&lt;br /&gt;
** [[ dirfile support ]]&lt;br /&gt;
&lt;br /&gt;
* Utilities for loading data&lt;br /&gt;
** IDL [[ mas_data.pro | data ]] and [[ mas_runfile.pro and mas_runparam.pro | runfile]] scripts&lt;br /&gt;
** [[ Python data and runfile modules ]]&lt;br /&gt;
&lt;br /&gt;
* IDL scripts&lt;br /&gt;
** [[ auto_setup_squids.pro ]]&lt;br /&gt;
&lt;br /&gt;
* Help&lt;br /&gt;
** [[MCE script utilities]], useful debugging programs &lt;br /&gt;
** [[ MCE Recovery During Acquisition ]]&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS Bug List ]]&lt;br /&gt;
* [[ MAS feature requests ]]&lt;br /&gt;
&lt;br /&gt;
== Installation / configuration ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS PC requirements and initial setup | PC requirements and initial setup]]&lt;br /&gt;
* [[ MAS OS setup | OS setup]]&lt;br /&gt;
* [[Multicard MAS]], running MAS on a system with multiple fibre cards&lt;br /&gt;
* [[ MAS user setup ]]&lt;br /&gt;
* [[ MAS kernel patch compilation | kernel patch compilation]]&lt;br /&gt;
* [[ Code repositories ]]&lt;br /&gt;
* [[ Hardware goodlist/badlist ]]&lt;br /&gt;
&lt;br /&gt;
== Trouble-shooting ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS malfunction diagnosis | diagnosis ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:MAS| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=PCI_card_firmware&amp;diff=7138</id>
		<title>PCI card firmware</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=PCI_card_firmware&amp;diff=7138"/>
		<updated>2021-11-17T02:19:52Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|PCI Card Firmware}}&lt;br /&gt;
UBC-produced firmware for the ARC-64 [[PCI card]].  [[MAS]] provides a linux kernel driver for this firmware.&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
These S-record files should work with any reasonable EEPROM programmer:&lt;br /&gt;
* U0107 (recommended) - http://e-mode.phas.ubc.ca/mce/firmware/sdsu/SDSU_RevU0107.s&lt;br /&gt;
* U0106 (old stable) - http://e-mode.phas.ubc.ca/mce/firmware/sdsu/SDSU_RevU0106.s&lt;br /&gt;
** 8-bit checksum 6FCDCE&lt;br /&gt;
** Scrubber file - try writing all ones to your  this to your chip first if your programmer won't let you &amp;quot;erase&amp;quot; it:&lt;br /&gt;
** http://e-mode.phas.ubc.ca/mce/firmware/sdsu/special/scrubber_RevU0106.s&lt;br /&gt;
* U0105 (deprecated) - http://e-mode.phas.ubc.ca/mce/firmware/sdsu/SDSU_RevU0105.s&lt;br /&gt;
* U0104 (deprecated) - http://e-mode.phas.ubc.ca/mce/firmware/sdsu/SDSU_RevU0104.s&lt;br /&gt;
&lt;br /&gt;
The full source code is available in these archives (it will not compile unless you get the correct assembler and stuff):&lt;br /&gt;
* U0106 - http://e-mode.phas.ubc.ca/mce/arc_pci/source_code/arc_pci-U0106.tar.gz&lt;br /&gt;
* U0105 - http://e-mode.phas.ubc.ca/mce/arc_pci/source_code/arc_pci-U0105.tar.gz&lt;br /&gt;
* U0104 - http://e-mode.phas.ubc.ca/mce/arc_pci/source_code/arc_pci-U0104.tar.gz&lt;br /&gt;
&lt;br /&gt;
The subversion tree can be obtained like this (you may not have access to this repository; contact UBC);&lt;br /&gt;
 git clone https://github.com/multi-channel-electronics/arc_pci.git&lt;br /&gt;
&lt;br /&gt;
It is laid out roughly as follows:&lt;br /&gt;
 /trunk       main line of development&lt;br /&gt;
 /releases    tagged versions of code &lt;br /&gt;
 /tools       debugging tools&lt;br /&gt;
 /clash       stuff for making CLAS work with wine and linux&lt;br /&gt;
 /docs        useful (though maybe not to you) notes&lt;br /&gt;
&lt;br /&gt;
== Firmware version notes ==&lt;br /&gt;
&lt;br /&gt;
=== U0107 (recommended) ===&lt;br /&gt;
&lt;br /&gt;
* This firmware can operate in either of two modes:&lt;br /&gt;
** '''U0106 compatibility mode''': the firmware will work with classic MAS driver, just like U0106 (plus some bugfixes).&lt;br /&gt;
** '''New Master-only mode''': when activated, uses new set of protocols for communication with the MAS driver.  These have proven to be much more stable on some systems.  Also, bigphysarea is no longer needed.&lt;br /&gt;
* Downloads:&lt;br /&gt;
** S-rec for release candidates here: http://e-mode.phas.ubc.ca/mce/firmware/sdsu/&lt;br /&gt;
** Soft-patches for upgrading U0106 to pseudo-U0107 temporarily: http://e-mode.phas.ubc.ca/mce/firmware/sdsu/patches/&lt;br /&gt;
* Some additional notes specific to U0107: [[U0107 Series Firmware]]&lt;br /&gt;
&lt;br /&gt;
=== U0106 (2011-11-21): Old stable version ===&lt;br /&gt;
&lt;br /&gt;
* Not recommended for new projects&lt;br /&gt;
* Backward compatible with U0104 and U0105.&lt;br /&gt;
* Fixes bug introduced in U0105 that prevented handling of some PCI bus errors.&lt;br /&gt;
* Introduction of command to update PCI burst size.&lt;br /&gt;
* Bugs:&lt;br /&gt;
** Versions U0104-6 all suffer from the following issues:&lt;br /&gt;
*** Host interrupts use bit-test instructions, which are not interrupt safe; consequence is a race condition that can upset ongoing tasks such as FO downloads and PCI bursts.  Patch for this issue, applicable to firmware versions U0104-6:&lt;br /&gt;
**** http://e-mode.phas.ubc.ca/mce/arc_pci/firmware/patches/patch_U0106_safetyize_vector_ints.bash&lt;br /&gt;
*** Multiple simultaneous PCI bus errors are not handled properly, leading to stale bits in the error register.  This is an unlikely error vector, but should be fixed.&lt;br /&gt;
&lt;br /&gt;
=== U0105 (2009-06-08) ===&lt;br /&gt;
&lt;br /&gt;
* Backward compatible with U0104.&lt;br /&gt;
* Support for MCE STOP commands and commands-on-the-fly.&lt;br /&gt;
* Accelerated MCE command code (along with Quiet-RP this increases commanding rate to ~6 kHz).&lt;br /&gt;
* Quiet-RP simplifies the protocol for MCE reply handling.&lt;br /&gt;
* Low-level improvements:&lt;br /&gt;
** CON is done as PCI burst&lt;br /&gt;
** Fibre-optic FIFO is emptied with timed read instead of polling.&lt;br /&gt;
** Hand-shaking for interrupts instead of host command to clear INTA and HC3.&lt;br /&gt;
** Non-interrupt context code disables interrupts when performing PCI transactions.&lt;br /&gt;
** Host vector interrupts are otherwise enabled, so PC doesn't have to force with HNMI bit.&lt;br /&gt;
* Bugs and fixes:&lt;br /&gt;
** Some PCI bus arbitration conditions are mis-handled.  This is fixed in U0106; alternately the commands below can be issued to patch active U0105 firmware.  (The patch will not survive a power cycle.):&lt;br /&gt;
*** http://e-mode.phas.ubc.ca/mce/arc_pci/firmware/patches/patch_U0105_unignore_pci_errors.bash&lt;br /&gt;
** Also this (see description in U0106):&lt;br /&gt;
*** http://e-mode.phas.ubc.ca/mce/arc_pci/firmware/patches/patch_U0106_safetyize_vector_ints.bash&lt;br /&gt;
&lt;br /&gt;
=== U0104: First version with non-realtime linux support ===&lt;br /&gt;
&lt;br /&gt;
* Implements quiet transfer mode!  Remains backwards compatible with A1.4.&lt;br /&gt;
* Fixes the 64k boundary crossing issue&lt;br /&gt;
* Moves parameters that enter via interrupt out of registers and into variables&lt;br /&gt;
* Version reporting tag-along to RDM command (sending 'VER' to RDM's vector address returns the code version).&lt;br /&gt;
* Maximum burst length is reduced to 64 bytes, and is configurable.&lt;br /&gt;
* Reset (RST) clears the fibre fifo&lt;br /&gt;
* Bugs:&lt;br /&gt;
** This (see description in U0106):&lt;br /&gt;
*** http://e-mode.phas.ubc.ca/mce/arc_pci/firmware/patches/patch_U0106_safetyize_vector_ints.bash&lt;br /&gt;
&lt;br /&gt;
== U0103: Oldest UBC release ==&lt;br /&gt;
&lt;br /&gt;
* Minor modifications of SCUBA2's A1.4 firmware, to improve PCI stability.&lt;br /&gt;
* Not compatible with non-realtime systems.&lt;br /&gt;
&lt;br /&gt;
== Programming the ARC64 Flash memory ==&lt;br /&gt;
&lt;br /&gt;
To program or upgrade the PCI card's firmware, it is necessary to remove the flash memory chip from the card and program it using a standard EEPROM programmer.&lt;br /&gt;
&lt;br /&gt;
# Obviously you should turn off your computer and stuff first.&lt;br /&gt;
# The chip is a large DIP located at U5 on the PCI board.  To remove the chip you may use one of the following (in increasing order of risk, and decreasing order of barbarism):&lt;br /&gt;
## telekinesis&lt;br /&gt;
## a chip removal tool&lt;br /&gt;
## needle-nose pliers&lt;br /&gt;
## a screw-driver&lt;br /&gt;
## thumb and finger&lt;br /&gt;
## fingers only&lt;br /&gt;
# The chip is a standard 256 Kbit electrically erasable Flash ROM.  If you can't find the particular part in your EEPROM programmer software, try using one of these compatible parts:&lt;br /&gt;
## Fujitsu MBM28C256&lt;br /&gt;
## CSI (Catalyst) CAT28C256 L&lt;br /&gt;
## Anything else that has 28C256 in its name as long as it is a 28-pin DIP package and you are using the right socket for your programmer.&lt;br /&gt;
# Some programmers won't recognize this chip as erasable.  You can just try programming the chip with the new firmware, or pseudo-erasing it first using a &amp;quot;scrubber&amp;quot; file (available for U0106 in the links above).&lt;br /&gt;
# The firmware we provide is compiled into a [ http://en.wikipedia.org/wiki/SREC_%28file_format%29 Motorola S-record format ] hex file.  This is a standard format that your programmer software should be able to cope with.&lt;br /&gt;
# When placing the chip back in the board, the notch on the chip should be at the same end as the notch on the socket.&lt;br /&gt;
&lt;br /&gt;
== Other information ==&lt;br /&gt;
&lt;br /&gt;
* [[ PCI card bug list ]]&lt;br /&gt;
* [[ PCI card hacking ]]&lt;br /&gt;
* [[ PCI card code assembly on Linux ]]&lt;br /&gt;
* [[MCE fibre protocol]]&lt;br /&gt;
&lt;br /&gt;
[[Category:PCI Card Firmware| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=PCI_card_firmware&amp;diff=7137</id>
		<title>PCI card firmware</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=PCI_card_firmware&amp;diff=7137"/>
		<updated>2021-11-17T02:19:31Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|PCI Card Firmware}}&lt;br /&gt;
UBC-produced firmware for the ARC-64 [[PCI card]].  [[MAS]] provides a linux kernel driver for this firmware.&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
These S-record files should work with any reasonable EEPROM programmer:&lt;br /&gt;
* U0107 (recommended) - http://e-mode.phas.ubc.ca/mce/firmware/sdsu/SDSU_RevU0107.s&lt;br /&gt;
* U0106 (old stable) - http://e-mode.phas.ubc.ca/mce/firmware/sdsu/SDSU_RevU0106.s&lt;br /&gt;
** 8-bit checksum 6FCDCE&lt;br /&gt;
** Scrubber file - try writing all ones to your  this to your chip first if your programmer won't let you &amp;quot;erase&amp;quot; it:&lt;br /&gt;
** http://e-mode.phas.ubc.ca/mce/firmware/sdsu/special/scrubber_RevU0106.s&lt;br /&gt;
* U0105 (deprecated) - http://e-mode.phas.ubc.ca/mce/firmware/sdsu/SDSU_RevU0105.s&lt;br /&gt;
* U0104 (deprecated) - http://e-mode.phas.ubc.ca/mce/firmware/sdsu/SDSU_RevU0104.s&lt;br /&gt;
&lt;br /&gt;
The full source code is available in these archives (it will not compile unless you get the correct assembler and stuff):&lt;br /&gt;
* U0106 - http://e-mode.phas.ubc.ca/mce/arc_pci/source_code/arc_pci-U0106.tar.gz&lt;br /&gt;
* U0105 - http://e-mode.phas.ubc.ca/mce/arc_pci/source_code/arc_pci-U0105.tar.gz&lt;br /&gt;
* U0104 - http://e-mode.phas.ubc.ca/mce/arc_pci/source_code/arc_pci-U0104.tar.gz&lt;br /&gt;
&lt;br /&gt;
The subversion tree can be obtained like this (you may not have access to this repository; contact UBC);&lt;br /&gt;
 git clone https://github.com/multi-channel-electronics/arc_pci&lt;br /&gt;
&lt;br /&gt;
It is laid out roughly as follows:&lt;br /&gt;
 /trunk       main line of development&lt;br /&gt;
 /releases    tagged versions of code &lt;br /&gt;
 /tools       debugging tools&lt;br /&gt;
 /clash       stuff for making CLAS work with wine and linux&lt;br /&gt;
 /docs        useful (though maybe not to you) notes&lt;br /&gt;
&lt;br /&gt;
== Firmware version notes ==&lt;br /&gt;
&lt;br /&gt;
=== U0107 (recommended) ===&lt;br /&gt;
&lt;br /&gt;
* This firmware can operate in either of two modes:&lt;br /&gt;
** '''U0106 compatibility mode''': the firmware will work with classic MAS driver, just like U0106 (plus some bugfixes).&lt;br /&gt;
** '''New Master-only mode''': when activated, uses new set of protocols for communication with the MAS driver.  These have proven to be much more stable on some systems.  Also, bigphysarea is no longer needed.&lt;br /&gt;
* Downloads:&lt;br /&gt;
** S-rec for release candidates here: http://e-mode.phas.ubc.ca/mce/firmware/sdsu/&lt;br /&gt;
** Soft-patches for upgrading U0106 to pseudo-U0107 temporarily: http://e-mode.phas.ubc.ca/mce/firmware/sdsu/patches/&lt;br /&gt;
* Some additional notes specific to U0107: [[U0107 Series Firmware]]&lt;br /&gt;
&lt;br /&gt;
=== U0106 (2011-11-21): Old stable version ===&lt;br /&gt;
&lt;br /&gt;
* Not recommended for new projects&lt;br /&gt;
* Backward compatible with U0104 and U0105.&lt;br /&gt;
* Fixes bug introduced in U0105 that prevented handling of some PCI bus errors.&lt;br /&gt;
* Introduction of command to update PCI burst size.&lt;br /&gt;
* Bugs:&lt;br /&gt;
** Versions U0104-6 all suffer from the following issues:&lt;br /&gt;
*** Host interrupts use bit-test instructions, which are not interrupt safe; consequence is a race condition that can upset ongoing tasks such as FO downloads and PCI bursts.  Patch for this issue, applicable to firmware versions U0104-6:&lt;br /&gt;
**** http://e-mode.phas.ubc.ca/mce/arc_pci/firmware/patches/patch_U0106_safetyize_vector_ints.bash&lt;br /&gt;
*** Multiple simultaneous PCI bus errors are not handled properly, leading to stale bits in the error register.  This is an unlikely error vector, but should be fixed.&lt;br /&gt;
&lt;br /&gt;
=== U0105 (2009-06-08) ===&lt;br /&gt;
&lt;br /&gt;
* Backward compatible with U0104.&lt;br /&gt;
* Support for MCE STOP commands and commands-on-the-fly.&lt;br /&gt;
* Accelerated MCE command code (along with Quiet-RP this increases commanding rate to ~6 kHz).&lt;br /&gt;
* Quiet-RP simplifies the protocol for MCE reply handling.&lt;br /&gt;
* Low-level improvements:&lt;br /&gt;
** CON is done as PCI burst&lt;br /&gt;
** Fibre-optic FIFO is emptied with timed read instead of polling.&lt;br /&gt;
** Hand-shaking for interrupts instead of host command to clear INTA and HC3.&lt;br /&gt;
** Non-interrupt context code disables interrupts when performing PCI transactions.&lt;br /&gt;
** Host vector interrupts are otherwise enabled, so PC doesn't have to force with HNMI bit.&lt;br /&gt;
* Bugs and fixes:&lt;br /&gt;
** Some PCI bus arbitration conditions are mis-handled.  This is fixed in U0106; alternately the commands below can be issued to patch active U0105 firmware.  (The patch will not survive a power cycle.):&lt;br /&gt;
*** http://e-mode.phas.ubc.ca/mce/arc_pci/firmware/patches/patch_U0105_unignore_pci_errors.bash&lt;br /&gt;
** Also this (see description in U0106):&lt;br /&gt;
*** http://e-mode.phas.ubc.ca/mce/arc_pci/firmware/patches/patch_U0106_safetyize_vector_ints.bash&lt;br /&gt;
&lt;br /&gt;
=== U0104: First version with non-realtime linux support ===&lt;br /&gt;
&lt;br /&gt;
* Implements quiet transfer mode!  Remains backwards compatible with A1.4.&lt;br /&gt;
* Fixes the 64k boundary crossing issue&lt;br /&gt;
* Moves parameters that enter via interrupt out of registers and into variables&lt;br /&gt;
* Version reporting tag-along to RDM command (sending 'VER' to RDM's vector address returns the code version).&lt;br /&gt;
* Maximum burst length is reduced to 64 bytes, and is configurable.&lt;br /&gt;
* Reset (RST) clears the fibre fifo&lt;br /&gt;
* Bugs:&lt;br /&gt;
** This (see description in U0106):&lt;br /&gt;
*** http://e-mode.phas.ubc.ca/mce/arc_pci/firmware/patches/patch_U0106_safetyize_vector_ints.bash&lt;br /&gt;
&lt;br /&gt;
== U0103: Oldest UBC release ==&lt;br /&gt;
&lt;br /&gt;
* Minor modifications of SCUBA2's A1.4 firmware, to improve PCI stability.&lt;br /&gt;
* Not compatible with non-realtime systems.&lt;br /&gt;
&lt;br /&gt;
== Programming the ARC64 Flash memory ==&lt;br /&gt;
&lt;br /&gt;
To program or upgrade the PCI card's firmware, it is necessary to remove the flash memory chip from the card and program it using a standard EEPROM programmer.&lt;br /&gt;
&lt;br /&gt;
# Obviously you should turn off your computer and stuff first.&lt;br /&gt;
# The chip is a large DIP located at U5 on the PCI board.  To remove the chip you may use one of the following (in increasing order of risk, and decreasing order of barbarism):&lt;br /&gt;
## telekinesis&lt;br /&gt;
## a chip removal tool&lt;br /&gt;
## needle-nose pliers&lt;br /&gt;
## a screw-driver&lt;br /&gt;
## thumb and finger&lt;br /&gt;
## fingers only&lt;br /&gt;
# The chip is a standard 256 Kbit electrically erasable Flash ROM.  If you can't find the particular part in your EEPROM programmer software, try using one of these compatible parts:&lt;br /&gt;
## Fujitsu MBM28C256&lt;br /&gt;
## CSI (Catalyst) CAT28C256 L&lt;br /&gt;
## Anything else that has 28C256 in its name as long as it is a 28-pin DIP package and you are using the right socket for your programmer.&lt;br /&gt;
# Some programmers won't recognize this chip as erasable.  You can just try programming the chip with the new firmware, or pseudo-erasing it first using a &amp;quot;scrubber&amp;quot; file (available for U0106 in the links above).&lt;br /&gt;
# The firmware we provide is compiled into a [ http://en.wikipedia.org/wiki/SREC_%28file_format%29 Motorola S-record format ] hex file.  This is a standard format that your programmer software should be able to cope with.&lt;br /&gt;
# When placing the chip back in the board, the notch on the chip should be at the same end as the notch on the socket.&lt;br /&gt;
&lt;br /&gt;
== Other information ==&lt;br /&gt;
&lt;br /&gt;
* [[ PCI card bug list ]]&lt;br /&gt;
* [[ PCI card hacking ]]&lt;br /&gt;
* [[ PCI card code assembly on Linux ]]&lt;br /&gt;
* [[MCE fibre protocol]]&lt;br /&gt;
&lt;br /&gt;
[[Category:PCI Card Firmware| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Auto-setup&amp;diff=7136</id>
		<title>Auto-setup</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Auto-setup&amp;diff=7136"/>
		<updated>2021-11-17T02:18:49Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|Tuning}}&lt;br /&gt;
The python-based auto-setup is the primary tool used to tune the TES array.  It provides a modular, flexible approach to tuning.  The actions of acquisition, analysis, and plotting have been carefully separated.  Objects exist to manage the locations of data and outputs to provide flexibility.  Tools are provided to assist with loading and analyzing existing tuning data.&lt;br /&gt;
&lt;br /&gt;
Currently the python auto-setup relies on scripts such as ramp_sa_bias and the mux_lock C programs to acquire the tuning data.  Inside the python environment, data is loaded and manipulated as numpy arrays. &lt;br /&gt;
&lt;br /&gt;
= Obtaining python auto_setup =&lt;br /&gt;
&lt;br /&gt;
Auto-setup is part of the [[MCE script]] project.  See the &amp;lt;tt&amp;gt;python/auto_setup&amp;lt;/tt&amp;gt; subdirectory.  You can get MCE script from the [[Code repositories|GitHub]].&lt;br /&gt;
&lt;br /&gt;
= Script-level support =&lt;br /&gt;
&lt;br /&gt;
Pass &amp;quot;-h&amp;quot; to any of the scripts below to get a usage message.&lt;br /&gt;
&lt;br /&gt;
== auto_setup ==&lt;br /&gt;
&lt;br /&gt;
The executable script '''auto_setup''' can be used to tune SQUID arrays from the command line.&lt;br /&gt;
&lt;br /&gt;
== plot_tuning ==&lt;br /&gt;
&lt;br /&gt;
The executable script '''plot_tuning''' can be used create plots from existing tuning data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= The &amp;quot;auto_setup&amp;quot; module =&lt;br /&gt;
&lt;br /&gt;
The following classes may be useful for off-line analysis of tuning data.  Note that the *Ramp and *Servo classes all inherit from the RCData class, takes a slightly eccentric approach to indexing the data it contains.&lt;br /&gt;
&lt;br /&gt;
== class util.FileSet ==&lt;br /&gt;
&lt;br /&gt;
The FileSet class can be used to locate and group tuning data files, so that they can be more easily loaded as *Ramp and *Servo objects.  Use like this:&lt;br /&gt;
&lt;br /&gt;
 import auto_setup as ast&lt;br /&gt;
 tuning_dir = '/data/cryo/current_data/1234560000'&lt;br /&gt;
 fs = ast.util.FileSet(tuning_dir)&lt;br /&gt;
 for stage in ['sa_ramp', 'sq2_servo', 'sq1_servo', 'sq1_ramp']:&lt;br /&gt;
   print fs.stage_all(stage)&lt;br /&gt;
&lt;br /&gt;
This will print out the data files associated with each tuning stage.  They can be loaded and combined using a join method, e.g.:&lt;br /&gt;
 sa_ramps = [SARamp(f) for f in fs.stage_all('sa_ramp')]  # individual ramps per RC&lt;br /&gt;
 sa_ramp = SARamp.join(sa_ramps)                          # single, coherent ramp data object&lt;br /&gt;
&lt;br /&gt;
Note that this join procedure isn't necessary if there is only one data file per squid stage (the default in modern python auto_setup).  Older code acquired tuning data on each readout card individually; so the join procedure outlined should permit convenient loading of legacy data.&lt;br /&gt;
&lt;br /&gt;
== class util.mas_path ==&lt;br /&gt;
&lt;br /&gt;
The mas_path class can be used to simplify path look-up.  In the past this was simply done using environmental variables.  That method doesn't work that well with [[Multicard MAS]]; mas_path abstracts path look-up, hiding the details of how paths are determined from the caller.  Use like this:&lt;br /&gt;
&lt;br /&gt;
 from auto_setup.util import mas_path&lt;br /&gt;
 mp = mas_path()&lt;br /&gt;
 print mp.data_dir()&lt;br /&gt;
&lt;br /&gt;
mas_path figures out paths by performing the following tests:&lt;br /&gt;
# if [[mas_var]] is present, it is run to determine the path&lt;br /&gt;
# if that doesn't work, mas_path looks in the environment for an appropriately named MAS_&amp;lt;...&amp;gt; variable and reports its value&lt;br /&gt;
# if neither of the above work, mas_path produces a &amp;quot;sensible default value&amp;quot;.&lt;br /&gt;
Directories are cached after the first look-up.&lt;br /&gt;
&lt;br /&gt;
A fibre card number (ignored if not-running [[Multicard MAS]]), an alternate [[mas.cfg]] file (only used if [[mas_var]] is run) and an alternate [[mas_var]] program can be passed to mas_path:&lt;br /&gt;
&lt;br /&gt;
 from auto_setup.util import mas_path&lt;br /&gt;
 mp = mas_path(fibre_card=1, mas_cfg=&amp;quot;/etc/mce/mas-alternate.cfg&amp;quot;, mas_var=&amp;quot;/some/other/mas_var&amp;quot;)&lt;br /&gt;
 print mp.data_dir()&lt;br /&gt;
&lt;br /&gt;
If no fibre_card is specified, the value of $MAS_MCE_DEV is used, if it exists, otherwise zero is used as a default fibre card number.  If mas_var is not specified, the value of $MAS_VAR is tried, if it exists, otherwise the default path &amp;quot;/usr/mce/bin/mas_var&amp;quot; is tried.  If mas_var can't be found, the first of the three tests is simply skipped without error.&lt;br /&gt;
&lt;br /&gt;
The following methods are defined in this class:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bin_dir()&amp;lt;/code&amp;gt;: returns the location of the MAS binaries (ie. $MAS_BIN, if defined); &amp;quot;/usr/mce/bin&amp;quot; is the default.&lt;br /&gt;
* &amp;lt;code&amp;gt;config_dir()&amp;lt;/code&amp;gt;: returns the location of the MCE script configuration (ie. $MAS_CONFIG, if defined); &amp;quot;/usr/mce/config&amp;quot; is the default.&lt;br /&gt;
* &amp;lt;code&amp;gt;data_root()&amp;lt;/code&amp;gt;: returns the root data directory ($MAS_DATA_ROOT, if defined); the default is &amp;quot;/data/mce''N''&amp;quot; where ''N'' is the fibre card number.  However, for backwards compatibility, if the &amp;quot;/data/mce''N''&amp;quot; directory doesn't exist, &amp;quot;/data/cryo&amp;quot; will be returned instead.&lt;br /&gt;
* &amp;lt;code&amp;gt;data_dir()&amp;lt;/code&amp;gt;: returns the current data directory ($MAS_DATA, if defined); the default is the value returned by &amp;lt;code&amp;gt;data_root()&amp;lt;/code&amp;gt; with &amp;quot;/current_data&amp;quot; appended.&lt;br /&gt;
* &amp;lt;code&amp;gt;etc_dir()&amp;lt;/code&amp;gt;: returns the location of the MAS configuration files ($MAS_ETC, if defined); &amp;quot;/etc/mce&amp;quot; is the default.&lt;br /&gt;
* &amp;lt;code&amp;gt;experiment_file()&amp;lt;/code&amp;gt;: returns the location of the experiment config file (no corresponding environmental variable); the default is the value returned by &amp;lt;code&amp;gt;data_dir()&amp;lt;/code&amp;gt; with &amp;quot;/experiment.cfg&amp;quot; appended.&lt;br /&gt;
* &amp;lt;code&amp;gt;hardware_file()&amp;lt;/code&amp;gt;: returns the location of the hardware config file (no corresponding environmental variable); the default is the value returned by &amp;lt;code&amp;gt;etc_dir()&amp;lt;/code&amp;gt; with &amp;quot;/mce''N''.cfg&amp;quot; appended, where ''N'' is the fibre card number.  However, for backwards compatibility, if the &amp;quot;mce''N''.cfg&amp;quot; file doesn't exist, plain &amp;quot;mce.cfg&amp;quot; will be used instead.&lt;br /&gt;
* &amp;lt;code&amp;gt;mas_prefix()&amp;lt;/code&amp;gt;: returns the location of the installed MAS tree (ie. $MAS_PREFIX, if defined); &amp;quot;/usr/mce&amp;quot; is the default.&lt;br /&gt;
* &amp;lt;code&amp;gt;temp_dir()&amp;lt;/code&amp;gt;: returns the location of the MAS/MCE script temp directory ($MAS_TEMP, if defined); &amp;quot;/tmp&amp;quot; is the default.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;mas_root()&amp;lt;/code&amp;gt;: returns the location of the MCE script tree (ie. $MAS_ROOT, if defined); &amp;quot;/usr/mce/mce_script&amp;quot; is the default.&lt;br /&gt;
* &amp;lt;code&amp;gt;idl_dir()&amp;lt;/code&amp;gt;: returns the location of the MCE script IDL directory (ie. $MAS_IDL, if defined); the default is the value returned by &amp;lt;code&amp;gt;mas_root()&amp;lt;/code&amp;gt; with &amp;quot;/idl_pro&amp;quot; appended.&lt;br /&gt;
* &amp;lt;code&amp;gt;python_dir()&amp;lt;/code&amp;gt;: returns the location of the MCE script Python directory (ie. $MAS_PYTHON, if defined); the default is the value returned by &amp;lt;code&amp;gt;mas_root()&amp;lt;/code&amp;gt; with &amp;quot;/python&amp;quot; appended.&lt;br /&gt;
* &amp;lt;code&amp;gt;script_dir()&amp;lt;/code&amp;gt;: returns the location of the MCE script shell script directory (ie. $MAS_SCRIPT, if defined); the default is the value returned by &amp;lt;code&amp;gt;mas_root()&amp;lt;/code&amp;gt; with &amp;quot;/script&amp;quot; appended.&lt;br /&gt;
* &amp;lt;code&amp;gt;template_dir()&amp;lt;/code&amp;gt;: returns the location of the MCE script template directory (ie. $MAS_TEMPLATE, if defined); the default is the value returned by &amp;lt;code&amp;gt;mas_root()&amp;lt;/code&amp;gt; with &amp;quot;/template&amp;quot; appended.&lt;br /&gt;
* &amp;lt;code&amp;gt;test_suite_dir()&amp;lt;/code&amp;gt;: returns the location of the MCE script test suite directory (ie. $MAS_TEST_SUITE, if defined); the default is the value returned by &amp;lt;code&amp;gt;mas_root()&amp;lt;/code&amp;gt; with &amp;quot;/test_suite&amp;quot; appended.&lt;br /&gt;
&lt;br /&gt;
These functions are all implemented through calls to the low-level method:&lt;br /&gt;
&lt;br /&gt;
  __get_path__(name, env, default)&lt;br /&gt;
&lt;br /&gt;
where:&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; is the name of a [[mas_var]] parameter to check, excluding the initial &amp;quot;--&amp;quot;, or None&lt;br /&gt;
* &amp;lt;code&amp;gt;env&amp;lt;/code&amp;gt; is the name of an environmental variable to check, or None&lt;br /&gt;
* &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; is the default value to return if other look-up methods fail.&lt;br /&gt;
Ie., the &amp;lt;code&amp;gt;mas_path().bin_dir()&amp;lt;/code&amp;gt; method is implemented using the call:&lt;br /&gt;
&lt;br /&gt;
 mas_path().__get_path__('bin-dir', 'MAS_BIN', '/usr/mce/bin')&lt;br /&gt;
&lt;br /&gt;
== class SARamp ==&lt;br /&gt;
== class SQ2Servo==&lt;br /&gt;
== class SQ1Servo ==&lt;br /&gt;
== class SQ1Ramp ==&lt;br /&gt;
&lt;br /&gt;
== class RCData ==&lt;br /&gt;
&lt;br /&gt;
This class stores time-ordered data for some set of detectors.  Tuning data sets can be quite complex (consider a multi-bias, all-row SQ1 Servo for example) and so a certain convention has been adopted to indicate different structuring of the data.  In all cases, the data themselves are stored in a 2-d numpy array, with the second index representing the time index and the first index encapsulating all other degrees of freedom (row, column, bias index,...).  The underlying data shape is contained in the attribute '''data_shape'''.  This is not to be confused with '''data.shape''', which is the actual numpy dimensionality of the '''data''' array.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Form of data&lt;br /&gt;
! data_shape&lt;br /&gt;
! data.shape&lt;br /&gt;
! gridded&lt;br /&gt;
! rows&lt;br /&gt;
! cols&lt;br /&gt;
|-&lt;br /&gt;
| One time-stream per channel&lt;br /&gt;
| (n_row, n_col, n_time)&lt;br /&gt;
| (n_row*n_col, n_time)&lt;br /&gt;
| True&lt;br /&gt;
| list of rows (size n_row)&lt;br /&gt;
| list of columns (size n_col)&lt;br /&gt;
|-&lt;br /&gt;
| Multi-bias data; n_bias time-stream per channel&lt;br /&gt;
| (n_bias, n_row, n_col, n_time)&lt;br /&gt;
| (n_bias*n_row*n_col, n_time)&lt;br /&gt;
| True&lt;br /&gt;
| list of rows (size n_chan)&lt;br /&gt;
| list of columns (size n_chan)&lt;br /&gt;
|-&lt;br /&gt;
| One time stream for some set of row, column pairs&lt;br /&gt;
| (1, n_chan, n_time)&lt;br /&gt;
| (n_chan, n_time)&lt;br /&gt;
| False&lt;br /&gt;
| list of rows (size n_chan)&lt;br /&gt;
| list of columns (size n_chan)&lt;br /&gt;
|-&lt;br /&gt;
| Multi-bias data; for some set of row, column pairs&lt;br /&gt;
| (n_bias, 1, n_chan, n_time)&lt;br /&gt;
| (n_bias*n_chan, n_time)&lt;br /&gt;
| False&lt;br /&gt;
| list of rows (size n_chan)&lt;br /&gt;
| list of columns (size n_chan)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== class config.configFile ==&lt;br /&gt;
&lt;br /&gt;
This is a class for reading and modifying simple libconfig configuration files, such as [[experiment.cfg]].  The class extends the python &amp;quot;dict&amp;quot; class; keys from the configuration file become the keys of the dictionary.  The class calls [[mas_param]] to decode the specified config file, including type information.  Array data are stored as numpy arrays.&lt;br /&gt;
&lt;br /&gt;
Typical usage in a script, to obtain access to experiment.cfg parameters, is done like this:&lt;br /&gt;
 from auto_setup.config import configFile&lt;br /&gt;
 cfg = configFile('/data/cryo/current_data/experiment.cfg')&lt;br /&gt;
 &lt;br /&gt;
 print cfg['default_num_rows']&lt;br /&gt;
 print cfg['sa_bias']&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
 33&lt;br /&gt;
 [42000 15000 16500 15000 15000 15000 15000 15000     0     0&lt;br /&gt;
      0     0     0     0     0     0     0     0     0     0&lt;br /&gt;
      0     0     0     0     0     0     0     0     0     0&lt;br /&gt;
      0     0]&lt;br /&gt;
&lt;br /&gt;
=== Updating values ===&lt;br /&gt;
&lt;br /&gt;
There are two ways to update values in the target configuration file.  The first is to use &amp;quot;set_param&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 cfg.set_param('sa_bias', [65535] * 32)    # write 65535 to all 32 entries of SA bias&lt;br /&gt;
&lt;br /&gt;
This will immediately update the target configuration file, with a single call to mas_param to set the 'sa_bias' key.&lt;br /&gt;
&lt;br /&gt;
The second way may be more convenient when modifying a large number of parameters.  One updates the dict with new values and then calls the .write() method:&lt;br /&gt;
 cfg['sa_bias'] = [65535] * 32&lt;br /&gt;
 cfg['sa_offset'] = [1000] * 32&lt;br /&gt;
 cfg['sq2_bias'] = [0] * 32&lt;br /&gt;
 cfg.write()&lt;br /&gt;
&lt;br /&gt;
Note that cfg.write() will rewrite *all* of the keys, not just the ones you have changed.  This will make it somewhat slower and potentially more confusing than using cfg.set_param.  So you might just want to stick with set_param.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tuning| ]]&lt;br /&gt;
[[Category:Python]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Sync_Box_firmware&amp;diff=7135</id>
		<title>Sync Box firmware</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Sync_Box_firmware&amp;diff=7135"/>
		<updated>2021-11-17T02:18:31Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|Sync Box Firmware}}&lt;br /&gt;
There is an Altera CPLD (EPM570T144C3) and an Atmel micro-controller (AT89C51) on in the [[Sync Box]].&lt;br /&gt;
* SyncBox CPLD Firmware Description [[http://www.phas.ubc.ca/~mce/mcedocs/hardware/Firmware_block_spec/SyncBox/SyncBox_FwDescr_S589_201.pdf PDF]] (SC2-ELE-S589-201)&lt;br /&gt;
* SyncBox Microcontroller Software Description [[http://www.phas.ubc.ca/~mce/mcedocs/hardware/Firmware_block_spec/SyncBox/SyncBox_SWDescr_S589_202.pdf PDF]] (SC2-ELE-S589-202)&lt;br /&gt;
&lt;br /&gt;
Consequently, there are two sets of firmware:&lt;br /&gt;
*firmware for the CPLD part (*.pof file)&lt;br /&gt;
*firmware for the microcontroller (*.hex file)&lt;br /&gt;
&lt;br /&gt;
== Firmware Upgrade Instructions ==&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
&lt;br /&gt;
Firmware is available from the MCE firmware repository:&lt;br /&gt;
&lt;br /&gt;
* http://e-mode.phas.ubc.ca/mce_firmware/sync_box&lt;br /&gt;
&lt;br /&gt;
To upgrade the Sync Box firmware, ''most times'' both the microcontroller and the CPLD firmware need to be reprogrammed.&lt;br /&gt;
&lt;br /&gt;
=== CPLD programming (&amp;lt;tt&amp;gt;.pof&amp;lt;/tt&amp;gt; file) ===&lt;br /&gt;
The CPLD firmware can be loaded using the Altera USB-Blaster that connects to the on-board P23 JTAG header, and Quartus Programmer software. A &amp;lt;tt&amp;gt;.pof&amp;lt;/tt&amp;gt; file needs to be loaded.  The P23 connector is not wired out to the sync box enclosure.  To access it, remove the sync box cover plate.&lt;br /&gt;
&lt;br /&gt;
=== Microcontroller programming (&amp;lt;tt&amp;gt;.hex&amp;lt;/tt&amp;gt; file) ===&lt;br /&gt;
The microcontroller program is loaded over a USB cable that connects your computer to the on-board J1 (USB-B) connector.  This connector is not wired out to the sync box enclosure: to access it, remove the top cover.  In the past we used Atmel's [http://www.atmel.com/tools/FLIP.aspx Flip Programmer].  Now we recommend running &amp;lt;tt&amp;gt;dfu-programmer&amp;lt;/tt&amp;gt; on linux.  See:&lt;br /&gt;
* [[Sync Box Firmware Upgrade using dfu-programmer]].&lt;br /&gt;
&lt;br /&gt;
==== Enabling reprogramming over USB ====&lt;br /&gt;
Regardless of what you use to program the sync box, you need to get the sync box bootloader to restart in reprogramming mode.  To do this, the procedure is:&lt;br /&gt;
# Start with the sync box powered off and disconnected from USB&lt;br /&gt;
# Depress ''both'' the on-board RESET switch and the PS_EN switch.  The PS_EN switch may be labeled as PRG_EN.  Both switches are located next to the USB J1 connector on the board.  '''NB''': This is ''not'' the reset switch on the outside of the sync box enclosure.&lt;br /&gt;
# Power on the sync box.&lt;br /&gt;
# Release the RESET switch&lt;br /&gt;
# Release the PS_EN switch&lt;br /&gt;
# Plug in the USB cable&lt;br /&gt;
If this procedure is successfully performed, the sync box will present itself as a USB device to your computer.  Your computer should now detect the sync box as an Atmel AT89C5131 device.  If the sync box isn't accepting USB protocol commands, turn it off and try the procedure again.&lt;br /&gt;
&lt;br /&gt;
== Releases ==&lt;br /&gt;
&lt;br /&gt;
=== Firmware set Rev. 31 ===&lt;br /&gt;
; Filename&lt;br /&gt;
: sync_box_v31_21Jun2016.hex&lt;br /&gt;
: sync_box_v31_21Jun2016.pof&lt;br /&gt;
&lt;br /&gt;
; Features&lt;br /&gt;
: The two banks of Manchester outputs can now be configured independently.  This permits up to 4 MCEs to share one timing configuration, while up to 4 other MCEs share a second timing configuration.&lt;br /&gt;
: The microprocessor's on-board EEPROM can be used to load and save configurations.  A preferred configuration can be loaded &amp;quot;on startup&amp;quot;, so there is no need for per-experiment defaults.&lt;br /&gt;
&lt;br /&gt;
; Notes&lt;br /&gt;
: The firmware version is not reported by the serial interface.  Subsequent versions will report the version, so if you see the &amp;quot;eeprom&amp;quot; menu but no version number then you're probably looking at v31!&lt;br /&gt;
&lt;br /&gt;
=== Firmware set Rev. 30 ===&lt;br /&gt;
&lt;br /&gt;
; Features&lt;br /&gt;
: The microprocessor code has been ported to the sdcc compiler.  There are no changes in behaviour.  This code should continue to work with CPLD code from version 1f.&lt;br /&gt;
&lt;br /&gt;
=== Firmware set Rev. 22 ===&lt;br /&gt;
; Filename&lt;br /&gt;
: sync_box_v22_26sep2014.hex&lt;br /&gt;
: no change to cpld code&lt;br /&gt;
&lt;br /&gt;
; Features&lt;br /&gt;
: Sync Box default values are set for ACT values: fr=38, num_rows=33, row_len=50&lt;br /&gt;
&lt;br /&gt;
=== Firmware set Rev. 21 ===&lt;br /&gt;
; Filename&lt;br /&gt;
: sync_box_v21_02sep2014.pof&lt;br /&gt;
: no change to microcontroller code or *.hex file&lt;br /&gt;
&lt;br /&gt;
; Features&lt;br /&gt;
: DV_FTS and DV_POL are now duplicate copies of DV_SPARE1 and DV_SPARE2, respectively. See [http://e-mode.phas.ubc.ca/mcewiki/index.php/Sync_Box_AC-in_Rack_Mount_io IO for rackmount AC-in Sync Box]&lt;br /&gt;
&lt;br /&gt;
=== Firmware set Rev. 20 ===&lt;br /&gt;
; Filename&lt;br /&gt;
: sync_box_v20_22aug2013.hex&lt;br /&gt;
&lt;br /&gt;
; Features&lt;br /&gt;
: hard-coded Spider values of fr=120, num_rows=33, row_len=53 (which translates to row_len=106 on mce front)&lt;br /&gt;
: firmware revision on rs232 interface now shows 20&lt;br /&gt;
=== Firmware set Rev. 1f ===&lt;br /&gt;
; Filename&lt;br /&gt;
: sync_box_v1f_25feb2010.pof&lt;br /&gt;
: sync_box_v1f_25feb2010.hex&lt;br /&gt;
&lt;br /&gt;
; Features&lt;br /&gt;
: adds a ckd command to the rs232 interface to adjust the frequency of DV_Spare1 and DV_Spare2 by setting a 50MHz divisor through the command.&lt;br /&gt;
: when you turn on the sync box, the firmware revision 1f appears on the rs232 terminal&lt;br /&gt;
&lt;br /&gt;
=== Firmware set Rev. 1e (6e?) ===&lt;br /&gt;
; Filename&lt;br /&gt;
: sync_box_v6e_11aug2008.pof&lt;br /&gt;
: sync_box_v1c_17nov2006.hex&lt;br /&gt;
&lt;br /&gt;
; Features&lt;br /&gt;
: added a 50MHz clock on SMA output of the Sync box&lt;br /&gt;
&lt;br /&gt;
; Note&lt;br /&gt;
: Since the microcontroller code is still 1c and that is what is reported in rs232 terminal, there is no way to identify this set from a 1c set.&lt;br /&gt;
&lt;br /&gt;
=== Firmware set Rev. 1c ===&lt;br /&gt;
; Filename&lt;br /&gt;
: sync_box_v6c_19oct2006.pof&lt;br /&gt;
: sync_box_v1c_17nov2006.hex&lt;br /&gt;
&lt;br /&gt;
; Features&lt;br /&gt;
original firmware&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
The sync box source (both CPLD and Atmel code) is available in the &amp;lt;tt&amp;gt;sync_box&amp;lt;/tt&amp;gt; project in the [[Code repositories|Multi-Channel Electronics GitHub project]].  So, something like this might work:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/multi-channel-electronics/sync_box.git&lt;br /&gt;
&lt;br /&gt;
=== Building the code ===&lt;br /&gt;
The CPLD code needs to be rebuilt using Quartus.  The Atmel code is compiled with &amp;lt;tt&amp;gt;[http://sdcc.sourceforge.net/ sdcc]&amp;lt;/tt&amp;gt;, which is available in many Linux distributions.  In Ubuntu:&lt;br /&gt;
 sudo apt-get install sdcc&lt;br /&gt;
&lt;br /&gt;
[[Category:Sync Box Firmware| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_script&amp;diff=7134</id>
		<title>MCE script</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_script&amp;diff=7134"/>
		<updated>2021-11-17T02:17:13Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|MCE Script}}&lt;br /&gt;
The '''MCE script''' project is a collection of array setup tools and other utilities, built on top of [[MAS]], useful for running experiments.  MCE script is housed in a SVN repository at UBC.  See [[Code repositories]] for details on downloading MCE script.&lt;br /&gt;
&lt;br /&gt;
= Tutorials =&lt;br /&gt;
&lt;br /&gt;
* [[ Basic mce_script configuration ]]&lt;br /&gt;
* [[ Series array setup ]]&lt;br /&gt;
&lt;br /&gt;
= Tool descriptions =&lt;br /&gt;
* Auto-tuning system&lt;br /&gt;
** [[ Auto-setup (python) ]] - an integrated tool set for dealing with SQUID data.&lt;br /&gt;
** [[ auto_setup_squids.pro | Auto-setup (IDL) ]] - IDL-based auto-tuning code (obsolete)&lt;br /&gt;
** [[ experiment.cfg ]] - array and auto-setup configuration data.&lt;br /&gt;
** [[ mce_config_template system ]]&lt;br /&gt;
* Other scripts&lt;br /&gt;
** [[MCE Test Scripts]]&lt;br /&gt;
** [[MCE script utilities]]&lt;br /&gt;
** [[ place_sq1.pro ]] for row selection for the purposes of sq1servo&lt;br /&gt;
** [[ IV curves ]] - acquire and analyze TES IV curves&lt;br /&gt;
** [[ special_ops.py ]]&lt;br /&gt;
** [[ measure_quanta.py ]] - Analyzes tuning data to determine SQUID phi0.&lt;br /&gt;
* Scripting tools&lt;br /&gt;
** [[ mce_internal_ramp ]] - configure and run MCE internal command ramps&lt;br /&gt;
** [[Environmental variables]]&lt;br /&gt;
&lt;br /&gt;
= Other resources =&lt;br /&gt;
&lt;br /&gt;
* Educational tools&lt;br /&gt;
** [[ Media:MAS_auto-tuning_20090529.pdf ]] - Some quick graphical depictions of auto-tuning. (Not a stand-alone presentation!)&lt;br /&gt;
** Characterization and Locking SQUIDs with Multi-Channel Electronics [[http://www.phas.ubc.ca/%7Emce/mcedocs/software/locking_squids.pdf PDF]] (Jun. 07, 2005)&lt;br /&gt;
&lt;br /&gt;
* Sample auto-tune plots:&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/auto_tune_results/biasing_ac_sq2fb_switching biasing ac sq2fb switching]&lt;br /&gt;
** [http://www.phas.ubc.ca/%7Emce/mcedocs/auto_tune_results/biasing_ac_not_switching biasing ac not switching]&lt;br /&gt;
[[Category:MCE Script| ]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Main_Page&amp;diff=7133</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Main_Page&amp;diff=7133"/>
		<updated>2021-11-17T02:16:07Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Wiki is for users of UBC's '''Multi-Channel Electronics''' (MCE), including the '''MCE Acquisition Software''' (MAS).&lt;br /&gt;
__NOTOC__&lt;br /&gt;
== MCE Overview ==&lt;br /&gt;
The MCE described here borrows heavily from the designs used at [http://www.nist.gov/pml/ NIST]. Changes have been made to upgrade components, achieve higher integration, and match to the specific experimental configurations.&lt;br /&gt;
&lt;br /&gt;
In basic operation, one MCE [[subrack]] controls the SQUID amplifiers and multiplexer, and reads signals from one 32×41 pixel or 16×41 pixel sub-array. The system hardware is completely modular at the sub-array level. Each sub-array is connected via woven cryogenic cables to a single MCE subrack through 3 or 5 MDM connectors. Each MCE subrack is, in turn, connected by an optical fibre to a single data-acquisition PC running Linux and data-acquisition software ([[MAS]]) developed at UBC.&lt;br /&gt;
 &lt;br /&gt;
Each MCE consists of hybrid analog/digital hardware and firmware developed for [https://www.altera.com/ Altera] [https://www.altera.com/products/fpga/stratix-series.html Stratix FPGAs]. A subrack has up to nine cards: including 2 or 4 [[Readout card]]s each of which reads 8 output columns through 14-bit 50MHz ADCs; 1 [[address card]] to multiplex the first-stage SQUIDs biases at around 20kHz; 1 [[clock card]] to interpret commands and to synchronize all the cards using a 25MHz clock; 2 or 3 [[bias card]]s to control the SQUID series-array feedback, the second-stage SQUID bias and feedback as well as the bolometer bias and heater. During [[auto_setup|detector setup]], the MCE is used to calculate the optimal operating points for the bolometers and the SQUID amplifiers by measuring their characteristics using open and closed feedback loops. During observation, MCE uses a running PID-calculation to determine the first-stage SQUID feedback necessary to keep the whole amplification chain in a linear regime.&lt;br /&gt;
&lt;br /&gt;
In conjunction with the MCEs, a [[Sync Box]] supplies data-valid pulses with serial numbers to all MCE subracks and to the telescope pointing system. This allows synchronization between the data acquisition, the pointing system, and the telescope housekeeping.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
* [[ MCE hardware | MCE Hardware ]] - information on MCE hardware (and accessories)&lt;br /&gt;
* [[ MCE firmware | MCE Firmware ]] - firmware versions, features, and tools (including sync box and PCI card firmware)&lt;br /&gt;
* [[ MAS ]] - the MCE Acquisition Software - kernel driver and low-level tools&lt;br /&gt;
* [[ MCE script ]] - SQUID array setup programs&lt;br /&gt;
* [[ MCE usage ]] - practical usage and reference documents&lt;br /&gt;
* [[Publications]] - technical publications relating to the Multi-Channel Electronics&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
&lt;br /&gt;
All MCE code is available on GitHub:&lt;br /&gt;
:https://github.com/multi-channel-electronics&lt;br /&gt;
&lt;br /&gt;
== Contact Info ==&lt;br /&gt;
&lt;br /&gt;
The '''&amp;lt;code&amp;gt;[[mce-announce]]&amp;lt;/code&amp;gt;''' e-mail list is used to communicate important firmware and software updates to the MCE user community.  See the [[mce-announce]] page for details on how to subscribe.&lt;br /&gt;
&lt;br /&gt;
 MCE Lab:                   604-822-2585&lt;br /&gt;
 Halpern's Lab:             604-822-6709&lt;br /&gt;
 &lt;br /&gt;
 Hardware:         mandana at phas.ubc.ca, halpern at phas.ubc.ca&lt;br /&gt;
 Firmware:         mandana at phas.ubc.ca&lt;br /&gt;
 Software:         mhasselfield at flatironinstitute.org, dvw at phas.ubc.ca&lt;br /&gt;
  &lt;br /&gt;
 Department of Physics &amp;amp; Astronomy &lt;br /&gt;
 University of British Columbia&lt;br /&gt;
 6224 Agricultural Rd, Room 204&lt;br /&gt;
 Vancouver, BC V6T 1Z1 &lt;br /&gt;
 Canada&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_svn_repository&amp;diff=7132</id>
		<title>MAS svn repository</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_svn_repository&amp;diff=7132"/>
		<updated>2021-11-17T02:14:51Z</updated>

		<summary type="html">&lt;p&gt;Dvw: Redirected page to Code repositories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Code repositories]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Code_repositories&amp;diff=7130</id>
		<title>Code repositories</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Code_repositories&amp;diff=7130"/>
		<updated>2021-11-17T02:14:24Z</updated>

		<summary type="html">&lt;p&gt;Dvw: Dvw moved page UBC SVN repository to Code repositories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The MCE software is available on GitHub in several repositories:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span style=&amp;quot;font-size:large&amp;quot;&amp;gt;https://github.com/multi-channel-electronics&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common things you'll need are:&lt;br /&gt;
* the [[MAS]] code here: https://github.com/multi-channel-electronics/mas&lt;br /&gt;
** MAS uses the GNU autotools for a bit of configuration work.&lt;br /&gt;
* the [[MCE script]]s here: https://github.com/multi-channel-electronics/mce_script&lt;br /&gt;
See [[MAS OS setup]] for information on how to build and install these packages.&lt;br /&gt;
&lt;br /&gt;
Also available:&lt;br /&gt;
* [[Sync box firmware]]: https://github.com/multi-channel-electronics/sync_box&lt;br /&gt;
** both CPLD and Atmel code are available&lt;br /&gt;
* [[PCI card firmware]]: https://github.com/multi-channel-electronics/arc_pci&lt;br /&gt;
&lt;br /&gt;
[[Category:MAS]]&lt;br /&gt;
[[Category:MCE Script]]&lt;br /&gt;
[[Category:Sync Box Firmware]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=UBC_SVN_repository&amp;diff=7131</id>
		<title>UBC SVN repository</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=UBC_SVN_repository&amp;diff=7131"/>
		<updated>2021-11-17T02:14:24Z</updated>

		<summary type="html">&lt;p&gt;Dvw: Dvw moved page UBC SVN repository to Code repositories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Code repositories]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Code_repositories&amp;diff=7129</id>
		<title>Code repositories</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Code_repositories&amp;diff=7129"/>
		<updated>2021-11-17T02:14:11Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The MCE software is available on GitHub in several repositories:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span style=&amp;quot;font-size:large&amp;quot;&amp;gt;https://github.com/multi-channel-electronics&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common things you'll need are:&lt;br /&gt;
* the [[MAS]] code here: https://github.com/multi-channel-electronics/mas&lt;br /&gt;
** MAS uses the GNU autotools for a bit of configuration work.&lt;br /&gt;
* the [[MCE script]]s here: https://github.com/multi-channel-electronics/mce_script&lt;br /&gt;
See [[MAS OS setup]] for information on how to build and install these packages.&lt;br /&gt;
&lt;br /&gt;
Also available:&lt;br /&gt;
* [[Sync box firmware]]: https://github.com/multi-channel-electronics/sync_box&lt;br /&gt;
** both CPLD and Atmel code are available&lt;br /&gt;
* [[PCI card firmware]]: https://github.com/multi-channel-electronics/arc_pci&lt;br /&gt;
&lt;br /&gt;
[[Category:MAS]]&lt;br /&gt;
[[Category:MCE Script]]&lt;br /&gt;
[[Category:Sync Box Firmware]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_setup&amp;diff=7114</id>
		<title>MAS OS setup</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_setup&amp;diff=7114"/>
		<updated>2019-09-26T22:05:40Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Related|MAS}}&lt;br /&gt;
= Supported operating systems =&lt;br /&gt;
&lt;br /&gt;
We use Ubuntu.&lt;br /&gt;
&lt;br /&gt;
* We only support LTS releases.  Currently, we support:&lt;br /&gt;
** 18.04&lt;br /&gt;
** 16.04&lt;br /&gt;
** 14.04&lt;br /&gt;
&lt;br /&gt;
= Ubuntu 16.04 and later =&lt;br /&gt;
&lt;br /&gt;
The removal of the bigphysarea requirement from the kernel module means it's much easier to install MAS now.  Because you don't need to rebuild your kernel, it should be possible to simply checkout the MAS trunk.  Start by skipping down to the [[#Download (checkout) MAS and mce_script|Download (checkout) MAS and mce_script]] step, and then continue with installing MAS and MCE script.&lt;br /&gt;
&lt;br /&gt;
= Ubuntu 14.04 =&lt;br /&gt;
&lt;br /&gt;
The automated installation package is tested, but as Ubuntu tweaks its packages the install script may fall slightly out of sync.  It's worth a shot though.&lt;br /&gt;
&lt;br /&gt;
After installing Ubuntu 14.04, get the install tarball:&lt;br /&gt;
&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/mce/pc_install/install_tools/mce_install_ubuntu_14.04.tar.gz&lt;br /&gt;
 tar -xzf ubuntu_14.04_install.tar.gz&lt;br /&gt;
 cd install/&lt;br /&gt;
&lt;br /&gt;
== Install additional ubuntu packages ==&lt;br /&gt;
&lt;br /&gt;
From that install folder, run&lt;br /&gt;
 bash install.bash&lt;br /&gt;
&lt;br /&gt;
It can't hurt to run this a couple of times to make sure all dependencies are resolved.&lt;br /&gt;
&lt;br /&gt;
== Bigphysarea kernel patch ==&lt;br /&gt;
&lt;br /&gt;
You can either download the compiled kernels or build them from scratch.&lt;br /&gt;
&lt;br /&gt;
From install folder, run EITHER&lt;br /&gt;
 bash kernel_download.bash&lt;br /&gt;
or&lt;br /&gt;
 bash kernel_build.bash&lt;br /&gt;
&lt;br /&gt;
Compiled kernels currently exist for the x64 architecture.&lt;br /&gt;
&lt;br /&gt;
Then when one or the other of those has succeeded, install them:&lt;br /&gt;
 bash kernel_install.bash&lt;br /&gt;
&lt;br /&gt;
You can now proceed to the section below titled &amp;quot;[[#Configure_the_system_for_MCE_users|Configure the system for MCE users]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Ubuntu 12.04 and earlier =&lt;br /&gt;
&lt;br /&gt;
See [[MAS OS setup on obsolete systems]]&lt;br /&gt;
&lt;br /&gt;
= Configure the system for MCE users = &lt;br /&gt;
&lt;br /&gt;
== Setup environment for MCE user ==&lt;br /&gt;
&lt;br /&gt;
We tend to assume that a single user and group will have dominion over the MCE software, scripts, and data.  We often assume that this user will be called &amp;quot;mce&amp;quot;.  But it doesn't need to be.  Even if multiple users are running things through their own accounts it is likely useful to have a single group that can be used to manage access to the data.&lt;br /&gt;
&lt;br /&gt;
Anyway, to set up a reasonable MCE user, see [[MAS user setup]].&lt;br /&gt;
&lt;br /&gt;
All users using the MCE will need to define some environment variables to use the scripts.  See the above link for lines to add to your '''.bashrc'''.&lt;br /&gt;
&lt;br /&gt;
== System umask ==&lt;br /&gt;
&lt;br /&gt;
You may want to set the system umask to make for a system where it's easier to share &lt;br /&gt;
Set the umask for all users to give write access for their group by default.&lt;br /&gt;
&lt;br /&gt;
Edit /etc/profile and change the &amp;quot;umask 022&amp;quot; line to&lt;br /&gt;
 umask 002&lt;br /&gt;
&lt;br /&gt;
Edit /etc/login.defs and find the line that start &amp;quot;# UMASK&amp;quot; and change it to&lt;br /&gt;
 UMASK           002&lt;br /&gt;
&lt;br /&gt;
== Folders ==&lt;br /&gt;
&lt;br /&gt;
mce_script assumes that /data/cryo/ exists and can be manipulated.  To create something reasonable:&lt;br /&gt;
&lt;br /&gt;
 MCE_USER=mce&lt;br /&gt;
 MCE_GROUP=mce&lt;br /&gt;
 sudo mkdir /data&lt;br /&gt;
 sudo chown $MCE_USER:$MCE_GROUP /data&lt;br /&gt;
 sudo chmod g+ws /data&lt;br /&gt;
 mkdir /data/cryo/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download (checkout) MAS and mce_script =&lt;br /&gt;
&lt;br /&gt;
See [[MAS svn repository]].&lt;br /&gt;
&lt;br /&gt;
= Compile and install MAS =&lt;br /&gt;
&lt;br /&gt;
The following procedure outlines the default situation, where MAS is being installed on a computer containing only one fibre card.  For information on running MAS with multiple fibre cards in one computer, see [[Multicard MAS]].&lt;br /&gt;
&lt;br /&gt;
== Makefile.svn ==&lt;br /&gt;
&lt;br /&gt;
MAS uses autoconf for some basic configuration stuff.  After checking out MAS from the SVN repository the ''first'' time, you need to bootstrap the autoconf process.  To simplify this, the Makefile.svn file will automate the process.  From the MAS source folder run&lt;br /&gt;
&lt;br /&gt;
  make -f Makefile.svn&lt;br /&gt;
&lt;br /&gt;
If successful, this will create the &amp;quot;./configure&amp;quot; script.  This step is only required on fresh check-outs of the repository.  If you already have a ./configure script, even if it's out of date, you can skip this step.  (After having been bootstrapped the&lt;br /&gt;
first time, the build system is smart enough to know when it needs to regenerate itself.)&lt;br /&gt;
&lt;br /&gt;
Note: this procedure requires autoconf.  If it's not installed, install it with:&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install autoconf&lt;br /&gt;
&lt;br /&gt;
== ./configure ==&lt;br /&gt;
&lt;br /&gt;
Once the configure script exists, run it to generate the build system (ie. the Makefiles).  The biggest thing you usually need to tell it is what the basic username and group should be for mce data.  Also, there are a few options for the driver and some stupid python stuff.&lt;br /&gt;
&lt;br /&gt;
From the MAS source folder, run&lt;br /&gt;
&lt;br /&gt;
 ./configure&lt;br /&gt;
&lt;br /&gt;
Some useful options:&lt;br /&gt;
  --disable-driver        suppress driver compilation/installation&lt;br /&gt;
  --disable-bigphysarea   compile driver without bigphysarea support&lt;br /&gt;
  --disable-config2       suppress mas.cfg and mce.cfg generation/installation&lt;br /&gt;
  --enable-multicard      build a version of MAS which can drive multiple fibre cards.  (See [[Multicard MAS]] for specifics.)&lt;br /&gt;
  --with-user=USER        set default MCE user&lt;br /&gt;
  --with-group=GROUP      set default MCE group&lt;br /&gt;
  --with-kernel-dir=DIR   set kernel build directory (typically automatically determined)&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
 ./configure --help&lt;br /&gt;
&lt;br /&gt;
for a full list.  When running, configure will complain if it cannot find something, and even suggest what package you need to install.&lt;br /&gt;
&lt;br /&gt;
== mce.cfg ==&lt;br /&gt;
&lt;br /&gt;
After running configure, but before running make, you must specify a template file (mce.cin) which will be used to generate  the hardware configuration file (mce.cfg).  Full details of this procedure are given in the [[mce.cfg]] page, but briefly:&lt;br /&gt;
&lt;br /&gt;
# copy an appropriate template from &amp;lt;code&amp;gt;config2/templates&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;config2/mce.cin&amp;lt;/code&amp;gt;&lt;br /&gt;
# edit the &amp;lt;code&amp;gt;config2/mce.cin&amp;lt;/code&amp;gt; file to describe your MCE.&lt;br /&gt;
&lt;br /&gt;
The configuration file will be installed automatically when &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt; is run below.  This entire step can be skipped if you passed --disable-config2 to configure above, but note that MAS will not function without mce.cfg and mas.cfg installed.&lt;br /&gt;
&lt;br /&gt;
== make ==&lt;br /&gt;
&lt;br /&gt;
This often works.&lt;br /&gt;
&lt;br /&gt;
 make clean; make&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
Sometimes after doing an SVN update &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; doesn't work but instead returns the cryptic message:&lt;br /&gt;
&lt;br /&gt;
 *** No rule to make target `defaults/masdefault.m4', needed by `aclocal.m4'.&lt;br /&gt;
&lt;br /&gt;
In this case, it's necessary to force a rebuild of the build system manually by running&lt;br /&gt;
&lt;br /&gt;
 make -f Makefile.svn&lt;br /&gt;
 ./configure&lt;br /&gt;
&lt;br /&gt;
See the [[#Makefile.svn|Makefile.svn section]] above for further details.&lt;br /&gt;
&lt;br /&gt;
== Test the driver ==&lt;br /&gt;
&lt;br /&gt;
It is wise to test that the driver does not kill your machine before installing it to load on boot.  After compiling do:&lt;br /&gt;
&lt;br /&gt;
 cd driver&lt;br /&gt;
 sudo ./reload&lt;br /&gt;
&lt;br /&gt;
This will load the driver, which should then try to talk to the SDSU PCI card if it is installed.  Note that since &amp;quot;reload&amp;quot; first unloads the driver if it is present, and then loads the driver from the current folder, it may report an &amp;quot;ERROR&amp;quot; message if the first step fails, even though the driver is successfully loaded.  The definitive way to check that the driver is loaded is&lt;br /&gt;
  cat [[/proc/mce_dsp]]&lt;br /&gt;
&lt;br /&gt;
If this file does not exist, the driver isn't loaded.  If the cat prints out a bunch of low-level driver information, you're in good shape.&lt;br /&gt;
&lt;br /&gt;
== sudo make install ==&lt;br /&gt;
&lt;br /&gt;
If you're satisfied that the driver works, install the whole thing.  Go back up to the MAS base folder and run&lt;br /&gt;
&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
This will do the following:&lt;br /&gt;
&lt;br /&gt;
*install the kernel driver, &amp;lt;code&amp;gt;driver/mce_dsp.ko&amp;lt;/code&amp;gt;, into &amp;lt;code&amp;gt;/lib/modules/$(uname -r)/kernel/drivers/misc/&amp;lt;/code&amp;gt;, and re-scan the module dependencies.&lt;br /&gt;
*install the MAS binaries from &amp;lt;code&amp;gt;applications/&amp;lt;/code&amp;gt; and the scripts from &amp;lt;code&amp;gt;script/&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;/usr/mce/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
*install the MAS udev ruleset &amp;lt;code&amp;gt;scripts/91-mas.rules&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;/etc/udev/rules.d/&amp;lt;/code&amp;gt;.  These udev rules will ensure that the mce_dsp module is loaded and the MAS device nodes are created at boot time.  You can get udev to run these rules immediately, which will result in /dev being populated with the mce devices, by running:&lt;br /&gt;
&lt;br /&gt;
  sudo udevadm trigger&lt;br /&gt;
&lt;br /&gt;
:or, else, you can make the nodes yourself by running mas_mknodes.&lt;br /&gt;
*install the mas logging daemon script &amp;lt;code&amp;gt;/etc/init.d/mas&amp;lt;/code&amp;gt; init script.  The driver can then be started/restarted as desired through this script:&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/mas restart&lt;br /&gt;
&lt;br /&gt;
:The driver will automatically be set to load on boot.  To disable this, remove the symbolic link &amp;quot;/etc/rc2.d/S99mas&amp;quot;.&lt;br /&gt;
*install the hardware configuration file, &amp;lt;code&amp;gt;config2/mce.cfg&amp;lt;/code&amp;gt;, and the MAS configuration file, &amp;lt;code&amp;gt;config2/mas.cfg&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/etc/mce/&amp;lt;/code&amp;gt;, assuming there aren't versions already there.&lt;br /&gt;
&lt;br /&gt;
= Install mce_script =&lt;br /&gt;
&lt;br /&gt;
Users have the option of running the MCE scripts from an svn working copy, or of running the MCE scripts from an &amp;quot;installed&amp;quot; copy.  Talk to your MAS technician about which option is best for you.&lt;br /&gt;
&lt;br /&gt;
== Running from an svn working copy ==&lt;br /&gt;
&lt;br /&gt;
Checkout the tree directly into /usr/mce:&lt;br /&gt;
&lt;br /&gt;
 cd /usr/mce&lt;br /&gt;
 svn checkout svn://e-mode.phas.ubc.ca/mce_script/trunk mce_script&lt;br /&gt;
&lt;br /&gt;
== Running from an installed copy ==&lt;br /&gt;
&lt;br /&gt;
Checkout the tree into your code folder; then make and install:&lt;br /&gt;
&lt;br /&gt;
 cd code&lt;br /&gt;
 svn checkout svn://e-mode.phas.ubc.ca/mce_script/trunk mce_script&lt;br /&gt;
 make&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== .bashrc ==&lt;br /&gt;
&lt;br /&gt;
Add a few lines to .bashrc to update your PATH, PYTHONPATH, and to define the MAS_* variables.  The new way, using [[mas_var]], is:&lt;br /&gt;
 eval `/usr/mce/bin/mas_var -e -s`&lt;br /&gt;
&lt;br /&gt;
The old way, which will probably still work for a while:&lt;br /&gt;
 &lt;br /&gt;
 export MAS_ROOT=/usr/mce/mce_script/&lt;br /&gt;
 source $MAS_ROOT/template/mas_env.bash&lt;br /&gt;
 export IDL_PATH=&amp;quot;&amp;lt;IDL_DEFAULT&amp;gt;:$MAS_IDL/mas&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Configuration data ==&lt;br /&gt;
&lt;br /&gt;
Example configuration files (especially [[experiment.cfg]]) are kept in mce_script/template.  MAS, by default, expects user configuration data to be in /usr/mce/config.  Users should copy the template/ files to /usr/mce/config/, and then make configuration adjustments.  After install mce_script, you can copy the template config from it with: &lt;br /&gt;
&lt;br /&gt;
 sudo cp -r /usr/mce/mce_script/template /usr/mce/config&lt;br /&gt;
 sudo chown -R mce /usr/mce/config&lt;br /&gt;
&lt;br /&gt;
[[Category:MAS]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_setup_on_obsolete_systems&amp;diff=7113</id>
		<title>MAS OS setup on obsolete systems</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_setup_on_obsolete_systems&amp;diff=7113"/>
		<updated>2019-09-26T20:09:34Z</updated>

		<summary type="html">&lt;p&gt;Dvw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{obsolete|MAS OS setup}}&lt;br /&gt;
This page describes the parts of the OS setup procedure for MAS specific to Ubuntu 6.06, 7.10, 8.04, 8.10, 9.04, 9.10, 10.04, and 12.04.  For the general OS setup procedure, see: [[MAS OS setup]].&lt;br /&gt;
&lt;br /&gt;
Users are strongly encouraged to run MAS under Ubuntu 14.04 LTS or 16.04 LTS, when possible.  See the [[MAS OS setup]] for full instructions.&lt;br /&gt;
&lt;br /&gt;
= Ubuntu 12.04 =&lt;br /&gt;
Follow instructions for Ubuntu 14.04, but use install tools package:&lt;br /&gt;
&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/mce/pc_install/install_tools/mce_install_ubuntu_12.04.tar.gz&lt;br /&gt;
&lt;br /&gt;
= Ubuntu 10.04 =&lt;br /&gt;
&lt;br /&gt;
The automated installation package is tested, but as Ubuntu tweaks its packages the install script may fall slightly out of sync.  It's worth a shot though.&lt;br /&gt;
&lt;br /&gt;
After installing Ubuntu 10.04 (desktop), get the install tarball:&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/mce/pc_install/install_tools/ubuntu_10.04_install.tar.gz&lt;br /&gt;
 tar -xzf ubuntu_10.04_install.tar.gz&lt;br /&gt;
 cd install/&lt;br /&gt;
&lt;br /&gt;
== Install additional ubuntu packages ==&lt;br /&gt;
&lt;br /&gt;
From that install folder, run&lt;br /&gt;
 bash install.bash&lt;br /&gt;
&lt;br /&gt;
(Under 10.04, the vanilla kernel 2.6.38.8 is also supported.  To use it, copy ./alternatives/sources.2.6.38.8.bash to ./sources.bash before running install.bash and kernel_build.bash .)&lt;br /&gt;
&lt;br /&gt;
== Bigphysarea kernel patch ==&lt;br /&gt;
&lt;br /&gt;
You can either download the compiled kernels or build them from scratch.&lt;br /&gt;
&lt;br /&gt;
From install folder, run EITHER&lt;br /&gt;
 bash kernel_download.bash&lt;br /&gt;
or&lt;br /&gt;
 bash kernel_build.bash&lt;br /&gt;
&lt;br /&gt;
Then when one or the other of those has succeeded, install them:&lt;br /&gt;
 bash kernel_install.bash&lt;br /&gt;
&lt;br /&gt;
You can now proceed to the section below titled &amp;quot;[[#Configure_the_system_for_MCE_users|Configure the system for MCE users]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Ubuntu 9.10 =&lt;br /&gt;
&lt;br /&gt;
Starting with Ubuntu 9.10, some effort has been made to automate the installation.  After installing Ubuntu 9.10 (desktop), get the install tarball:&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/mce/pc_install/install_tools/ubuntu_09.10_install.tar.gz&lt;br /&gt;
 tar -xzf install.tar.gz&lt;br /&gt;
 cd install/&lt;br /&gt;
&lt;br /&gt;
== Install additional ubuntu packages ==&lt;br /&gt;
&lt;br /&gt;
From that install folder, run&lt;br /&gt;
 bash install.bash&lt;br /&gt;
&lt;br /&gt;
== Bigphysarea kernel patch ==&lt;br /&gt;
&lt;br /&gt;
You can either download the compiled kernels or build them from scratch.&lt;br /&gt;
&lt;br /&gt;
From install folder, run EITHER&lt;br /&gt;
 bash kernel_download.bash&lt;br /&gt;
or&lt;br /&gt;
 bash kernel_build.bash&lt;br /&gt;
&lt;br /&gt;
Then when one or the other of those has succeeded, install them:&lt;br /&gt;
 bash kernel_install.bash&lt;br /&gt;
&lt;br /&gt;
You can now proceed to the section titled &amp;quot;[[MAS OS setup#Configure_the_system_for_MCE_users|Configure the system for MCE users]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Ubuntu 9.04 and earlier =&lt;br /&gt;
== Disable CDROM seeking ==&lt;br /&gt;
&lt;br /&gt;
The package manager knows that you have the Ubuntu disk and will say things like&lt;br /&gt;
 Media change: please insert the disc labeled&lt;br /&gt;
 'Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)'&lt;br /&gt;
&lt;br /&gt;
To disable this (and download packages from the internet instead), open /etc/apt/sources.list &lt;br /&gt;
 sudo pico /etc/apt/sources.list&lt;br /&gt;
and remove (comment) the line &lt;br /&gt;
 deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted&lt;br /&gt;
&lt;br /&gt;
== Install required packages ==&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install build-essential subversion emacs21 libreadline5-dev &lt;br /&gt;
&lt;br /&gt;
== Enable universe repository and install GGV ==&lt;br /&gt;
&lt;br /&gt;
Uncomment the line in /etc/apt/sources.list so it says &lt;br /&gt;
 deb http://us.archive.ubuntu.com/ubuntu/ dapper universe&lt;br /&gt;
&lt;br /&gt;
Then run&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install gnome-gv&lt;br /&gt;
&lt;br /&gt;
gnome-gv doesn't exist on 7.10, you'll have to settle for&lt;br /&gt;
 sudo apt-get install gv&lt;br /&gt;
&lt;br /&gt;
== Install packages that you shouldn't even want to install (soon to be optional) ==&lt;br /&gt;
 sudo apt-get install tcsh&lt;br /&gt;
&lt;br /&gt;
== Install desktop manager (optional) ==&lt;br /&gt;
 sudo apt-get install ubuntu-desktop gdm&lt;br /&gt;
&lt;br /&gt;
== Install python stuff ==&lt;br /&gt;
&lt;br /&gt;
The 'pyth' branch MAS has experimental support for python using wx and matplotlib:&lt;br /&gt;
 sudo apt-get install python-dev python-wxglade python-matplotlib python-numarray-ext swig&lt;br /&gt;
&lt;br /&gt;
=== numpy and scipy ===&lt;br /&gt;
&lt;br /&gt;
For loading / plotting MCE data in python using [[Python data and runfile modules | mce_data.py]], you will want numpy / scipy.  The Ubuntu packages can be a bit out of date, but should be enough for basic data manipulation and plotting.  Just run:&lt;br /&gt;
 sudo apt-get install python-numpy python-scipy &lt;br /&gt;
&lt;br /&gt;
For Ubuntu 6.06, numpy and scipy can be obtained following instructions from this page:&lt;br /&gt;
 http://debs.astraw.com/dapper/&lt;br /&gt;
&lt;br /&gt;
There are some very useful numpy features that are not available on older Ubuntu default packages.  To access such features it is not too hard to install more recent versions of numpy (and scipy) from sourceforge:&lt;br /&gt;
&lt;br /&gt;
1. Remove Ubuntu numpy and scipy packages; install dependencies for the source.&lt;br /&gt;
 sudo apt-get remove python-numpy python-scipy&lt;br /&gt;
 sudo apt-get install libblas-dev lapack-dev&lt;br /&gt;
2. Get source tarballs from links below... unzip the contents.&lt;br /&gt;
 http://sourceforge.net/projects/numpy&lt;br /&gt;
 http://sourceforge.net/projects/scipy&lt;br /&gt;
3. Compile the source packages.  That means that in each folder you have to do:&lt;br /&gt;
 ./setup.py config&lt;br /&gt;
 ./setup.py build&lt;br /&gt;
 sudo ./setup.py install&lt;br /&gt;
&lt;br /&gt;
The config step complains a fair bit, but it's really obvious when there is an error rather than a warning.  The scipy package takes a long time to compile.&lt;br /&gt;
&lt;br /&gt;
== Install libconfig ==&lt;br /&gt;
&lt;br /&gt;
MAS uses [[libconfig]] to manage its configuration files.  The webpage is here: http://www.hyperrealm.com/libconfig/.  To install libconfig run the commands below.  The active version of libconfig changes a lot; go to the hyperrealm link to see what the latest version is; it's probably compatible.&lt;br /&gt;
&lt;br /&gt;
  wget http://www.hyperrealm.com/libconfig/libconfig-1.3.2.tar.gz&lt;br /&gt;
  tar -xzf libconfig-1.3.2.tar.gz&lt;br /&gt;
  cd libconfig-1.3.2&lt;br /&gt;
  ./configure&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install&lt;br /&gt;
&lt;br /&gt;
To make the system aware of this library, add &amp;quot;/usr/local/lib&amp;quot; to /etc/ld.so.conf and run &amp;quot;sudo ldconfig&amp;quot;.  i.e.&lt;br /&gt;
  echo /usr/local/lib | sudo tee -a /etc/ld.so.conf&lt;br /&gt;
  sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
On newer systems (Ubuntu 7.10) you can do this instead:&lt;br /&gt;
  echo /usr/local/include | sudo tee /etc/ld.so.conf.d/libconfig.conf&lt;br /&gt;
  sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
== Download and install MAS kernel patch ==&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
&lt;br /&gt;
If you're not compiling the kernel from scratch, download the binary packages from UBC:&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-headers-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/extras.patch&lt;br /&gt;
&lt;br /&gt;
For '''Ubuntu 7.10''', get these instead:&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/linux-headers-2.6.22.9-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/linux-image-2.6.22.9-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On '''Ubuntu 7.10''' machines '''without PAE''' hardware (i.e. a maximum of 4G of system memory) use:&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/linux-headers-2.6.22.14-bigphys_2.6.22.14-bigphys-10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/linux-image-2.6.22.14-bigphys_2.6.22.14-bigphys-10.00.Custom_i386.deb&lt;br /&gt;
&lt;br /&gt;
=== Install ===&lt;br /&gt;
&lt;br /&gt;
Then, install the packages using dpkg:&lt;br /&gt;
 sudo dpkg -i kernel-headers-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 sudo dpkg -i kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
The &amp;quot;image&amp;quot; file might complain about symbolic links, no big deal.&lt;br /&gt;
&lt;br /&gt;
On '''Ubuntu 7.10''', instead install these:&lt;br /&gt;
 sudo dpkg -i linux-headers-2.6.22.9-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 sudo dpkg -i linux-image-2.6.22.9-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
&lt;br /&gt;
Why are these ones called &amp;quot;linux&amp;quot; instead of &amp;quot;kernel&amp;quot;?  I think it's because I got them from Ubuntu repositories instead of kernel.org.&lt;br /&gt;
&lt;br /&gt;
On '''Ubuntu 7.10''' machines '''without PAE''' install these:&lt;br /&gt;
 sudo dpkg -i linux-headers-2.6.22.14-bigphys_2.6.22.14-bigphys-10.00.Custom_i386.deb&lt;br /&gt;
 sudo dpkg -i linux-image-2.6.22.14-bigphys_2.6.22.14-bigphys-10.00.Custom_i386.deb&lt;br /&gt;
&lt;br /&gt;
The '''Ubuntu 8.04''' kernel has a sound-card driver that lays claim to the Motorola DSP on the PCI card.  We have to blacklist this module to prevent it from trying to configure the card as a sound card.  Add the following to the bottom of /etc/modprobe.d/blacklist :&lt;br /&gt;
 # Conflicts with Astro-cam PCI card!!&lt;br /&gt;
 blacklist snd_asihpi&lt;br /&gt;
&lt;br /&gt;
=== Patch ===&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compile against the kernel package as though it had been locally compiled originally.&lt;br /&gt;
 cd /usr/src/kernel-headers-2.6.15.7-bigphys/&lt;br /&gt;
 sudo patch -p1 &amp;lt; ~/extras.patch&lt;br /&gt;
&lt;br /&gt;
This step is not necessary for Ubuntu 7.10.  It may be necessary to link the kernel headers into /lib/modules:&lt;br /&gt;
  sudo ln -s /usr/src/linux-headers-2.6.22.9-bigphys/ /lib/modules/2.6.22.9-bigphys/build&lt;br /&gt;
&lt;br /&gt;
=== Boot menu ===&lt;br /&gt;
&lt;br /&gt;
We need to add the kernel option that causes bigphys to allocate boot memory for our driver.  In older versions of MAS (especially ACT's stable release) we also need to disable &amp;quot;acpi&amp;quot;.  It's a good idea to not run any DSP/MCE commands until all of your kernel options are in place. &lt;br /&gt;
&lt;br /&gt;
Having installed the kernel &amp;quot;image&amp;quot; package, the kernel should show up in the boot loader (grub)'s kernel list.&lt;br /&gt;
&lt;br /&gt;
=== Editing the kernel list ===&lt;br /&gt;
As root (or using sudo), edit the file /boot/grub/menu.lst .  &lt;br /&gt;
 sudo pico /boot/grub/menu.lst&lt;br /&gt;
Go to the list of kernels, below the line &amp;quot;## ## End Default Options ##&amp;quot;, and find the new kernel entry.  On Ubuntu 6.06, it should be the third block (index 2), and look like this:&lt;br /&gt;
&lt;br /&gt;
 title           Ubuntu, kernel 2.6.15.7-bigphys&lt;br /&gt;
 root            (hd0,0)&lt;br /&gt;
 kernel          /vmlinuz-2.6.15.7-bigphys root=/dev/sda3 ro quiet splash&lt;br /&gt;
 initrd          /initrd.img-2.6.15.7-bigphys&lt;br /&gt;
 savedefault&lt;br /&gt;
 boot&lt;br /&gt;
&lt;br /&gt;
Add the kernel options to the &amp;quot;kernel&amp;quot; line, producing either this (recent MAS):&lt;br /&gt;
 kernel          /vmlinuz-2.6.15.7-bigphys root=/dev/sda3 ro quiet splash bigphysarea=8192&lt;br /&gt;
or this (old MAS, esp. ACT):&lt;br /&gt;
 kernel          /vmlinuz-2.6.15.7-bigphys root=/dev/sda3 ro quiet splash bigphysarea=8192 acpi=off&lt;br /&gt;
&lt;br /&gt;
Save and close the file, and reboot to test this kernel.  If the kernel &amp;quot;works&amp;quot;, you can edit menu.lst again and change the value of the &amp;quot;default&amp;quot; option to point to this kernel:&lt;br /&gt;
 default    2&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 7.10 and later''': the kernel packages install a bit differently so the block will likely be the first one in the list.  The 'kernel' line  must change from something like&lt;br /&gt;
 kernel          /boot/vmlinuz-2.6.22.9-bigphys root=UUID=1b6e7b54-894d-4571-9f0a-527fe0103975 ro quiet splash&lt;br /&gt;
to&lt;br /&gt;
 kernel          /boot/vmlinuz-2.6.22.9-bigphys root=UUID=1b6e7b54-894d-4571-9f0a-527fe0103975 ro quiet splash bigphysarea=8192&lt;br /&gt;
Note that the long hexadecimal serial numbers are system specifc and yours are probably different than these ones.  Leave them as they are and just add the new kernel options.  The &amp;quot;default&amp;quot; option will probably be&lt;br /&gt;
 default    0&lt;br /&gt;
but it's a good idea to count these things out for yourself.&lt;br /&gt;
&lt;br /&gt;
You can now proceed to the section titled &amp;quot;[[MAS OS setup#Configure_the_system_for_MCE_users|Configure the system for MCE users]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Category:MAS]]&lt;/div&gt;</summary>
		<author><name>Dvw</name></author>
		
	</entry>
</feed>