Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Language: Russian | English

🚀 LTM4673 Python Library

A Python library designed for configuration, control, and telemetry data collection from LTM4673 4-channel DC/DC converters using the I2C/PMBus protocol.

💡 Architectural Feature: The LTM4673 power micromodule is internally built around an integrated LTC2975 digital power system manager. Consequently, the library instantiates and interacts with the PMBus registers of the device using the LTC2975 class.


✨ Features

The library provides a high-level API to interact with the integrated power system manager:

  • Configure voltage thresholds and overcurrent/undercurrent fault limits.
  • Monitor real-time system parameters (telemetry data).
  • Manage the built-in closed-loop voltage servo mechanism to adjust channel voltages.

📋 Requirements & Dependencies

  • OS: Linux (Raspberry Pi, Orange Pi, server motherboards, and any embedded platforms featuring a native hardware I2C bus).
  • Python: Version 3.7 or higher.
  • Libraries: smbus2 (utilized instead of the legacy smbus package to ensure reliable operation on modern Linux distributions).

Note: Before executing scripts, verify that the I2C interface is enabled at the kernel level and that the active user account possesses read/write permissions for /dev/i2c-* nodes.


📦 Installation

  1. Clone the library repository:

    git clone https://github.com
    cd ltm4673-python-library
  2. Install the required Python dependency:

    pip install smbus2

💻 Usage Example

Below is a basic workflow demonstrating how to initialize the module, read the primary input telemetry channels, and modify the target output voltage on a channel:

import time
# Import the integrated LTC2975 PMBus controller class
from ltm4673 import LTC2975 

# I2C Connection Settings
DEFAULT_BUS = 1       # System I2C bus index (/dev/i2c-1)
I2C_BASE_ADDR = 0x5b  # Target PMBus address of the hardware device

# Power module initialization
sensor = LTC2975(bus_num=DEFAULT_BUS, addr=I2C_BASE_ADDR)

# 1. Fetch system metadata and hardware chip identifiers
print(f"Device ID:       {hex(sensor.mfr_special_id())}")
print(f"Customer Codes:  {hex(sensor.mfr_special_lot())}")

# 2. Gather input power rail telemetry
print(f"Vin  = {sensor.read_vin():.2f} V")
print(f"Iin  = {sensor.read_iin():.2f} A")
print(f"Status Input:    {hex(sensor.status_input())}")

# 3. Modify operational configuration (requires bypassing write protection)
print("\nUpdating module configuration...")
sensor.write_protect(0x00)   # Disable Write Protect

sensor.vin_on(4.5)           # Set input voltage turn-on threshold to 4.5V
sensor.vout_command(1.2)     # Set target output channel voltage to 1.2V

print("Configuration successfully applied.")

🛠 API Overview

Initialization

sensor = LTC2975(bus_num=1, addr=0x5b)
  • bus_num (int): System I2C bus identifier (Default: 1).
  • addr (int): 7-bit physical PMBus address of the integrated chip (Default: 0x5b).

Core Read Methods (Telemetry)

  • read_vin() — Returns the current input voltage of the module in Volts (float).
  • read_iin() — Returns the current input current of the module in Amperes (float).
  • status_input() — Reads the operational byte from the input source status register (byte).
  • mfr_special_id() — Reads the unique model identifier assigned to the internal hardware controller.

Core Write Methods (Configuration)

  • write_protect(mask) — Configures the register write protection mask. Passing 0x00 fully unlocks register access.
  • vin_on(voltage) — Sets the minimum required input voltage threshold for the module to start up.
  • vout_command(voltage) — Commands the selected active channel to transition to the specified target output voltage.

👥 Authors

  • awolfmanLibrary development, PMBus command mappings, and hardware target testing.
  • Gemini (Google AI Assistant)Technical documentation audit, API syntax correction, and README.md structural formatting.

About

LTM4673 Python Library

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages