diff --git a/pypcc/config/RECVTR_LB.yaml b/pypcc/config/RECVTR_LB.yaml index bb14580139a5fa0a8fe9113a3481d05e90720134..7da36600b7d4f07d555c86c9a9cfe023ee36b2d0 100644 --- a/pypcc/config/RECVTR_LB.yaml +++ b/pypcc/config/RECVTR_LB.yaml @@ -393,10 +393,11 @@ variables: devreg: IO2.GPIO1 width: 1 bitoffset: 6 - rw: ro #rw for testing + rw: rw #rw for testing dtype: boolean dim: 32 mask: RCU_mask +# wait: 1 - name: RCU_PWR_good description: Status of RCU power given by LDOs. @@ -420,6 +421,7 @@ variables: dtype: boolean dim: 32 mask: RCU_mask +# wait: 1 - name: RCU_DTH_shutdown description: False means dither source powered on. @@ -637,46 +639,62 @@ methods: instructions: - RECVTR_I2C_error: 0 - RCU_PCB_version: Update - - IO2.CONF1: 0x80 #Pgood on 0x80 + #Start with all off + - IO2.GPIO1: 0x00 #default is 1, so should be cleared before making output + - IO2.CONF1: 0x80 # + - IO1.GPIO2: 0x00 # + - IO1.CONF2: 0 # + + #Put ADC in shutdown mode for powerup +# - IO3.GPIO1: 0x7D #0111 1101 ADC_SDIO=high, clk=low, DTH_EN=low + + #Power on + - RCU_PWR_DIGITAL_on : 1 #switch on with delay + - RCU_PWR_ANALOG_on : 1 #switch on with delay + #Set registers to default values - IO2.GPIO1: 0x4A #0x40 Dig on, 0x0a =10dB att - IO2.GPIO2: 0x55 #0x15 #Band0 (or 0x2a band 1) #LED green=on=low - - IO3.GPIO1: 0x15 #ADC_SDIO=high, clk=low, DTH_EN=low + - IO3.GPIO1: 0x15 #0001 0101 ADC_SDIO=high, clk=low, DTH_EN=low - IO3.GPIO2: 0x47 #ADC SC=high, DTH_SDA=high, DTH_EN=low - IO1.GPIO1: 0x0A #0x0a = 10dB att - - IO1.GPIO2: 0x8A #0x80 Analog on, 0x0a=10dB att # - IO1.POL1: 0 # - IO1.POL2: 0 # - IO2.POL1: 0 # - IO2.POL2: 0 - IO2.CONF2: 0 + - IO1.CONF1: 0 + - IO3.POL2: 0 + - IO3.POL1: 0 - IO3.CONF1: 0 - IO3.CONF2: 0 - - IO3.POL1: 0 - - IO3.POL2: 0 - - IO1.CONF1: 0 - - IO1.CONF2: 0 # - RCU_GPIO1: Update -# - RCU_GPIO2: Update + - RCU_GPIO2: Update # - RCU_attenuator: [10,10,10] #Set OPC-UA variable #name="RCU_DTH_shutdown" - RCU_update: 0 - - WAIT: 500 #ms to wait +# - WAIT: 500 #ms to wait - ADC1_on: 0 #call another opc-ua method # - WAIT: 1000 #ms to wait - ADC2_on: 0 # - WAIT: 1000 #ms to wait - ADC3_on: 0 -# - WAIT: 500 #ms to wait + - WAIT: 100 #ms to wait #Toggle enable pin - RCU_ADC_shutdown : [1,1,1] # - IO3.GPIO1: 0xD5 #ADC_SDIO=high, clk=low, DTH_EN=high # - IO3.GPIO2: 0xC7 #ADC SC=high, DTH_SDA=high, DTH_EN=high - - WAIT: 100 #ms to wait #todo: test if necessary + - RCU_PWR_3V3: Update + - RCU_ADC_shutdown : [1,1,0] + - WAIT: 100 #ms to wait + - RCU_ADC_shutdown : [1,0,0] + - WAIT: 100 #ms to wait - RCU_ADC_shutdown : [0,0,0] # - IO3.GPIO1: 0x15 #enable ADC 0,1 # - IO3.GPIO2: 0x47 #enable ADC 2 - - RCU_DTH_on: Update #check dither while giving ADCs some time to lock +# - RCU_DTH_on: Update #check dither while giving ADCs some time to lock # - WAIT: 500 #ms to wait + - RCU_PWR_1V8: Update + - RCU_PWR_2V5: Update - RCU_ADC_locked: Update #disabled for testing - name: RCU_update @@ -756,6 +774,9 @@ methods: - IO1.GPIO2: 0 - RCU_update: 0 #todo, also make all GPIO pins (except power enables) inputs to remove all power from devices. + - RCU_PWR_1V8: Update + - RCU_PWR_2V5: Update + - RCU_PWR_3V3: Update - name: RCU_DTH_on description: Switch dither source on diff --git a/pypcc/i2cserv/i2c_array.py b/pypcc/i2cserv/i2c_array.py index d1328aeb20323b6df4b0e0b635d3313a3c33e10c..92b80194a8c1772ffb0bfdf050091f88b3e17ce4 100644 --- a/pypcc/i2cserv/i2c_array.py +++ b/pypcc/i2cserv/i2c_array.py @@ -4,7 +4,7 @@ from .spibitbang1 import spibitbang1 from pypcc.queuetypes import * from .hwdev import hwdev from .i2c_dev import * - +from time import sleep class i2c_array(i2c_dev): def __init__(self,config): @@ -115,6 +115,7 @@ class i2c_array(i2c_dev): self.SetSwitch(RCUi); self.RCUi=RCUi; res=self.SetVarValue(devreg,width,bitoffset,data[i0:i1]) + if var1.get('wait',0)>0: sleep(var1['wait']/1000) if not(res): if self.disableI2ConError: self.I2Cmask[RCUi]+=1; if self.I2Cmask[RCUi]>self.I2Ccut: mask[RCUi*Step+Vari]=False; diff --git a/scripts/get_all_apspu.py b/scripts/get_all_apspu.py new file mode 100644 index 0000000000000000000000000000000000000000..d23b302576cedecf635dd1d98f621c3aabe24630 --- /dev/null +++ b/scripts/get_all_apspu.py @@ -0,0 +1,11 @@ +from test_common import * +from time import sleep +connect("opc.tcp://localhost:4842/") + + +names=get_all_variables() +for name in names: + att=get_value(name) + print(name,'=',att) + +disconnect();