From 1f407e269694ef01d05bf8ee3c0a345c06a4de6f Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 26 Jul 2012 18:50:22 +0200 Subject: Fix names of cmosis registers in scripts --- tests/Reset_Init_all_reg_10bit.sh | 314 ---------------------------- tests/Reset_Init_all_reg_11bit.sh | 309 --------------------------- tests/Reset_Init_all_reg_12bit.sh | 309 --------------------------- tests/frame.sh | 2 +- tests/frame2.sh | 2 +- tests/frame_req.sh | 2 +- tests/grab.sh | 2 +- tests/ipecamera/Reset_Init_all_reg_10bit.sh | 314 ++++++++++++++++++++++++++++ tests/ipecamera/Reset_Init_all_reg_11bit.sh | 309 +++++++++++++++++++++++++++ tests/ipecamera/Reset_Init_all_reg_12bit.sh | 309 +++++++++++++++++++++++++++ tests/reset_init.sh | 23 -- 11 files changed, 936 insertions(+), 959 deletions(-) delete mode 100755 tests/Reset_Init_all_reg_10bit.sh delete mode 100755 tests/Reset_Init_all_reg_11bit.sh delete mode 100755 tests/Reset_Init_all_reg_12bit.sh create mode 100755 tests/ipecamera/Reset_Init_all_reg_10bit.sh create mode 100755 tests/ipecamera/Reset_Init_all_reg_11bit.sh create mode 100755 tests/ipecamera/Reset_Init_all_reg_12bit.sh delete mode 100755 tests/reset_init.sh diff --git a/tests/Reset_Init_all_reg_10bit.sh b/tests/Reset_Init_all_reg_10bit.sh deleted file mode 100755 index 9c7e6b8..0000000 --- a/tests/Reset_Init_all_reg_10bit.sh +++ /dev/null @@ -1,314 +0,0 @@ -#!/bin/bash - -###################### by Michele Caselle and Uros Stafanovic ################################################## -############ Resent procedure and camera initialization for 10 -bit mode ###################################### - -error=0 -echo " Reset Readout and CMOSIS " -pci -w 0x9040 204 -sleep .1 -#echo " Release Reset for Readout" -#pci -w 0x9040 1e0 -sleep .1 -##################### PLL SET ##################################### -val=f501 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -echo " Start CMOSIS Configuration .." -pci -w 0x9000 f301 -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "bf301" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -val=d207 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 - -# Michele 10 - 12 bit mode # -# ################################################################################################### -echo " 10 - bit mode, set Bit_mode " -val=ef00 ###################################################### -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -# Michele set ADC_resolution @ 12 bits -echo " 10 bit mode, set ADC resolution 10 bits " -val=f000 # qui for 10 - 11 - 12 bits ######################################################## -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 - -# adc recommended 28=44 -val=e72c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val " - error=1 - # exit -fi -sleep 0.01 -# #################################################################################################### - -################# CAMERA CONFIGURATION ############################################ -val=e603 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 - -val=d404 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -val=d501 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -# recommended is d840 -val=d840 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -# sleep 0.01 -# recommended is db40 -val=db40 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -val=de65 -# val=de0 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -sleep 0.01 -val=df6a -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -echo " End CMOSIS Configuration .." -######################################################################################################## -echo " Write exp time......" - -######################################### EXP TIME ####################################################### -val=aa25 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -# val=ab2c -val=ab00 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -# val=acaa -val=ac00 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -#################################################################################################################### - -sleep 0.01 -#pci -w 0x9040 201 -sleep 0.01 -########################## WRITE THE READOUT NUMBER OF LINE ####################################################### -pci -w number_lines 1088 -#pci -w number_lines 8 -sleep 0.01 -################################################################################################################# -pci --start-dma dma1 -sleep 0.01 -#VRAMP 6c is 108 -val=e26c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -#VRAMP 6c is 108 -val=e36c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -sleep 0.01 -###################################### NUMBER OF OUTPUT ############################################################ -##pci -w 0x9000 0xc803 -sleep 0.01 -val=c800 -pci -w 0x9000 $val -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error=1 - # exit -fi -#pci -r 0x9000 -s 10 - -sleep 0.01 -#pci -w 0x9000 0xd011 -sleep 0.01 -#pci -r 0x9000 -s 10 - -sleep 0.01 -#pci -w 0x9000 0xd111 -######################################################################################################### -sleep 0.01 - -#echo " Reset Readout and CMOSIS " -pci -w 0x9040 0x204 -sleep .1 -echo " Release Reset for Readout" -pci -w 0x9040 0x201 -sleep .1 - -status=`pci -r 0x9050 -s 4 | awk '{print $2$3$4}'` -if [ "$status" != "8449ffff0f0010013ffff111" ]; then - echo "--------------------------------->>>> ERROR! in the camera status ... " - error=1 - # exit -fi - -#echo "--> $status" - -if [ "$error" = "1" ]; then - echo " Error in the reset and initialization" -else - echo " Camera READY ........................... OK" -fi -echo - - diff --git a/tests/Reset_Init_all_reg_11bit.sh b/tests/Reset_Init_all_reg_11bit.sh deleted file mode 100755 index 5d78f24..0000000 --- a/tests/Reset_Init_all_reg_11bit.sh +++ /dev/null @@ -1,309 +0,0 @@ -#!/bin/bash - -###################### by Michele Caselle and Uros Stafanovic ################################################## -############ Resent procedure and camera initialization for 12 -bit mode ###################################### - -error=0 -echo " Reset Readout and CMOSIS " -pci -w 0x9040 1e4 -sleep .1 -echo " Release Reset for Readout" -pci -w 0x9040 1e0 -sleep .1 -##################### PLL SET ##################################### -val=f501 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -echo " Start CMOSIS Configuration .." -pci -w 0x9000 f301 -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "bf301" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -val=d207 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 - -# Michele 10 - 12 bit mode # -# ################################################################################################### -echo " 11 - bit mode, set Bit_mode " -val=ef00 ###################################################### -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -# Michele set ADC_resolution @ 12 bits -echo " 11 bit mode, set ADC resolution 11 bits " -val=f001 # qui for 10 - 11 - 12 bits ######################################################## -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 - -# adc recommended 28=44 -val=e72c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val " - error =1 - # exit -fi -sleep 0.01 -# #################################################################################################### - -################# CAMERA CONFIGURATION ############################################ -val=e603 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 - -val=d404 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -val=d501 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -# recommended is d840 -val=d840 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -# sleep 0.01 -# recommended is db40 -val=db40 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -val=de65 -# val=de0 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -sleep 0.01 -val=df6a -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -echo " End CMOSIS Configuration .." -######################################################################################################## -echo " Write exp time......" - -######################################### EXP TIME ####################################################### -val=aa25 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -# val=ab2c -val=ab02 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -# val=acaa -val=ac00 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -#################################################################################################################### - -sleep 0.01 -pci -w 0x9040 201 -sleep 0.01 -########################## WRITE THE READOUT NUMBER OF LINE ####################################################### -pci -w number_lines 1088 -#pci -w number_lines 8 -sleep 0.01 -################################################################################################################# -pci --start-dma dma1 -sleep 0.01 -#VRAMP 6c is 108 -val=e26c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -#VRAMP 6c is 108 -val=e36c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -######################################################################################################## -#pci -w 0x9000 0xc802 -##pci -w 0x9000 0xc803 -sleep 0.01 -val=c802 -pci -w 0x9000 $val -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -#pci -r 0x9000 -s 10 - -sleep 0.01 -#pci -w 0x9000 0xd011 -sleep 0.01 -#pci -r 0x9000 -s 10 - -sleep 0.01 -#pci -w 0x9000 0xd111 -#pci -r 0x9000 -s 10 -######################################################################################################### -sleep 0.01 - -status=`pci -r 0x9050 -s 4 | awk '{print $2$3$4}'` -if [ "$status" != "8449ffff0f0010013ffff111" ]; then - echo "--------------------------------->>>> ERROR! in the camera status ... " - error =1 - # exit -fi - -#echo "--> $status" - -if [ "$error" = "1" ]; then - echo " Error in the resetand initialization" -else - echo " Camera READY ........ OK" -fi -echo - - diff --git a/tests/Reset_Init_all_reg_12bit.sh b/tests/Reset_Init_all_reg_12bit.sh deleted file mode 100755 index b14e5c9..0000000 --- a/tests/Reset_Init_all_reg_12bit.sh +++ /dev/null @@ -1,309 +0,0 @@ -#!/bin/bash - -###################### by Michele Caselle and Uros Stafanovic ################################################## -############ Resent procedure and camera initialization for 12 -bit mode ###################################### - -error=0 -echo " Reset Readout and CMOSIS " -pci -w 0x9040 1e4 -sleep .1 -echo " Release Reset for Readout" -pci -w 0x9040 1e0 -sleep .1 -##################### PLL SET ##################################### -val=f501 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -echo " Start CMOSIS Configuration .." -pci -w 0x9000 f301 -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "bf301" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -val=d207 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 - -# Michele 10 - 12 bit mode # -# ################################################################################################### -echo " 12 - bit mode, set Bit_mode " -val=ef00 ###################################################### -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -# Michele set ADC_resolution @ 12 bits -echo " 12 bit mode, set ADC resolution 12 bits " -val=f002 # qui for 10 - 11 - 12 bits ######################################################## -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 - -# adc recommended 28=44 -val=e72c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val " - error =1 - # exit -fi -sleep 0.01 -# #################################################################################################### - -################# CAMERA CONFIGURATION ############################################ -val=e603 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 - -val=d404 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -val=d501 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -# recommended is d840 -val=d840 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -# sleep 0.01 -# recommended is db40 -val=db40 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -val=de65 -# val=de0 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -sleep 0.01 -val=df6a -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -echo " End CMOSIS Configuration .." -######################################################################################################## -echo " Write exp time......" - -######################################### EXP TIME ####################################################### -val=aa01 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -# val=ab2c -val=ab00 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -# val=acaa -val=ac00 -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -#################################################################################################################### - -sleep 0.01 -pci -w 0x9040 201 -sleep 0.01 -########################## WRITE THE READOUT NUMBER OF LINE ####################################################### -pci -w number_lines 1088 -#pci -w number_lines 8 -sleep 0.01 -################################################################################################################# -pci --start-dma dma1 -sleep 0.01 -#VRAMP 6c is 108 -val=e26c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -#VRAMP 6c is 108 -val=e36c -pci -w 0x9000 $val -sleep 0.01 -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -sleep 0.01 -######################################################################################################## -#pci -w 0x9000 0xc802 -##pci -w 0x9000 0xc803 -sleep 0.01 -val=c802 -pci -w 0x9000 $val -#pci -r 0x9000 -s 10 -sleep 0.01 -value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` -if [ "$value" != "b$val" ]; then - echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" - error =1 - # exit -fi -#pci -r 0x9000 -s 10 - -sleep 0.01 -#pci -w 0x9000 0xd011 -sleep 0.01 -#pci -r 0x9000 -s 10 - -sleep 0.01 -#pci -w 0x9000 0xd111 -#pci -r 0x9000 -s 10 -######################################################################################################### -sleep 0.01 - -status=`pci -r 0x9050 -s 4 | awk '{print $2$3$4}'` -if [ "$status" != "8449ffff0f0010013ffff111" ]; then - echo "--------------------------------->>>> ERROR! in the camera status ... " - error =1 - # exit -fi - -#echo "--> $status" - -if [ "$error" = "1" ]; then - echo " Error in the resetand initialization" -else - echo " Camera READY ........ OK" -fi -echo - - diff --git a/tests/frame.sh b/tests/frame.sh index cb2deb1..b2b2a70 100755 --- a/tests/frame.sh +++ b/tests/frame.sh @@ -9,7 +9,7 @@ pci --stop-dma dma1 #pci --reset echo "Set packet size 1024 .. " -pci -w number_lines 1088 +pci -w cmosis_number_lines 1088 #pci -w xrawdata_packet_length 4096 pci --start-dma dma1 usleep 1000 diff --git a/tests/frame2.sh b/tests/frame2.sh index db3efcc..2795caf 100755 --- a/tests/frame2.sh +++ b/tests/frame2.sh @@ -9,7 +9,7 @@ pci --stop-dma dma1 #pci --reset echo "Set packet size 1024 .. " -pci -w number_lines 1088 +pci -w cmosis_number_lines 1088 #pci -w xrawdata_packet_length 4096 pci --start-dma dma1 usleep 1000 diff --git a/tests/frame_req.sh b/tests/frame_req.sh index 8d14c38..bce89c3 100755 --- a/tests/frame_req.sh +++ b/tests/frame_req.sh @@ -9,7 +9,7 @@ function pci { #pci --reset echo "Set packet size 1024 .. " -pci -w number_lines 1088 +pci -w cmosis_number_lines 1088 #pci -w xrawdata_packet_length 4096 pci --start-dma dma1 usleep 1000 diff --git a/tests/grab.sh b/tests/grab.sh index 5fa6100..daf142e 100755 --- a/tests/grab.sh +++ b/tests/grab.sh @@ -14,7 +14,7 @@ pid=$! usleep 1000000 -for i in `seq 1 10`; do +for i in `seq 1 1000`; do echo "Trigger $i" pci --trigger usleep 100000 diff --git a/tests/ipecamera/Reset_Init_all_reg_10bit.sh b/tests/ipecamera/Reset_Init_all_reg_10bit.sh new file mode 100755 index 0000000..f6a3521 --- /dev/null +++ b/tests/ipecamera/Reset_Init_all_reg_10bit.sh @@ -0,0 +1,314 @@ +#!/bin/bash + +###################### by Michele Caselle and Uros Stafanovic ################################################## +############ Resent procedure and camera initialization for 10 -bit mode ###################################### + +error=0 +echo " Reset Readout and CMOSIS " +pci -w 0x9040 204 +sleep .1 +#echo " Release Reset for Readout" +#pci -w 0x9040 1e0 +sleep .1 +##################### PLL SET ##################################### +val=f501 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +echo " Start CMOSIS Configuration .." +pci -w 0x9000 f301 +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "bf301" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +val=d207 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 + +# Michele 10 - 12 bit mode # +# ################################################################################################### +echo " 10 - bit mode, set Bit_mode " +val=ef00 ###################################################### +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +# Michele set ADC_resolution @ 12 bits +echo " 10 bit mode, set ADC resolution 10 bits " +val=f000 # qui for 10 - 11 - 12 bits ######################################################## +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 + +# adc recommended 28=44 +val=e72c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val " + error=1 + # exit +fi +sleep 0.01 +# #################################################################################################### + +################# CAMERA CONFIGURATION ############################################ +val=e603 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 + +val=d404 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +val=d501 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +# recommended is d840 +val=d840 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +# sleep 0.01 +# recommended is db40 +val=db40 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +val=de65 +# val=de0 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +sleep 0.01 +val=df6a +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +echo " End CMOSIS Configuration .." +######################################################################################################## +echo " Write exp time......" + +######################################### EXP TIME ####################################################### +val=aa25 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +# val=ab2c +val=ab00 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +# val=acaa +val=ac00 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +#################################################################################################################### + +sleep 0.01 +#pci -w 0x9040 201 +sleep 0.01 +########################## WRITE THE READOUT NUMBER OF LINE ####################################################### +pci -w cmosis_number_lines 1088 +#pci -w number_lines 8 +sleep 0.01 +################################################################################################################# +pci --start-dma dma1 +sleep 0.01 +#VRAMP 6c is 108 +val=e26c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +#VRAMP 6c is 108 +val=e36c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +sleep 0.01 +###################################### NUMBER OF OUTPUT ############################################################ +##pci -w 0x9000 0xc803 +sleep 0.01 +val=c800 +pci -w 0x9000 $val +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error=1 + # exit +fi +#pci -r 0x9000 -s 10 + +sleep 0.01 +#pci -w 0x9000 0xd011 +sleep 0.01 +#pci -r 0x9000 -s 10 + +sleep 0.01 +#pci -w 0x9000 0xd111 +######################################################################################################### +sleep 0.01 + +#echo " Reset Readout and CMOSIS " +pci -w 0x9040 0x204 +sleep .1 +echo " Release Reset for Readout" +pci -w 0x9040 0x201 +sleep .1 + +status=`pci -r 0x9050 -s 4 | awk '{print $2$3$4}'` +if [ "$status" != "8449ffff0f0010013ffff111" ]; then + echo "--------------------------------->>>> ERROR! in the camera status ... " + error=1 + # exit +fi + +#echo "--> $status" + +if [ "$error" = "1" ]; then + echo " Error in the reset and initialization" +else + echo " Camera READY ........................... OK" +fi +echo + + diff --git a/tests/ipecamera/Reset_Init_all_reg_11bit.sh b/tests/ipecamera/Reset_Init_all_reg_11bit.sh new file mode 100755 index 0000000..048f6b0 --- /dev/null +++ b/tests/ipecamera/Reset_Init_all_reg_11bit.sh @@ -0,0 +1,309 @@ +#!/bin/bash + +###################### by Michele Caselle and Uros Stafanovic ################################################## +############ Resent procedure and camera initialization for 12 -bit mode ###################################### + +error=0 +echo " Reset Readout and CMOSIS " +pci -w 0x9040 1e4 +sleep .1 +echo " Release Reset for Readout" +pci -w 0x9040 1e0 +sleep .1 +##################### PLL SET ##################################### +val=f501 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +echo " Start CMOSIS Configuration .." +pci -w 0x9000 f301 +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "bf301" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +val=d207 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 + +# Michele 10 - 12 bit mode # +# ################################################################################################### +echo " 11 - bit mode, set Bit_mode " +val=ef00 ###################################################### +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +# Michele set ADC_resolution @ 12 bits +echo " 11 bit mode, set ADC resolution 11 bits " +val=f001 # qui for 10 - 11 - 12 bits ######################################################## +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 + +# adc recommended 28=44 +val=e72c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val " + error =1 + # exit +fi +sleep 0.01 +# #################################################################################################### + +################# CAMERA CONFIGURATION ############################################ +val=e603 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 + +val=d404 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +val=d501 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +# recommended is d840 +val=d840 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +# sleep 0.01 +# recommended is db40 +val=db40 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +val=de65 +# val=de0 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +sleep 0.01 +val=df6a +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +echo " End CMOSIS Configuration .." +######################################################################################################## +echo " Write exp time......" + +######################################### EXP TIME ####################################################### +val=aa25 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +# val=ab2c +val=ab02 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +# val=acaa +val=ac00 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +#################################################################################################################### + +sleep 0.01 +pci -w 0x9040 201 +sleep 0.01 +########################## WRITE THE READOUT NUMBER OF LINE ####################################################### +pci -w cmosis_number_lines 1088 +#pci -w number_lines 8 +sleep 0.01 +################################################################################################################# +pci --start-dma dma1 +sleep 0.01 +#VRAMP 6c is 108 +val=e26c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +#VRAMP 6c is 108 +val=e36c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +######################################################################################################## +#pci -w 0x9000 0xc802 +##pci -w 0x9000 0xc803 +sleep 0.01 +val=c802 +pci -w 0x9000 $val +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +#pci -r 0x9000 -s 10 + +sleep 0.01 +#pci -w 0x9000 0xd011 +sleep 0.01 +#pci -r 0x9000 -s 10 + +sleep 0.01 +#pci -w 0x9000 0xd111 +#pci -r 0x9000 -s 10 +######################################################################################################### +sleep 0.01 + +status=`pci -r 0x9050 -s 4 | awk '{print $2$3$4}'` +if [ "$status" != "8449ffff0f0010013ffff111" ]; then + echo "--------------------------------->>>> ERROR! in the camera status ... " + error =1 + # exit +fi + +#echo "--> $status" + +if [ "$error" = "1" ]; then + echo " Error in the resetand initialization" +else + echo " Camera READY ........ OK" +fi +echo + + diff --git a/tests/ipecamera/Reset_Init_all_reg_12bit.sh b/tests/ipecamera/Reset_Init_all_reg_12bit.sh new file mode 100755 index 0000000..00c2481 --- /dev/null +++ b/tests/ipecamera/Reset_Init_all_reg_12bit.sh @@ -0,0 +1,309 @@ +#!/bin/bash + +###################### by Michele Caselle and Uros Stafanovic ################################################## +############ Resent procedure and camera initialization for 12 -bit mode ###################################### + +error=0 +echo " Reset Readout and CMOSIS " +pci -w 0x9040 1e4 +sleep .1 +echo " Release Reset for Readout" +pci -w 0x9040 1e0 +sleep .1 +##################### PLL SET ##################################### +val=f501 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +echo " Start CMOSIS Configuration .." +pci -w 0x9000 f301 +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "bf301" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +val=d207 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 + +# Michele 10 - 12 bit mode # +# ################################################################################################### +echo " 12 - bit mode, set Bit_mode " +val=ef00 ###################################################### +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +# Michele set ADC_resolution @ 12 bits +echo " 12 bit mode, set ADC resolution 12 bits " +val=f002 # qui for 10 - 11 - 12 bits ######################################################## +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 + +# adc recommended 28=44 +val=e72c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val " + error =1 + # exit +fi +sleep 0.01 +# #################################################################################################### + +################# CAMERA CONFIGURATION ############################################ +val=e603 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 + +val=d404 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +val=d501 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +# recommended is d840 +val=d840 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +# sleep 0.01 +# recommended is db40 +val=db40 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +val=de65 +# val=de0 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +sleep 0.01 +val=df6a +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +echo " End CMOSIS Configuration .." +######################################################################################################## +echo " Write exp time......" + +######################################### EXP TIME ####################################################### +val=aa01 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +# val=ab2c +val=ab00 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +# val=acaa +val=ac00 +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +#################################################################################################################### + +sleep 0.01 +pci -w 0x9040 201 +sleep 0.01 +########################## WRITE THE READOUT NUMBER OF LINE ####################################################### +pci -w cmosis_number_lines 1088 +#pci -w number_lines 8 +sleep 0.01 +################################################################################################################# +pci --start-dma dma1 +sleep 0.01 +#VRAMP 6c is 108 +val=e26c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +#VRAMP 6c is 108 +val=e36c +pci -w 0x9000 $val +sleep 0.01 +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +sleep 0.01 +######################################################################################################## +#pci -w 0x9000 0xc802 +##pci -w 0x9000 0xc803 +sleep 0.01 +val=c802 +pci -w 0x9000 $val +#pci -r 0x9000 -s 10 +sleep 0.01 +value=`pci -r 0x9000 -s 8 | grep 9010 | awk '{print $2}' | cut -c 4-8` +if [ "$value" != "b$val" ]; then + echo "--------------------------------->>>> ERROR! read value: ${value:1:4}, written value: $val" + error =1 + # exit +fi +#pci -r 0x9000 -s 10 + +sleep 0.01 +#pci -w 0x9000 0xd011 +sleep 0.01 +#pci -r 0x9000 -s 10 + +sleep 0.01 +#pci -w 0x9000 0xd111 +#pci -r 0x9000 -s 10 +######################################################################################################### +sleep 0.01 + +status=`pci -r 0x9050 -s 4 | awk '{print $2$3$4}'` +if [ "$status" != "8449ffff0f0010013ffff111" ]; then + echo "--------------------------------->>>> ERROR! in the camera status ... " + error =1 + # exit +fi + +#echo "--> $status" + +if [ "$error" = "1" ]; then + echo " Error in the resetand initialization" +else + echo " Camera READY ........ OK" +fi +echo + + diff --git a/tests/reset_init.sh b/tests/reset_init.sh deleted file mode 100755 index ebfc9f5..0000000 --- a/tests/reset_init.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -echo " Reset Readout and CMOSIS " -pci -w 0x9040 1e5 -echo " Release Reset for Readout" -pci -w 0x9040 1e1 - -echo " Start CMOSIS Configuration .." -pci -w 0x9000 f301 -pci -r 0x9000 -s 4 - -pci -w 0x9000 d207 -pci -r 0x9000 -s 4 - -pci -w 0x9000 8101 -pci -r 0x9000 -s 4 - -pci -w 0x9000 8200 -pci -r 0x9000 -s 4 -echo " End CMOSIS Configuration .." -pci -w 0x9040 3e1 - -pci -r 0x9000 -s 100 -- cgit v1.2.3