--- A/calibrate_6022.py 2020-03-24 11:38:55.000000000 +0100 +++ B/calibrate_6022.py 2020-04-04 10:53:10.171965492 +0200 @@ -89,12 +89,12 @@ print("Setting up scope...") -scope = Oscilloscope() +scope = Oscilloscope(0x1d50,0x608e) scope.setup() scope.open_handle() -if (not scope.is_device_firmware_present): - scope.flash_firmware() +#if (not scope.is_device_firmware_present): +# scope.flash_firmware() scope.supports_single_channel = True @@ -114,15 +114,16 @@ # next 32 bytes are the fractional error (range -0.5 ... +0.5) of the offset values above, # 0x80 = 0, 0x80-125 = -0.5, 0x80+125 = +0.5 # -ee_calibration = bytearray( scope.get_calibration_values( 32 + 16 + 32 ) ) +#ee_calibration = bytearray( scope.get_calibration_values( 32 + 16 + 32 ) ) +ee_calibration = bytearray( 32 + 16 + 32 ) # mV/div ranges V_div = ( 20, 50, 100, 200, 500, 1000, 2000, 5000 ) # corresponding amplifier gain settings -gains = ( 10, 10, 10, 5, 2, 1, 1, 1 ) +gains = ( 20, 20, 10, 5, 2, 1, 1, 1 ) # available amplifier gains -gainSteps = ( 10, 5, 2, 1 ) +gainSteps = ( 20, 10, 5, 2, 1 ) # measure offset # apply 0 V and measure the ADC values @@ -168,9 +169,9 @@ if ( create_config ): # prepare config file - configfile = "modelDSO6022.conf" + configfile = "modelDDS120.conf" config = open( configfile, "w" ) - config.write( ";OpenHantek calibration file for DSO6022\n;Created by tool 'calibrate.py'\n\n" ) + config.write( ";OpenHantek calibration file for DDS120\n;Created by tool 'calibrate.py'\n\n" ) config.write( "[offset]\n" ) @@ -212,7 +213,7 @@ # theoretical gain error of 6022 front end due to nominal resistor values (e.g. 5.1 kOhm instead 5.0) # these values are considered also in OpenHantek6022 - error = ( 1.00, 1.01, 0.99, 0.99 ) # gainSteps 10x, 5x, 2x, 1x + error = ( 1.60, 0.80, 0.77, 0.86, 0.83 ) # gainSteps 20x, 10x, 5x, 2x, 1x gain1 = {} gain2 = {}