I’ve been having trouble talking with an I2C device, where only the first byte (on of the device’s R/W address pair) is ACK
’d, and all other bytes get NACK
’d.
history
HW / FW combos tried:
- BP6 on
3d7b985
(~2025-05-19) - BP5 on
db84e03
(2025-03-22)
I thought it might be a hardware issue on the connected device, so I disconnected the first and connected a second (identical) I2C device. I’m still getting NACK to everything except the first byte, at both 10kHz and 100kHz.
Device I2C address == 0x36
, so R/W address pair is 0x6D / 0x6C
.
Command sequence is simply entering I2C mode, enabling pullups, enabling 3V3 with max 100mA, and then doing a basic transfer:
0x6D
is the I2C read address0x00
is the register base,STATUS_BASE
0x01
is the “read chip id” function that should return a single byte
m i2c
P
W 3.3 100
[ 0x6D 0x00 0x01 r:1 ]
Result:
I2C> [ 0x6D 0x00 0x01 r:1 ]
I2C START
TX: 0x6D ACK 0x00 NACK 0x01 NACK
RX: 0xFF NACK
I2C STOP
Due to timezones, if you have specific information that you’d like me to collect, or other things to try, let me know.
Solution
Turns out I misread how to interact with the device, and didn’t have the background in I2C to realize it. To read from the device takes two commands:
- First send the write I2C address, the register base, and edge/function (three bytes), without also sending the device data
- delay if needed … device/edge/function specific.
- Then send the read I2C address, and read the resulting data
This works perfectly:
I2C> [ 0x6C 0x00 0x01 ] d:8 [ 0x6D r:1 ]
I2C START
TX: 0x6C ACK 0x00 ACK 0x01 ACK
I2C STOP
Delay: 8us
I2C START
TX: 0x6D ACK
RX: 0x55 NACK
I2C STOP
Thanks to Ian, for helping me understand what that wording means!
Hopefully, my sharing my ignorance and learning will be helpful to other learners of I2C.