My i2c sniffer

Status
Not open for further replies.

kito

Active member
I am sharing my I2C sniffer I made for my teensy 3.1. You can basically attach your teensy to an I2C bus SCL0(pin19)and SDA0(pin18) and it will dump out the i2c commands to the serial port.

The following is a sample output watching the Linear Powerplay GUI with their 3880 power controller chip demo kit.

Code:
Opening port
-----------------
Legend:
 S=Start
 Sr=Start repeat
 P=stoP
 R=Read
 W=Write
 A=Ack
 N=Nak
-----------------
Waiting for data...
Port open
Waiting for data...
Waiting for data...
S,Addr=0x48,W,A,PAGE(0x00),A,Sr,Addr=0x48,R,A,0x01,N,P
S,Addr=0x48,W,A,MFR_CONFIG_ALL_LTC3880(0xD1),A,Sr,Addr=0x48,R,A,0x69,N,P
S,Addr=0x48,W,A,PAGE(0x00),A,0x00,P
S,Addr=0x48,W,A,MFR_COMMON(0xEF),A,Sr,Addr=0x48,R,A,0xDC,N,P
S,Addr=0x48,W,A,READ_TEMPERATURE_2(0x8E),A,Sr,Addr=0x48,R,A,0xDD,A,0xE2,N,P
S,Addr=0x48,W,A,READ_IIN(0x89),A,Sr,Addr=0x48,R,A,0x02,A,0x9A,N,P
S,Addr=0x48,W,A,NOT_DOCUMENTED_0X95(0x95),A,Sr,Addr=0x48,R,A,0xE8,A,0x03,N,P
S,Addr=0x48,W,A,READ_VIN(0x88),A,Sr,Addr=0x48,R,A,0x00,A,0xD3,N,P
S,Addr=0x48,W,A,MFR_CONFIG_ALL_LTC3880(0xD1),A,Sr,Addr=0x48,R,A,0x69,N,P
S,Addr=0x48,W,A,MFR_VIN_PEAK(0xDE),A,Sr,Addr=0x48,R,A,0x00,A,0xD3,N,P
S,Addr=0x48,W,A,MFR_TEMPERATURE_2_PEAK(0xF4),A,Sr,Addr=0x48,R,A,0xE0,A,0xE2,N,P
S,Addr=0x48,W,A,STATUS_INPUT(0x7C),A,Sr,Addr=0x48,R,A,0x00,N,P
S,Addr=0x48,W,A,STATUS_CML(0x7E),A,Sr,Addr=0x48,R,A,0x00,N,P
S,Addr=0x48,W,A,MFR_PADS(0xE5),A,Sr,Addr=0x48,R,A,0x33,A,0x03,N,P
S,Addr=0x48,W,A,LTC2978_MFR_VOUT_MIN (0xFB),A,Sr,Addr=0x48,R,A,0x06,A,0x5A,A,0x49,A,0xB4,A,0x00,A,0x00,A,0x00,A,0x23,N,Sr,Addr=0x48,W,A,0x00,A,0x00,N,0x52,A,P
S,Addr=0x48,W,A,MFR_VOUT_PEAK(0xDD),A,Sr,Addr=0x48,R,A,0x36,A,0x0B,N,P
S,Addr=0x48,W,A,READ_VOUT(0x8B),A,Sr,Addr=0x48,R,A,0x33,A,0x0B,N,P
 

Attachments

  • MyLA3.ino
    6.8 KB · Views: 1,224
kito thank you for sharing this code, this provided a great starting point for some similar I2C decoding I was doing.
 
i used this to sniff the touchscreen coordinates, touches, multi touches of my pioneer nex4100, the chip is i2c located just behind the touchscreen bezel lcd frame, required very fine soldering detail to miniscule 2 solder points with optional 3rd for interrupt touches, to allow teensy to feed it as mouse data to pc over USB. after i put the pc hdmi on the NEX for video into and mapped the coordinates, i was able to control a windows pc via touchscreen from the radio

pretty crazy, i even used a touch gesture on the radio to start the car hehehe
 
kito thank you for sharing this code, this provided a great starting point for some similar I2C decoding I was doing.

Thanks for the note. Its been so long I chuckled to myself when I saw the forum update me. Actually one thing to note is that I think the code I originally reads SCL as pin 18 and SDA pin 19 and the comments are wrong. The funny thing is I mistakenly wired it backwards on my setup and wrote the code backwards. So the two backwards mistakes equals 1 step forward I guess.:rolleyes:
 
Status
Not open for further replies.
Back
Top