EV2300 — USB-to-I2C Adapter¶
Controls Texas Instruments EV2300A USB-to-SMBus/I2C adapters for communicating with battery fuel gauges, charger ICs, and other I2C peripherals.
- The EV2300 is auto-detected via USB HID — no VISA or NI-VISA required.
- Addresses and registers accept hex (
0x08) or decimal (8) notation. - All word values are 16-bit little-endian, matching SMBus convention.
USB HID adapter for SMBus/I2C communication. VID 0x0451, PID 0x0036. Pure-Python driver — no TI drivers or bqStudio required for basic register access.
ev2300 info¶
Show device identification: VID, PID, serial number, product name, manufacturer, and firmware version.
vid : 0x0451
pid : 0x0036
serial : HPA02 FW:2.0a/TUSB3210:0
product : EV2300A
manufacturer : Texas Inst
version : 0x0002
ev2300 read_word¶
Read a 16-bit little-endian word from an I2C device register.
| Parameter | Required | Values | Description |
|---|---|---|---|
i2c_addr |
required | 0x00 – 0x7F | 7-bit I2C slave address. |
register |
required | 0x00 – 0xFF | Register (command code) to read. |
ev2300 read_word 0x55 0x09 # read register 0x09 from device at 0x55
ev2300 read_word 0x55 0x0D # read register 0x0D
ev2300 read_word 85 9 # same as 0x55 0x09 in decimal
Returns the value in both hex and decimal: 0x0CE4 (3300).
ev2300 write_word¶
Write a 16-bit little-endian word to an I2C device register.
| Parameter | Required | Values | Description |
|---|---|---|---|
i2c_addr |
required | 0x00 – 0x7F | 7-bit I2C slave address. |
register |
required | 0x00 – 0xFF | Register (command code) to write. |
value |
required | 0x0000 – 0xFFFF | 16-bit value to write. |
ev2300 write_word 0x55 0x00 0x0041 # write 0x0041 to register 0x00
ev2300 write_word 0x55 0x10 0x0001 # write 0x0001 to register 0x10
ev2300 read_byte¶
Read a single byte from an I2C device register.
| Parameter | Required | Values | Description |
|---|---|---|---|
i2c_addr |
required | 0x00 – 0x7F | 7-bit I2C slave address. |
register |
required | 0x00 – 0xFF | Register to read. |
ev2300 read_byte 0x55 0x00 # read register 0x00 from device at 0x55
ev2300 read_byte 0x55 0x04 # read register 0x04
Returns the value in hex and decimal: 0x10 (16).
ev2300 write_byte¶
Write a single byte to an I2C device register.
| Parameter | Required | Values | Description |
|---|---|---|---|
i2c_addr |
required | 0x00 – 0x7F | 7-bit I2C slave address. |
register |
required | 0x00 – 0xFF | Register to write. |
value |
required | 0x00 – 0xFF | Byte value to write. |
ev2300 write_byte 0x55 0x00 0xFF # write 0xFF to register 0x00
ev2300 write_byte 0x55 0x04 0x10 # write 0x10 to register 0x04
ev2300 read_block¶
Read a variable-length block of bytes from an I2C device register (SMBus Block Read).
| Parameter | Required | Values | Description |
|---|---|---|---|
i2c_addr |
required | 0x00 – 0x7F | 7-bit I2C slave address. |
register |
required | 0x00 – 0xFF | Register to read. |
ev2300 read_block 0x55 0x20 # read a block register from device at 0x55
ev2300 read_block 0x55 0x21 # read another block register
Returns the block as hex bytes: [11 bytes] 54 65 78 61 73 20 49 6E 73 74 72.
Tip
Block reads are commonly used to retrieve string registers. The returned bytes are raw — interpret them as ASCII if reading a text field.
ev2300 write_block¶
Write a variable-length block of bytes to an I2C device register (SMBus Block Write).
| Parameter | Required | Values | Description |
|---|---|---|---|
i2c_addr |
required | 0x00 – 0x7F | 7-bit I2C slave address. |
register |
required | 0x00 – 0xFF | Register to write. |
hex_bytes |
required | hex string | Data bytes as a hex string (no 0x prefix, no spaces). |
ev2300 write_block 0x55 0x44 0203 # write two bytes [0x02, 0x03] to register 0x44
ev2300 write_block 0x55 0x00 AABB # write two bytes [0xAA, 0xBB] to register 0x00
Note
The hex string must be an even number of characters. Each pair of characters is one byte: AABB = [0xAA, 0xBB].
ev2300 send_byte¶
Send a single command byte to an I2C address with no register or data (SMBus Send Byte protocol).
| Parameter | Required | Values | Description |
|---|---|---|---|
i2c_addr |
required | 0x00 – 0x7F | 7-bit I2C slave address. |
command |
required | 0x00 – 0xFF | Command byte to send. |
ev2300 scan¶
Probe all 256 registers (0x00 – 0xFF) on a given I2C address using word reads, and list every register that responds successfully.
| Parameter | Required | Values | Description |
|---|---|---|---|
i2c_addr |
required | 0x00 – 0x7F | 7-bit I2C slave address to scan. |
Prints every readable register with its value:
Warning
This sends 256 read transactions, which takes several seconds. Some devices may respond poorly to reads on undefined registers — use with caution on unfamiliar hardware.
ev2300 probe¶
Send an arbitrary HID command code for low-level debugging and reverse engineering. This bypasses the standard read/write helpers and sends a raw EV2300 protocol packet.
| Parameter | Required | Values | Description |
|---|---|---|---|
cmd_code |
required | 0x00 – 0xFF | EV2300 protocol command code. |
i2c_addr |
optional | 0x00 – 0x7F | I2C address (default: 0x00). |
register |
optional | 0x00 – 0xFF | Register (default: 0x00). |
ev2300 probe 0x01 0x55 0x09 # manual read_word via command code 0x01
ev2300 probe 0x03 0x55 0x00 # manual read_byte via command code 0x03
ev2300 probe 0x06 0x55 0x12 # manual SMBus Send Byte
Shows the raw response: 0x01: resp=0x41 [AA 41 06 2C 00 E4 0C ...]
Note
Standard command codes: 0x01 = read word, 0x02 = read block, 0x03 = read byte, 0x04 = write word, 0x05 = write block, 0x06 = send byte, 0x07 = write byte.
ev2300 state¶
| Value | Effect |
|---|---|
on |
No-op (EV2300 has no output to enable) |
off |
No-op |
safe |
No-op — EV2300 is a passive adapter |
reset |
Disconnect and reconnect the USB HID session |
Setup¶
The EV2300 is detected automatically when plugged in via USB. No VISA drivers are needed.
Requirements:
- EV2300A must have firmware loaded (not in bootloader mode). If the REPL reports "bootloader mode", flash firmware using TI bqStudio.
- On Windows: no extra drivers needed — the built-in HID driver is used.
- On Linux: the user must have permission to access
/dev/hidrawN. Create a udev rule:
# /etc/udev/rules.d/99-ev2300.rules
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="0036", MODE="0666"
Then reload: sudo udevadm control --reload-rules && sudo udevadm trigger
- On macOS: install
hidapi:pip install hidapi
Troubleshooting¶
"Device error (0x46)" or I2C communication failures¶
This usually means the EV2300 USB-to-I2C bridge is in a bad state. Common causes:
- The fuel gauge / BQ EVM was powered on after the EV2300 was connected
- A previous session left the I2C bus in a stuck state
- Another program (e.g. BQ Studio) had the EV2300 open
Recovery steps (also available via ev2300 fix in the REPL):
- Make sure the BQ EVM board is powered (e.g. PSU set to 18V)
- Press the BOOT button on the BQ EVM board — this resets both the EV2300 bridge and the fuel gauge IC
- In the REPL, disconnect the adapter:
disconnect ev2300 - Re-scan to pick it back up:
scan - Retry your command
If it still doesn't work, unplug the EV2300 USB cable, plug it back in, then run disconnect ev2300, scan, and retry.
"connect failed" during scan¶
If the EV2300 is detected but cannot be opened, another program likely has it locked. Close BQ Studio, bqStudio, or any other TI tool that may be using the EV2300, then run scan again.
Best practices¶
- Power on the BQ EVM board before launching the REPL
- If using a BQ EVM with a BOOT button, press it once after power-on to ensure a clean I2C bus
- Close BQ Studio before starting the REPL — only one program can hold the EV2300 HID handle at a time