Skip to content
Snippets Groups Projects
Commit 0ef795d4 authored by Paulus Kruger's avatar Paulus Kruger
Browse files

fix bug in AHBAFE analog trigger

parent 500c8b33
No related branches found
No related tags found
No related merge requests found
Pipeline #108940 passed
......@@ -198,6 +198,7 @@ device_registers:
- {name: PCB_version,address: 0x24}
- {name: PCB_number,address: 0x32}
- {name: ADC,address: 0x50}
- {name: Vref,address: 0x1c}
- name: ADC
dim: 3
......@@ -905,6 +906,17 @@ variables:
dim: 96
dim2: [3,32]
- name: AHBAT_Vref
description: 0..16
driver: I2C_AHBAT
devreg: [AHBAT1.Vref,AHBAT2.Vref,AHBAT3.Vref]
width: 8
rw: rw
dtype: uint8
dim: 96
dim2: [1,96]
mask: AHBAT_mask
wait: 700 #ms
methods:
- name: RECVTR_Init #Called after startup to load. Should have all stored registers
......
......@@ -43,7 +43,7 @@ class hba2(hwdev):
# logging.warning("SetHba2 not implemented")
logging.info("setHba2 addr=0x%x reg=0x%x len=%i",addr,reg,len(data))
I2Ccallback=self.conf['parentcls'].i2csetget
if not(I2Ccallback(addr,[reg,1,data[0]],reg=0x0e)): return False;
if not(I2Ccallback(addr,[reg,2,data[0]],reg=0x0e)): return False; #only len=2 (BF) implemented
return True
def gethba(self,addr,reg,data):
......
......@@ -16,11 +16,13 @@ setAntmask([RCU],AntMask)
wait_not_busy(busy,timeout_sec=4)
#val,tp=get_value_type(name+"_R")
#set_value("HBAT_PWR_on_RW",[False]*(32*96))
#set_value("HBAT_PWR_LNA_on_RW",[False]*(32*96))
if False:
print("LEDs on")
print("LEDs & PWR on")
set_value("HBAT_PWR_on_RW",[True]*(32*96))
set_value("HBAT_PWR_LNA_on_RW",[True]*(32*96))
set_value("HBAT_LED_on_RW",[True]*(32*96))
val,tp=get_value_type("HBAT_BF_delay_steps_R")
set_value("HBAT_BF_delay_steps_RW",val,tp)
wait_not_busy(busy,timeout_sec=4)
setAntmask([RCU],AntMask,name="AHBAT_mask_RW")
......@@ -28,7 +30,11 @@ wait_not_busy(busy,timeout_sec=4)
sinr=1
if True:
if False:
set_value("AHBAT_Vref_RW",[0x04]*96)
wait_not_busy(busy,timeout_sec=4)
if False:
print("Configuration:")
callmethod("AHBAT_update")
wait_not_busy(busy,timeout_sec=8)
......@@ -56,7 +62,7 @@ if True:
uid=get_value("AHBAT_ADC_R")[16*sinr:16*(sinr+1)]
for cnt,val in enumerate(uid):
print('%2i %6i %6i %6i %6i'%(cnt+1,val&0xfff,(val>>16)&0xfff,(val>>32)&0xfff,(val>>48)&0xfff))
print('%2i %6i %6i %6i %6i %6i'%(cnt+1,val&0xffff,(val>>16)&0xffff,(val>>32)&0xffff,(val>>48)&0xffff,((val>>16)&0xffff)-((val)&0xffff)))
# print("ADC",['%016x'%x for x in uid])
disconnect()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment