From 4d8d259188b7d25f96f475668e674ae19583ac4a Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Fri, 1 Aug 2025 16:52:26 +0200 Subject: [PATCH] update Trb3scADC readout script for all currently used setups --- tools/trb3scadc.pl | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/tools/trb3scadc.pl b/tools/trb3scadc.pl index 2bf8a9c..973f18b 100755 --- a/tools/trb3scadc.pl +++ b/tools/trb3scadc.pl @@ -8,24 +8,48 @@ use Data::Dumper; use HADES::TrbNet; use Time::HiRes qq|usleep|; + +if(!defined $ARGV[0] || $ARGV[0] eq '-h') { +print <[$mode]."\n\n"; @@ -34,6 +58,7 @@ print "\nRunning in mode ".$modedesc->[$mode]."\n\n"; system("trbcmd w $board 0xd41a 25"); my $cmd; my $s; +trb_register_write($board,0xd417,0x40) if($mode == 4); $cmd = 0xc1830000 + ($resolution->[$mode][0] << 25); $s = Dmon::PadiwaSendCmd($cmd,$board,$channel->[$mode]); @@ -62,6 +87,9 @@ usleep(5000); $s = Dmon::PadiwaSendCmd(0,$board,$channel->[$mode]); printf("0x%08x\t%.2f °C\n",$s->{$board},(($s->{$board}>>19)&0xfff)/16.); +trb_register_write($board,0xd417,0x0) if($mode == 4); + + #back to normal SPI speed system("trbcmd w $board 0xd41a 7"); print "\n"; -- 2.43.0