I2C Probe - A community project
Posted: Fri Sep 19, 2025 9:26 pm
I had the idea to try this while working on another project. Would it be possible to create a simple circuit to probe an i2c connection between an MCU and an i2c device. It's not possible (I think!) to use the MCUs i2c hardware - as it wants to assert ACK/NACK etc.
Initially - I worked with an ATTiny chip - I wanted it to be as small and simple as possible with just 4 connections (VCC, Gnd, SCL and SDA) to the target circuit.
Initially the plan was for a self-contained device - and yes I know a logic analyser can do all this when connected to a PC
(It's a baby logic analyser!)
With an ATTiny861 - running at 16MHz (20 would be possible with an external crystal) - and my own SPI driver (for size and speed) and ST7789V code - I added a 7 x 5 font- to allow a maximum of data per line (it's also 'bitwise' packed to take up minimum memory - it's displayed at 2x size).
The ATTiny worked well - and could decode i2c signals at 40k baud !
However - most i2c is at 100k (or 400k!) so although the Tiny was putting in a good effort - I wasn't sure I could push it that fast.....
So - then I got an esp32-s3 (note this should work okay on the C3 or plain esp32) - I added a couple of SPI routines (to initialise and send) - and the display works quickly! (Of course with all the extra memory I could use the display component)
However - on adding pin interrupts for SDA and SCL - I found it could only read i2c at 1k. I was somewhat disappointed.
So - I moved the ISRs to supplementary code (using the view code option to get the C) - and stored them in IRAM - I also modified the setup for these to allow for this. I changed the pin reads (in the SDA_Change_ISR to gpio_get_level(pin); - which works in IRAM as well.
This pushed the speed to 60k - better - and then changing the build options (using idf.py menuconfig) to optimise for speed gets us reading 400k
So - the questions:
1) The esp32 only allows 3V3 signals - I'd like it to work with 5V or 3V3 - any electronics folk any ideas on an easy way to allow either (and possibly other voltages)
2) The display - which I have set to landscape (this can be changed in properties) - doesn't allow hardware scrolling (it does in portrait!) - and the display 'wraps' clearing the next line. The esp32 is probably fast enough to scroll either orientation - but suggestions as to layout? The current layout is perhaps a little squashed!
3) I use a green block for START, white for ACK, cyan for NACK and blue (really) for STOP - better suggestions please.
4) Once I started I thought of lots of ideas (decode UART, an app allowing signal 'injection', a probe of attached i2c devices etc) Ideas (and help with coding) welcome...
5) Help designing a PCB (KiCAD tests my mouse control/vision to breaking point)
6) Ideas for other functions etc
7) It's possible to speed up the display somewhat - the ATTiny has just 512bytes of RAM - so buffers were small by necessity.
So far I have tested with another esp32-s3 reading a ds3231 RTC - I have tested using the FC component (a bit boring) and my own component (which does multi-byte reads)
Wiring the display - the pins are defined in supplementary code for SPI
#define PIN_NUM_MOSI 11
#define PIN_NUM_MISO -1 // Not supported by my display - a touchscreen might be nice?
#define PIN_NUM_SCLK 12
#define PIN_NUM_CS 10 // I do connect this - but some displays don't have a CS pin and an option is to pull it to Gnd.
DC is 8
Reset 9
Backlight I pull to VCC - but could be controlled if required.
SCL of the circuit to be probed is A5 and SDA A4 (note that the interrupt on SCL only needs a rising pin, SDA - needs rising and falling)
As can be seen in the image - both MCUs are powered by one USB connection..
Martin
Initially - I worked with an ATTiny chip - I wanted it to be as small and simple as possible with just 4 connections (VCC, Gnd, SCL and SDA) to the target circuit.
Initially the plan was for a self-contained device - and yes I know a logic analyser can do all this when connected to a PC

With an ATTiny861 - running at 16MHz (20 would be possible with an external crystal) - and my own SPI driver (for size and speed) and ST7789V code - I added a 7 x 5 font- to allow a maximum of data per line (it's also 'bitwise' packed to take up minimum memory - it's displayed at 2x size).
The ATTiny worked well - and could decode i2c signals at 40k baud !
However - most i2c is at 100k (or 400k!) so although the Tiny was putting in a good effort - I wasn't sure I could push it that fast.....
So - then I got an esp32-s3 (note this should work okay on the C3 or plain esp32) - I added a couple of SPI routines (to initialise and send) - and the display works quickly! (Of course with all the extra memory I could use the display component)
However - on adding pin interrupts for SDA and SCL - I found it could only read i2c at 1k. I was somewhat disappointed.
So - I moved the ISRs to supplementary code (using the view code option to get the C) - and stored them in IRAM - I also modified the setup for these to allow for this. I changed the pin reads (in the SDA_Change_ISR to gpio_get_level(pin); - which works in IRAM as well.
This pushed the speed to 60k - better - and then changing the build options (using idf.py menuconfig) to optimise for speed gets us reading 400k

So - the questions:
1) The esp32 only allows 3V3 signals - I'd like it to work with 5V or 3V3 - any electronics folk any ideas on an easy way to allow either (and possibly other voltages)
2) The display - which I have set to landscape (this can be changed in properties) - doesn't allow hardware scrolling (it does in portrait!) - and the display 'wraps' clearing the next line. The esp32 is probably fast enough to scroll either orientation - but suggestions as to layout? The current layout is perhaps a little squashed!
3) I use a green block for START, white for ACK, cyan for NACK and blue (really) for STOP - better suggestions please.
4) Once I started I thought of lots of ideas (decode UART, an app allowing signal 'injection', a probe of attached i2c devices etc) Ideas (and help with coding) welcome...
5) Help designing a PCB (KiCAD tests my mouse control/vision to breaking point)
6) Ideas for other functions etc
7) It's possible to speed up the display somewhat - the ATTiny has just 512bytes of RAM - so buffers were small by necessity.
So far I have tested with another esp32-s3 reading a ds3231 RTC - I have tested using the FC component (a bit boring) and my own component (which does multi-byte reads)
Wiring the display - the pins are defined in supplementary code for SPI
#define PIN_NUM_MOSI 11
#define PIN_NUM_MISO -1 // Not supported by my display - a touchscreen might be nice?
#define PIN_NUM_SCLK 12
#define PIN_NUM_CS 10 // I do connect this - but some displays don't have a CS pin and an option is to pull it to Gnd.
DC is 8
Reset 9
Backlight I pull to VCC - but could be controlled if required.
SCL of the circuit to be probed is A5 and SDA A4 (note that the interrupt on SCL only needs a rising pin, SDA - needs rising and falling)
As can be seen in the image - both MCUs are powered by one USB connection..
Martin