@@ -71,7 +71,6 @@ class Gain:
71
71
DIV_2_80MV = 0x01 # shunt prog. gain set to /2, 80 mV range
72
72
DIV_4_160MV = 0x02 # shunt prog. gain set to /4, 160 mV range
73
73
DIV_8_320MV = 0x03 # shunt prog. gain set to /8, 320 mV range
74
- AUTO = - 1 # shunt prog. gain set to automatic
75
74
76
75
class ADCResolution :
77
76
"""Constants for ``bus_adc_resolution`` or ``shunt_adc_resolution``"""
@@ -484,12 +483,12 @@ def set_calibration_16V_5A(self):
484
483
# only supporting 16V at 5000mA max.
485
484
486
485
# VBUS_MAX = 16V
487
- # VSHUNT_MAX = 0.08 (Assumes Gain 2, 80mV )
486
+ # VSHUNT_MAX = 0.16 (Assumes Gain 3, 160mV )
488
487
# RSHUNT = 0.02 (Resistor value in ohms)
489
488
490
489
# 1. Determine max possible current
491
490
# MaxPossible_I = VSHUNT_MAX / RSHUNT
492
- # MaxPossible_I = 4 .0A
491
+ # MaxPossible_I = 8 .0A
493
492
494
493
# 2. Determine max expected current
495
494
# MaxExpected_I = 5.0A
@@ -513,7 +512,7 @@ def set_calibration_16V_5A(self):
513
512
514
513
# 6. Calculate the power LSB
515
514
# PowerLSB = 20 * CurrentLSB
516
- # PowerLSB = 0.001 (1mW per bit)
515
+ # PowerLSB = 0.003 (3.048mW per bit)
517
516
self ._power_lsb = 0.003048
518
517
519
518
# 7. Compute the maximum current and shunt voltage values before overflow
@@ -526,7 +525,7 @@ def set_calibration_16V_5A(self):
526
525
527
526
# Set Config register to take into account the settings above
528
527
self .bus_voltage_range = BusVoltageRange .RANGE_16V
529
- self .gain = Gain .AUTO
528
+ self .gain = Gain .DIV_4_160MV
530
529
self .bus_adc_resolution = ADCResolution .ADCRES_12BIT_1S
531
530
self .shunt_adc_resolution = ADCResolution .ADCRES_12BIT_1S
532
531
self .mode = Mode .SANDBVOLT_CONTINUOUS
0 commit comments