Commit ffc59c3b authored by John Gill's avatar John Gill

Merge remote-tracking branch 'origin/master'

parents 6fe3ecb0 56f3776b
......@@ -2326,6 +2326,27 @@ usage:
printf ("usage: %s gpio1|gpio2 [0 | 1] \n", argv[0]);
}
static void
lemo_ext_sel (struct libwr2rf_dev *dev, int argc, char **argv)
{
unsigned addr = WR2RF_VME_REGS_INIT + WR2RF_INIT_REGS_LEMO_EXT;
unsigned lemo;
if (argc != 1 && argc != 2)
goto usage;
lemo = strtoul (argv[1], NULL, 0) & 0x3f;
libwr2rf_write16(dev, addr, lemo);
lemo = libwr2rf_read16(dev, addr);
printf ("lemo_ext: 0x%02x\n", lemo);
return;
usage:
printf ("usage: %s [sel] \n", argv[0]);
}
static void
lemo_start_sel (struct libwr2rf_dev *dev, int argc, char **argv)
{
......@@ -3459,6 +3480,7 @@ static struct cmds cmds[] =
{ "lemo-start-sel", lemo_start_sel, "configure lemo input to trigger unit start"},
{ "lemo-stop-sel", lemo_stop_sel, "configure lemo input to trigger unit stop"},
{ "lemo-gpio", lemo_gpio, "configure lemo gpio output signals"},
{ "lemo-ext-sel", lemo_ext_sel, "configure lemo extended pulse mode on output"},
{ "ext-ref", ext_ref, "set or read ext_ref (pps+10Mhz) direction"},
{ "rf-diag", rf_diag, "rf diagnostics"},
{ "vtu", vtu, "trigger unit"},
......
#!/bin/bash
ftw_hex=`echo $1 | tr a-f A-F`
freq_wrclk=125000000
ftw=`echo "ibase=16; $ftw_hex" | bc -q`
echo "ftw=$ftw"
prod=`echo "$ftw*$freq_wrclk" | bc -q`
echo "prod=$prod"
fout=`echo "$prod/(2^48)" | bc -q`
echo "Fout=$fout"
......@@ -5,38 +5,36 @@
#are specific to cfv-774-celma4 card configuration and should be adapted...
# slot 2 is TX, slots 4 RX
./wr2rf -s 4 set-rfout 1 mix
./wr2rf -s 4 set-rfout 2 mix
ftw_SFTPRO2_hex=0016b0bbb3c4
echo "FTW SFT protons: $ftw_SFTPRO2_hex"
freq_SFTPRO2=43278.463683
freq_wrclk=125000000
prod=`echo "$freq_SFTPRO2*(2^48)" | bc -q`
ftw_h1=`echo "$prod/($freq_wrclk)" | bc -q`
ftw_SFTPRO2_hex=`echo "obase=16;ibase=10; $ftw_h1" | bc -q`
ftw_LHCPILOT_hex=0016b9f306de
echo "FTW LHC protons: $ftw_LHCPILOT_hex"
freq_LHCPILOT=43347.158955
freq_wrclk=125000000
prod=`echo "$freq_LHCPILOT*(2^48)" | bc -q`
ftw_h1=`echo "$prod/($freq_wrclk)" | bc -q`
ftw_LHCPILOT_hex=`echo "obase=16;ibase=10; $ftw_h1" | bc -q`
ftw_SFTION1_hex=00168b5cbff4
echo "FTW SFT ion : $ftw_SFTION1_hex"
###############################################################
# reset the RX wr2rf trigger unit
usleep 1000
sh vtu_setup.sh 4
# Prepare the dds 300 ms before we expect to need stable RF
usleep 1000
./wr2rf -s 2 ftw-send1 0x$ftw_SFTPRO2_hex reset
usleep 1000
###############################################################
# reset the RX wr2rf trigger unit
usleep 1000
sh vtu_setup.sh 4
# Prepare the dds 300 ms before we expect to need stable RF
usleep 1000
./wr2rf -s 2 ftw-send1 0x$ftw_LHCPILOT_hex reset
###############################################################
# reset the RX wr2rf trigger unit
usleep 1000
sh vtu_setup.sh 4
# Prepare the dds 300 ms before we expect to need stable RF
usleep 1000
./wr2rf -s 2 ftw-send1 0x$ftw_SFTION1_hex reset
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment