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
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x00 | R | 0x0a | 0000 1010 | |||||||
Power-On Trigger Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x01 | R/W | 0x0b | 0000 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
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x02 | R | 1: Charging 0: Not charging | 1: Fast charge 0: Not fast charge | 1: VBUS powered 0: VBUS not powered | Fixed: 00 | 000: Standby, 001: Trickle charge, 010: Constant current charge, 011: Constant voltage charge, 100: Charging waiting, 101: Full charge, 110: Charge timeout | ||||
Communication Status Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x03 | R | Fixed: 000000 | 1: BQ4050 communication OK; 0: BQ4050 communication error | 1: IP2368 communication OK; 0: IP2368 communication error | ||||||
Type-C VBUS Voltage Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x10 | R | Low 8 bits of VBUS voltage data (mV) | ||||||||
| 0x11 | R | High 8 bits of VBUS voltage data (mV) | ||||||||
Type-C VBUS Current Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x12 | R | Low 8 bits of VBUS current data (mA) | ||||||||
| 0x13 | R | High 8 bits of VBUS current data (mA) | ||||||||
Type-C VBUS Power Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x14 | R | Low 8 bits of VBUS power data (mW) | ||||||||
| 0x15 | R | High 8 bits of VBUS power data (mW) | ||||||||
Battery Voltage Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x20 | R | Low 8 bits of total battery voltage data (mV) | ||||||||
| 0x21 | R | High 8 bits of total battery voltage data (mV) | ||||||||
Battery Current Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x22 | R | Low 8 bits of battery current data (mA) | ||||||||
| 0x23 | R | High 8 bits of battery current data (mA), signed 16-bit; positive indicates charge current, negative indicates discharge current | ||||||||
Battery Remaining Percentage Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x24 | R | Low 8 bits of battery remaining percentage data (%) | ||||||||
| 0x25 | R | High 8 bits of battery remaining percentage data (%) | ||||||||
Battery Remaining Capacity Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x26 | R | Low 8 bits of battery remaining capacity data (mAh) | ||||||||
| 0x27 | R | High 8 bits of battery remaining capacity data (mAh) | ||||||||
Battery Remaining Discharge Time Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x28 | R | Low 8 bits of battery remaining discharge time data (min) | ||||||||
| 0x29 | R | High 8 bits of battery remaining discharge time data (min) | ||||||||
Battery Remaining Charge Time Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x2a | R | Low 8 bits of battery remaining charge time data (min) | ||||||||
| 0x2b | R | High 8 bits of battery remaining charge time data (min) | ||||||||
Battery 1 Voltage Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x30 | R | Low 8 bits of battery 1 voltage data (mV) | ||||||||
| 0x31 | R | High 8 bits of battery 1 voltage data (mV) | ||||||||
Battery 2 Voltage Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x32 | R | Low 8 bits of battery 2 voltage data (mV) | ||||||||
| 0x33 | R | High 8 bits of battery 2 voltage data (mV) | ||||||||
Battery 3 Voltage Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x34 | R | Low 8 bits of battery 3 voltage data (mV) | ||||||||
| 0x35 | R | High 8 bits of battery 3 voltage data (mV) | ||||||||
Battery 4 Voltage Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x36 | R | Low 8 bits of battery 4 voltage data (mV) | ||||||||
| 0x37 | R | High 8 bits of battery 4 voltage data (mV) | ||||||||
Control Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x40 | R/W | 0x01 | Reserved | 1: Watchdog enable; 0: Watchdog disable (default) | 1: Auto-start on power (default); 0: Auto-start on power disable | |||||
Custom UPS I2C Address
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x41 | R/W | 0x2d | I2C address range: 0x08–0x77, default: 0x2d | |||||||
Watchdog Timeout Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x42 | R/W | 0xFF | Range: 0–255, unit: s, default: 0xFF | |||||||
Watchdog Delay Start Register
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x43 | R/W | 0xFF | Range: 0–255, unit: s, default: 0xFF | |||||||
Software Version
| Register | R/W | Default | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0x50 | R | Software version; shifting the decimal point left by one digit gives the software version, e.g. 0x14 = 20 = V2.0 | ||||||||