Skip to main content

Register Manual

The UPS HAT (E) primarily uses I2C communication to read module information, making it simple and convenient to use. The module slave address is: 0x2D.

Register Table

ID Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x00R0x0a0000 1010

Power-On Trigger Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x01R/W0x0b0000 1011
warning

0x01 is a one-time shutdown trigger register, not the auto-start-on-power configuration register. After writing 0x55 to 0x01, the module initiates a delayed shutdown sequence: it cuts power to the Raspberry Pi after about 30 seconds, and then begins detecting charging after about 60 seconds. When power is detected, the module re-applies power to the Raspberry Pi and boots it. Auto-start-on-power is controlled by BIT0 of 0x40, with a default value of 1. Before performing the write, you must save data and prepare for a safe shutdown.

Charging Status Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x02R1: Charging 0: Not charging1: Fast charge 0: Not fast charge1: VBUS powered 0: VBUS not poweredFixed: 00000: Standby, 001: Trickle charge, 010: Constant current charge, 011: Constant voltage charge, 100: Charging waiting, 101: Full charge, 110: Charge timeout

Communication Status Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x03RFixed: 0000001: BQ4050 communication OK; 0: BQ4050 communication error1: IP2368 communication OK; 0: IP2368 communication error

Type-C VBUS Voltage Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x10RLow 8 bits of VBUS voltage data (mV)
0x11RHigh 8 bits of VBUS voltage data (mV)

Type-C VBUS Current Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x12RLow 8 bits of VBUS current data (mA)
0x13RHigh 8 bits of VBUS current data (mA)

Type-C VBUS Power Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x14RLow 8 bits of VBUS power data (mW)
0x15RHigh 8 bits of VBUS power data (mW)

Battery Voltage Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x20RLow 8 bits of total battery voltage data (mV)
0x21RHigh 8 bits of total battery voltage data (mV)

Battery Current Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x22RLow 8 bits of battery current data (mA)
0x23RHigh 8 bits of battery current data (mA), signed 16-bit; positive indicates charge current, negative indicates discharge current

Battery Remaining Percentage Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x24RLow 8 bits of battery remaining percentage data (%)
0x25RHigh 8 bits of battery remaining percentage data (%)

Battery Remaining Capacity Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x26RLow 8 bits of battery remaining capacity data (mAh)
0x27RHigh 8 bits of battery remaining capacity data (mAh)

Battery Remaining Discharge Time Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x28RLow 8 bits of battery remaining discharge time data (min)
0x29RHigh 8 bits of battery remaining discharge time data (min)

Battery Remaining Charge Time Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x2aRLow 8 bits of battery remaining charge time data (min)
0x2bRHigh 8 bits of battery remaining charge time data (min)

Battery 1 Voltage Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x30RLow 8 bits of battery 1 voltage data (mV)
0x31RHigh 8 bits of battery 1 voltage data (mV)

Battery 2 Voltage Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x32RLow 8 bits of battery 2 voltage data (mV)
0x33RHigh 8 bits of battery 2 voltage data (mV)

Battery 3 Voltage Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x34RLow 8 bits of battery 3 voltage data (mV)
0x35RHigh 8 bits of battery 3 voltage data (mV)

Battery 4 Voltage Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x36RLow 8 bits of battery 4 voltage data (mV)
0x37RHigh 8 bits of battery 4 voltage data (mV)

Control Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x40R/W0x01Reserved1: Watchdog enable; 0: Watchdog disable (default)1: Auto-start on power (default); 0: Auto-start on power disable

Custom UPS I2C Address

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x41R/W0x2dI2C address range: 0x08–0x77, default: 0x2d

Watchdog Timeout Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x42R/W0xFFRange: 0–255, unit: s, default: 0xFF

Watchdog Delay Start Register

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x43R/W0xFFRange: 0–255, unit: s, default: 0xFF

Software Version

RegisterR/WDefaultBIT7BIT6BIT5BIT4BIT3BIT2BIT1BIT0
0x50RSoftware version; shifting the decimal point left by one digit gives the software version, e.g. 0x14 = 20 = V2.0