diff --git a/ohmpi/hardware_components/mb_2023_0_X.py b/ohmpi/hardware_components/mb_2023_0_X.py index 15049a12c5a429a3228eaa830062d73946f740c6..e9dfefd7167346f6b20104a4d660c036da3aa993 100644 --- a/ohmpi/hardware_components/mb_2023_0_X.py +++ b/ohmpi/hardware_components/mb_2023_0_X.py @@ -18,6 +18,7 @@ SPECS = {'rx': {'sampling_rate': {'min': 2., 'default': 10., 'max': 100.}, 'bias': {'min': -5000., 'default': 0., 'max': 5000.}, 'coef_p2': {'default': 2.50}, 'mcp_address': {'default': None}, + 'ads_address': {'default': 0x49}, 'voltage_min': {'default': 10.0}, 'vmn_hardware_offset': {'default': 0.} }, @@ -26,6 +27,7 @@ SPECS = {'rx': {'sampling_rate': {'min': 2., 'default': 10., 'max': 100.}, 'voltage_max': {'min': 0., 'default': 12., 'max': 12.}, # Maximum input voltage 'data_rate': {'default': 860.}, 'mcp_address': {'default': 0x20}, + 'ads_address': {'default': 0x48}, 'compatible_power_sources': {'default': 'pwr_batt', 'others' : ['dps5005']}, 'r_shunt': {'min': 0., 'default': 2. }, 'activation_delay': {'default': 0.005}, # Max turn on time of 211EH relays = 5ms @@ -82,7 +84,7 @@ class Tx(TxAbstract): # I2C connexion to MCP23008, for current injection self.mcp_board = MCP23008(self.connection, address=kwargs['mcp_address']) # ADS1115 for current measurement (AB) - self._ads_current_address = 0x48 + self._ads_current_address = kwargs['ads_address'] self._ads_current_data_rate = kwargs['data_rate'] self._ads_current = ads.ADS1115(self.connection, gain=self.adc_gain, data_rate=self._ads_current_data_rate, address=self._ads_current_address) @@ -164,7 +166,7 @@ class Tx(TxAbstract): if polarity == 1: self.pin0.value = True self.pin1.value = False - time.sleep(self._activation_delay) # use a property set by kwargs? + time.sleep(self._activation_delay) elif polarity == -1: self.pin0.value = False self.pin1.value = True @@ -220,7 +222,7 @@ class Rx(RxAbstract): self.exec_logger.event(f'{self.board_name}\trx_init\tbegin\t{datetime.datetime.utcnow()}') # ADS1115 for voltage measurement (MN) - self._ads_voltage_address = 0x49 + self._ads_voltage_address = kwargs['ads_address'] self._adc_gain = 2/3 self._ads_voltage = ads.ADS1115(self.connection, gain=self._adc_gain, data_rate=SPECS['rx']['data_rate']['default'], diff --git a/ohmpi/hardware_components/mb_2024_0_2.py b/ohmpi/hardware_components/mb_2024_0_2.py index c0be4c5583959483a0de457bbf9f832f4bb5ec4a..1d916dac7c70e1d5f070f07eaedd719d84db5083 100644 --- a/ohmpi/hardware_components/mb_2024_0_2.py +++ b/ohmpi/hardware_components/mb_2024_0_2.py @@ -15,6 +15,7 @@ SPECS = {'rx': {'sampling_rate': {'min': 2., 'default': 10., 'max': 100.}, 'bias': {'min': -5000., 'default': 0., 'max': 5000.}, 'coef_p2': {'default': 1.00}, 'mcp_address': {'default': 0x27}, + 'ads_address': {'default': 0x49}, 'voltage_min': {'default': 10.0}, 'vmn_hardware_offset' : {'default': 2500.}, }, @@ -23,6 +24,7 @@ SPECS = {'rx': {'sampling_rate': {'min': 2., 'default': 10., 'max': 100.}, 'voltage_max': {'min': 0., 'default': 12., 'max': 12.}, # Maximum input voltage 'data_rate': {'default': 860.}, 'mcp_address': {'default': 0x21}, + 'ads_address': {'default': 0x48}, 'compatible_power_sources': {'default': 'pwr_batt', 'others' : ['dps5005']}, 'r_shunt': {'min': 0., 'default': 2.}, 'activation_delay': {'default': 0.010}, # Max turn on time of OMRON G5LE-1 5VDC relays