timescan.sh 978 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. pci -w 9024 0x1
  3. sleep 0.001
  4. pci -w 9024 0x0
  5. # A POSIX variable
  6. OPTIND=1 # Reset in case getopts has been used previously in the shell.
  7. # Initialize our own variables:
  8. output_file="timescan_data.out"
  9. orbits=0x1
  10. while getopts "o:f:" opt; do
  11. case "$opt" in
  12. o) orbits=$OPTARG
  13. ;;
  14. f) output_file=$OPTARG
  15. ;;
  16. esac
  17. done
  18. shift $((OPTIND-1))
  19. [ "$1" = "--" ] && shift
  20. #echo "orbits=$orbits, output_file='$output_file'"
  21. rm $output_file
  22. pci -w 9014 1
  23. sleep 0.1
  24. echo "ADD Reset DDR"
  25. #pci -w 0x9040 0x10210F50 # was 0x10210F40
  26. pci -w 0x9040 0x10210F50
  27. sleep 0.01
  28. pci -w 0x9040 0x10210F00
  29. sleep 0.01
  30. echo "Start Normal acquisition + ENABLE Readout to DDR + HEADER"
  31. pci -w 0x9040 0x1021FF00
  32. sleep 0.5
  33. #./status.sh
  34. echo "IDLE"
  35. pci -w 0x9040 0x10210F00
  36. sleep 0.5
  37. #./status.sh
  38. echo $output_file
  39. echo "*DMA: Reading data..."
  40. pci -r dma0 --multipacket -o $output_file --timeout=1000000
  41. echo "TS: Disable time scan"
  42. pci -w 0x9014 0x0
  43. sleep 0.1