For a 16-bit field, start at its low-byte address and read 2 consecutive bytes.
1.3 Data Types and Endianness
UINT8: 8-bit unsigned integer.
UINT16: Combine as Byte0 | (Byte1 << 8).
The raw ADC value uses the lower 12 bits of the UINT16 value.
Current and calibration reference values are expressed in 0.01 mA:
Current (mA) = Register Value / 100
2. Register/Command Overview
Address/Range
Name
Length
Access
Default
Retained After Power-Off
Summary
Details
0x00 ~ 0x01
ADC Raw Value
2
R
Runtime
No
Raw 12-bit ADC sample
4.1
0x20 ~ 0x21
Current Value
2
R
Runtime
No
Measured current in 0.01 mA
4.2
0x30 ~ 0x31
Reference Current
2
R/W
Not specified
Not specified
Calibration reference current in 0.01 mA
4.3
0xFE
Firmware Version
1
R
Firmware-defined
Firmware-defined
Firmware version number
4.4
0xFF
I2C Address
1
R/W
0x55
Not specified
Current I2C slave address
4.5
3. Address Conventions
3.1 Address Regions
Address/Range
Region
Description
0x00 ~ 0x01
ADC Measurement
Raw ADC sample
0x20 ~ 0x21
Current Measurement
Converted current value
0x30 ~ 0x31
Current Calibration
Calibration reference current
0xFE ~ 0xFF
Fixed System Addresses
Firmware version and I2C address
3.2 Fixed Addresses
Address
Name
Description
0xFE
Firmware Version
Reads the current firmware version number
0xFF
I2C Address
Reads or changes the current I2C slave address
3.3 Reserved Addresses
All addresses not listed in Section 2 are undefined in protocol V1 and must be treated as Reserved. The host must not read or write these addresses or rely on their returned values or write behavior.
4. Register Details
4.1 ADC Raw Value
Address/Range
Length
Access
Description
0x00 ~ 0x01
2 byte
R
Raw 12-bit ADC sample
Address
Parameter
Type
Description
0x00
ADC1-L
UINT8
Low byte of the raw ADC value
0x01
ADC1-H
UINT8
High byte of the raw ADC value; use the lower 12 bits of the combined result
Read 2 consecutive bytes starting at 0x00, then combine them as follows:
adc_raw = (ADC1-L | (ADC1-H << 8)) & 0x0FFF
4.2 Current Value
Address/Range
Length
Access
Description
0x20 ~ 0x21
2 byte
R
Current measurement
Address
Parameter
Type
Description
0x20
Current1-L
UINT8
Low byte of the current value
0x21
Current1-H
UINT8
High byte of the current value
Read 2 consecutive bytes starting at 0x20, then convert them as follows:
Apply a known current using a standard signal source.
Multiply the current by 100 to obtain a UINT16 calibration value.
Starting at 0x30, write the low byte followed by the high byte.
Wait at least 500 ms after writing before reading the measurement.
For 10.00 mA:
Calibration Value = 10.00 × 100 = 1000 = 0x03E8
Data written to 0x30 ~ 0x31 = E8 03
4.4 Firmware Version
Address
Length
Access
Description
0xFE
1 byte
R
Current firmware version number
Read register 0xFE to obtain the 1-byte firmware version number.
4.5 I2C Address
Address
Length
Access
Description
0xFF
1 byte
R/W
Current 7-bit I2C address
Read 0xFF to obtain the current I2C address.
Write a 1-byte new address to 0xFF to change the device address.
After the address is changed successfully, subsequent host transactions must use the new address.
5. Arduino Driver Mapping
Protocol Function
Arduino Driver Method
Read raw ADC value
getADC12BitsValue(0)
Read current value
getCurrentValue(0)
Write calibration current
setCalCurrent(0, value)
Read firmware version
getFirmwareVersion()
Read I2C address
getI2CAddress()
Change I2C address
setI2CAddress(addr)
6. Version History
Document Version
Protocol Version
Date
Description
V1.0
V1
2023-01-30
Initial release of the I2C register protocol
V1.1
V1
2026-08-05
Restructured using the M5Stack Atom Driver I2C Control Protocol template; added the general access flow, register overview, address conventions, and register details without changing the protocol