Skip to content
Snippets Groups Projects
Select Git revision
  • fd9cfb61b22718d016c4540bcade9bf48d18ec53
  • master default protected
  • revert-cs032-ccd-ip
  • deploy-components-parallel
  • fix-chrony-exporter
  • L2SS-2407-swap-iers-caltable-monitoring-port
  • L2SS-2357-fix-ruff
  • sync-up-with-meta-pypcc
  • stabilise-landing-page
  • all-stations-lofar2
  • v0.39.7-backports
  • Move-sdptr-to-v1.5.0
  • fix-build-ubuntu
  • tokens-in-env-files
  • fix-build
  • L2SS-2214-deploy-cdb
  • fix-missing-init
  • add-power-hardware-apply
  • L2SS-2129-Add-Subrack-Routine
  • Also-listen-internal-to-rpc
  • fix-build-dind
  • v0.55.5-r2 protected
  • v0.52.8-rc1 protected
  • v0.55.5 protected
  • v0.55.4 protected
  • 0.55.2.dev0
  • 0.55.1.dev0
  • 0.55.0.dev0
  • v0.54.0 protected
  • 0.53.2.dev0
  • 0.53.1.dev0
  • v0.52.3-r2 protected
  • remove-snmp-client
  • v0.52.3 protected
  • v0.52.3dev0 protected
  • 0.53.1dev0
  • v0.52.2-rc3 protected
  • v0.52.2-rc2 protected
  • v0.52.2-rc1 protected
  • v0.52.1.1 protected
  • v0.52.1 protected
41 results

UNB2_notebook.ipynb

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    APSPU_I2C.py 1.62 KiB
    #******************************************#
    # I2C address, registers and ports for UNB2c
    # Created: 2021-05-11
    #******************************************#
    
    ###################################
    # General, Point of load converters
    ###################################
    
    CTR_LBA    = 0x3C
    CTR_RCU2_A = 0x3D
    CTR_RCU2_D = 0x0E
    CTR_POLS = {"CTR_LBA" :  0x3C,
                "CTR_RCU2_A" : 0x3D,
                "CTR_RCU2_D" : 0x3E}
    
    LP_VOUT_MODE      = 0x20
    LP_VOUT           = 0x8B #
    LP_temp           = 0x8D #
    LP_IOUT           = 0x8C
    
    ###################################
    # Central I2C Devices
    ###################################
    EEPROM            = 0x50
    
    ###################################
    # FAN speed
    ###################################
    MAX6620          = 0x52
    
    REG_GLOBAL = 0x00
    REG_TACH_1_MSP = 0x10
    REG_TACH_1_LSP = 0x11
    REG_TACH_2_MSP = 0x12
    REG_TACH_2_LSP = 0x13
    REG_TACH_3_MSP = 0x14
    REG_TACH_3_LSP = 0x15
    
    RUN_MONITOR = 0x80
    
    
    
    ######################
    # Functions
    ######################
    
    # Calculate floating point value according PMBus lineair
    def calc_lin_2bytes(data):
        expo = ((data[1] & 0xf8)>>3) 
        if expo > 2**4:
            expo = expo-2**5
        mantisse = (data[1] & 0x7)*0x100 + data[0]
        output = mantisse * 2**expo
        return output
    
    # Calculate floating point value according PMBus lineair
    def calc_lin_3bytes(data,mode):
        expo = (mode[0] & 0x1F) 
        if expo > 2**4:
            expo = expo - 2**5
        output = (data[1]*256 + data[0]) * 2**expo
        return output
    def tach(tach_msb, tach_lsb):
        tach_pulse_per_revolution = 2
        tach = (int(tach_msb, 16)*8) + (int(tach_lsb, 16)/32)
        rpm = 60/(tach*tach_pulse_per_revolution)
        return rpm