Difference between revisions of "Sync Box"

From MCEWiki
Line 3: Line 3:
  
 
= Sync Box User's Guide =
 
= Sync Box User's Guide =
The Sync Box user's guide and list of available commands is available [http://www.phas.ubc.ca/~mce/mcedocs/Hardware/tech_description/SyncBox_UserGuide_S589_502.pdf here].
+
The Sync Box user's guide and list of available commands is available [http://www.phas.ubc.ca/~mce/mcedocs/hardware/tech_description/SyncBox_UserGuide_S589_502.pdf here].
  
 
= Sync Box Programmable I/O =
 
= Sync Box Programmable I/O =

Revision as of 11:26, 9 August 2009

Sync Box Firmware

The latest version of stable Sync Box firmware is sync_box_fw_v6e_11aug2008, available in UBC's CVS repository.

Sync Box User's Guide

The Sync Box user's guide and list of available commands is available here.

Sync Box Programmable I/O

  • ACDCU(0-7): 8 TTL outputs. Carries a high/low signal that enables/disables the MCE AC/DC converter.
  • MCE(0-7): 8 Fibre outputs. Carries a 50 MHz Manchester-encoded signal containing data packets, which include incremented sequence numbers. Programmable as two sets of 4 outputs with differently spaced data packets on each.
  • RTS-DV: TTL input. Detects falling edges from a Real-Time Sequencer (implemented by SCUBA2) which tells the Sync box when to tell the MCE's to collect data.
  • OPTO-TTL: TTL input, spare input to the command processor. ***Not currently used, and open for suggestions.
  • RS232 RxTx: TTL input and output, used to command the Sync Box from a PC.
  • DV Spare 1: TTL output. Carries a 5 MHz clock signal that is synchronous with DV Spare 2.
  • DV Spare 2: TTL output. Carries a 5 MHz data signal that is synchronized with DV Spare 1, and contains the same sequence numbers as the MCE(0-7) outputs.
  • Polarimeter: TTL output. Carries a 5 MHz TTL signal that contains the same sequence numbers as the MCE(0-7) outputs.
  • FTS: TTL output. Carries a 5 MHz TTL signal that contains the same sequence numbers as the MCE(0-7) outputs.
  • TTL-IN: SMB TTL input, spare input to the FPGA. ***Not currently used, and open for suggestions.
  • TTL-OUT: SMB TTL output. Carries a 50 MHz clock signal.

Minicom Setup

To issue commands to a sync box over an RS-232 line, you can use a Linux program called 'MiniCom'. To install this application, type the following:

> apt-get install...

To start MiniCom:

> sudo minicom

Minicom needs the following options changed for it to work properly:

> <ctrl-a>, <z>, <a>
> <ctrl-a>, <z>, <o>, <Serial port setup> <Serial Device> = /dev/ttyS0
> <ctrl-a>, <z>, <o>, <Serial port setup> <Bps/Par/Bits> = 9600 8N1
> <ctrl-a>, <z>, <o>, <Serial port setup> <Hardware Flow Control> = No
> <ctrl-a>, <z>, <o>, <Serial port setup> <Software Flow Control> = No
> <ctrl-a>, <z>, <o>, <Modem and dialing> <Modem has DCD line> = No

After you modify these settings, remember to save, exit, and restart Minicom.

Commands to the Sync Box

Using Minicom, a list of all the commands available is given by typing

> h

MCE Setup for the Sync Box

To check that the sync box is connected correctly to the MCE, issue the command

wb cc select_clk 1

and then read back the value:

rb cc select_clk
Line   0 : ok : 1

Setting 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 0 in about 1 second.

To accept sync triggers and serial numbers from the sync box, two more commands are needed:

wb cc use_sync 2
wb cc use_dv 2

These registers are configured automatically by the config system if the parameters "hardware_sync" and "config_sync" are both 1 in experiment.cfg. If you change the values in $MAS_DATA/experiment.cfg instead of $MAS_TEMPLATE/experiment.cfg, remember to "mce_make_config" before re-running the config script.

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:

mce@mce-act-b1$  mce_run sync_test 400 s
RUNFILE_NAME=/data/cryo/current_data//sync_test.run
FRAME_BASENAME=/data/cryo/current_data//sync_test
mce@mce-act-b1$  $MAS_ROOT/utilities/eat_packets -f $MAS_DATA/sync_test -d 1
frame_size=1100 -> 4400
offset     frm_idx   frame#
0000000000        0        0  surprise sync_dv 4557476, after sequence [0,0)
EOF, exiting after 400 frames + 0 bytes

If the mce_run does not terminate quickly, the sync box may not be properly connected to the MCE. If the eat_packets complains only about the first frame (offset 00000000), then the sync numbers are intact and incrementing contiguously. If eat_packets complains about pretty much every frame, the sync numbers are not getting into the frame data.